From bab5ca24524061fede7ac0c00a8cbb723f820673 Mon Sep 17 00:00:00 2001 From: Alex Kondratev <56111142+soapun@users.noreply.github.com> Date: Sat, 27 Sep 2025 10:30:50 +0300 Subject: [PATCH] [python] add async httpx support (#22021) * [python] fix #19255 add async httpx support * update docs * 1. "async" parameter for templates 2. hand written tests for python-httpx 3. CI workflow updated * fix mypy --- .../workflows/samples-python-petstore.yaml | 1 + bin/configs/python-httpx.yaml | 15 + docs/generators/python.md | 2 +- .../languages/PythonClientCodegen.java | 8 +- .../python/README_onlypackage.mustache | 4 +- .../src/main/resources/python/api.mustache | 16 +- .../main/resources/python/api_client.mustache | 12 +- .../resources/python/api_doc_example.mustache | 4 +- .../main/resources/python/api_test.mustache | 18 +- .../resources/python/common_README.mustache | 4 +- .../resources/python/configuration.mustache | 12 +- .../main/resources/python/httpx/rest.mustache | 185 + .../main/resources/python/pyproject.mustache | 7 +- .../resources/python/requirements.mustache | 3 + .../src/main/resources/python/setup.mustache | 3 + .../python-httpx/.github/workflows/python.yml | 34 + .../client/petstore/python-httpx/.gitignore | 66 + .../petstore/python-httpx/.gitlab-ci.yml | 31 + .../python-httpx/.openapi-generator-ignore | 23 + .../python-httpx/.openapi-generator/FILES | 263 + .../python-httpx/.openapi-generator/VERSION | 1 + .../client/petstore/python-httpx/.travis.yml | 17 + .../client/petstore/python-httpx/README.md | 317 + .../docs/AdditionalPropertiesAnyType.md | 29 + .../docs/AdditionalPropertiesClass.md | 30 + .../docs/AdditionalPropertiesObject.md | 29 + ...AdditionalPropertiesWithDescriptionOnly.md | 29 + .../python-httpx/docs/AllOfSuperModel.md | 29 + .../python-httpx/docs/AllOfWithSingleRef.md | 30 + .../petstore/python-httpx/docs/Animal.md | 30 + .../python-httpx/docs/AnotherFakeApi.md | 77 + .../petstore/python-httpx/docs/AnyOfColor.md | 29 + .../petstore/python-httpx/docs/AnyOfPig.md | 31 + .../python-httpx/docs/ArrayOfArrayOfModel.md | 29 + .../docs/ArrayOfArrayOfNumberOnly.md | 29 + .../python-httpx/docs/ArrayOfNumberOnly.md | 29 + .../petstore/python-httpx/docs/ArrayTest.md | 32 + .../python-httpx/docs/BaseDiscriminator.md | 29 + .../petstore/python-httpx/docs/BasquePig.md | 30 + .../petstore/python-httpx/docs/Bathing.md | 31 + .../python-httpx/docs/Capitalization.md | 34 + .../client/petstore/python-httpx/docs/Cat.md | 29 + .../petstore/python-httpx/docs/Category.md | 30 + .../python-httpx/docs/CircularAllOfRef.md | 30 + .../docs/CircularReferenceModel.md | 30 + .../petstore/python-httpx/docs/ClassModel.md | 30 + .../petstore/python-httpx/docs/Client.md | 29 + .../petstore/python-httpx/docs/Color.md | 29 + .../petstore/python-httpx/docs/Creature.md | 30 + .../python-httpx/docs/CreatureInfo.md | 29 + .../petstore/python-httpx/docs/DanishPig.md | 30 + .../python-httpx/docs/DataOutputFormat.md | 14 + .../petstore/python-httpx/docs/DefaultApi.md | 68 + .../python-httpx/docs/DeprecatedObject.md | 29 + .../docs/DiscriminatorAllOfSub.md | 28 + .../docs/DiscriminatorAllOfSuper.md | 29 + .../client/petstore/python-httpx/docs/Dog.md | 29 + .../petstore/python-httpx/docs/DummyModel.md | 30 + .../petstore/python-httpx/docs/EnumArrays.md | 30 + .../petstore/python-httpx/docs/EnumClass.md | 14 + .../python-httpx/docs/EnumNumberVendorExt.md | 14 + .../docs/EnumRefWithDefaultValue.md | 29 + .../petstore/python-httpx/docs/EnumString1.md | 12 + .../petstore/python-httpx/docs/EnumString2.md | 12 + .../python-httpx/docs/EnumStringVendorExt.md | 14 + .../petstore/python-httpx/docs/EnumTest.md | 41 + .../petstore/python-httpx/docs/FakeApi.md | 2540 ++++ .../docs/FakeClassnameTags123Api.md | 88 + .../petstore/python-httpx/docs/Feeding.md | 31 + .../client/petstore/python-httpx/docs/File.md | 30 + .../python-httpx/docs/FileSchemaTestClass.md | 30 + .../petstore/python-httpx/docs/FirstRef.md | 30 + .../client/petstore/python-httpx/docs/Foo.md | 29 + .../docs/FooGetDefaultResponse.md | 29 + .../petstore/python-httpx/docs/FormatTest.md | 45 + .../python-httpx/docs/HasOnlyReadOnly.md | 30 + .../python-httpx/docs/HealthCheckResult.md | 30 + .../petstore/python-httpx/docs/HuntingDog.md | 29 + .../docs/ImportTestDatetimeApi.md | 70 + .../client/petstore/python-httpx/docs/Info.md | 29 + .../docs/InnerDictWithProperty.md | 29 + .../petstore/python-httpx/docs/InputAllOf.md | 29 + .../petstore/python-httpx/docs/IntOrString.md | 28 + .../petstore/python-httpx/docs/ListClass.md | 29 + .../python-httpx/docs/MapOfArrayOfModel.md | 29 + .../petstore/python-httpx/docs/MapTest.md | 32 + ...dPropertiesAndAdditionalPropertiesClass.md | 31 + .../python-httpx/docs/Model200Response.md | 31 + .../python-httpx/docs/ModelApiResponse.md | 31 + .../petstore/python-httpx/docs/ModelField.md | 29 + .../petstore/python-httpx/docs/ModelReturn.md | 30 + .../petstore/python-httpx/docs/MultiArrays.md | 30 + .../client/petstore/python-httpx/docs/Name.md | 33 + .../python-httpx/docs/NullableClass.md | 41 + .../python-httpx/docs/NullableProperty.md | 30 + .../petstore/python-httpx/docs/NumberOnly.md | 29 + .../docs/ObjectToTestAdditionalProperties.md | 30 + .../docs/ObjectWithDeprecatedFields.md | 32 + .../python-httpx/docs/OneOfEnumString.md | 17 + .../petstore/python-httpx/docs/Order.md | 34 + .../python-httpx/docs/OuterComposite.md | 31 + .../petstore/python-httpx/docs/OuterEnum.md | 14 + .../docs/OuterEnumDefaultValue.md | 14 + .../python-httpx/docs/OuterEnumInteger.md | 14 + .../docs/OuterEnumIntegerDefaultValue.md | 16 + .../docs/OuterObjectWithEnumProperty.md | 30 + .../petstore/python-httpx/docs/Parent.md | 29 + .../docs/ParentWithOptionalDict.md | 29 + .../client/petstore/python-httpx/docs/Pet.md | 34 + .../petstore/python-httpx/docs/PetApi.md | 962 ++ .../client/petstore/python-httpx/docs/Pig.md | 31 + .../petstore/python-httpx/docs/PonySizes.md | 29 + .../python-httpx/docs/PoopCleaning.md | 31 + .../python-httpx/docs/PrimitiveString.md | 29 + .../petstore/python-httpx/docs/PropertyMap.md | 29 + .../docs/PropertyNameCollision.md | 31 + .../python-httpx/docs/ReadOnlyFirst.md | 30 + .../docs/SecondCircularAllOfRef.md | 30 + .../petstore/python-httpx/docs/SecondRef.md | 30 + .../python-httpx/docs/SelfReferenceModel.md | 30 + .../python-httpx/docs/SingleRefType.md | 12 + .../python-httpx/docs/SpecialCharacterEnum.md | 28 + .../python-httpx/docs/SpecialModelName.md | 29 + .../petstore/python-httpx/docs/SpecialName.md | 31 + .../petstore/python-httpx/docs/StoreApi.md | 291 + .../client/petstore/python-httpx/docs/Tag.md | 30 + .../client/petstore/python-httpx/docs/Task.md | 31 + .../python-httpx/docs/TaskActivity.md | 31 + .../petstore/python-httpx/docs/TestEnum.md | 16 + .../python-httpx/docs/TestEnumWithDefault.md | 14 + .../TestErrorResponsesWithModel400Response.md | 29 + .../TestErrorResponsesWithModel404Response.md | 29 + ...lineFreeformAdditionalPropertiesRequest.md | 29 + .../docs/TestModelWithEnumDefault.md | 33 + ...ObjectForMultipartRequestsRequestMarker.md | 29 + .../petstore/python-httpx/docs/Tiger.md | 29 + .../client/petstore/python-httpx/docs/Type.md | 16 + ...edDictWithAdditionalModelListProperties.md | 29 + ...dDictWithAdditionalStringListProperties.md | 29 + ...leWithAdditionalPropertiesRequestObject.md | 30 + .../client/petstore/python-httpx/docs/User.md | 36 + .../petstore/python-httpx/docs/UserApi.md | 550 + .../python-httpx/docs/WithNestedOneOf.md | 31 + .../client/petstore/python-httpx/git_push.sh | 57 + .../python-httpx/petstore_api/__init__.py | 288 + .../python-httpx/petstore_api/api/__init__.py | 12 + .../petstore_api/api/another_fake_api.py | 311 + .../petstore_api/api/default_api.py | 275 + .../python-httpx/petstore_api/api/fake_api.py | 10120 ++++++++++++++++ .../api/fake_classname_tags123_api.py | 312 + .../api/import_test_datetime_api.py | 278 + .../python-httpx/petstore_api/api/pet_api.py | 2579 ++++ .../petstore_api/api/store_api.py | 1085 ++ .../python-httpx/petstore_api/api/user_api.py | 2161 ++++ .../python-httpx/petstore_api/api_client.py | 814 ++ .../python-httpx/petstore_api/api_response.py | 21 + .../petstore_api/configuration.py | 746 ++ .../python-httpx/petstore_api/exceptions.py | 216 + .../petstore_api/models/__init__.py | 128 + .../models/additional_properties_any_type.py | 100 + .../models/additional_properties_class.py | 89 + .../models/additional_properties_object.py | 100 + ...tional_properties_with_description_only.py | 100 + .../petstore_api/models/all_of_super_model.py | 87 + .../models/all_of_with_single_ref.py | 90 + .../petstore_api/models/animal.py | 111 + .../petstore_api/models/any_of_color.py | 156 + .../petstore_api/models/any_of_pig.py | 134 + .../models/array_of_array_of_model.py | 100 + .../models/array_of_array_of_number_only.py | 87 + .../models/array_of_number_only.py | 87 + .../petstore_api/models/array_test.py | 107 + .../petstore_api/models/base_discriminator.py | 110 + .../petstore_api/models/basque_pig.py | 89 + .../petstore_api/models/bathing.py | 105 + .../petstore_api/models/capitalization.py | 97 + .../python-httpx/petstore_api/models/cat.py | 90 + .../petstore_api/models/category.py | 89 + .../models/circular_all_of_ref.py | 99 + .../models/circular_reference_model.py | 95 + .../petstore_api/models/class_model.py | 87 + .../petstore_api/models/client.py | 87 + .../python-httpx/petstore_api/models/color.py | 167 + .../petstore_api/models/creature.py | 112 + .../petstore_api/models/creature_info.py | 87 + .../petstore_api/models/danish_pig.py | 89 + .../petstore_api/models/data_output_format.py | 38 + .../petstore_api/models/deprecated_object.py | 87 + .../models/discriminator_all_of_sub.py | 87 + .../models/discriminator_all_of_super.py | 107 + .../python-httpx/petstore_api/models/dog.py | 90 + .../petstore_api/models/dummy_model.py | 95 + .../petstore_api/models/enum_arrays.py | 110 + .../petstore_api/models/enum_class.py | 38 + .../models/enum_number_vendor_ext.py | 38 + .../models/enum_ref_with_default_value.py | 88 + .../petstore_api/models/enum_string1.py | 37 + .../petstore_api/models/enum_string2.py | 37 + .../models/enum_string_vendor_ext.py | 38 + .../petstore_api/models/enum_test.py | 189 + .../petstore_api/models/feeding.py | 105 + .../python-httpx/petstore_api/models/file.py | 87 + .../models/file_schema_test_class.py | 100 + .../petstore_api/models/first_ref.py | 95 + .../python-httpx/petstore_api/models/foo.py | 87 + .../models/foo_get_default_response.py | 91 + .../petstore_api/models/format_test.py | 163 + .../petstore_api/models/has_only_read_only.py | 93 + .../models/health_check_result.py | 92 + .../petstore_api/models/hunting_dog.py | 94 + .../python-httpx/petstore_api/models/info.py | 92 + .../models/inner_dict_with_property.py | 87 + .../petstore_api/models/input_all_of.py | 100 + .../petstore_api/models/int_or_string.py | 144 + .../petstore_api/models/list_class.py | 87 + .../models/map_of_array_of_model.py | 104 + .../petstore_api/models/map_test.py | 104 + ...perties_and_additional_properties_class.py | 106 + .../petstore_api/models/model200_response.py | 89 + .../petstore_api/models/model_api_response.py | 91 + .../petstore_api/models/model_field.py | 87 + .../petstore_api/models/model_return.py | 87 + .../petstore_api/models/multi_arrays.py | 105 + .../python-httpx/petstore_api/models/name.py | 97 + .../petstore_api/models/nullable_class.py | 180 + .../petstore_api/models/nullable_property.py | 105 + .../petstore_api/models/number_only.py | 87 + .../object_to_test_additional_properties.py | 87 + .../models/object_with_deprecated_fields.py | 97 + .../petstore_api/models/one_of_enum_string.py | 39 + .../python-httpx/petstore_api/models/order.py | 108 + .../petstore_api/models/outer_composite.py | 91 + .../petstore_api/models/outer_enum.py | 38 + .../models/outer_enum_default_value.py | 38 + .../petstore_api/models/outer_enum_integer.py | 38 + .../outer_enum_integer_default_value.py | 39 + .../models/outer_object_with_enum_property.py | 96 + .../petstore_api/models/parent.py | 100 + .../models/parent_with_optional_dict.py | 100 + .../python-httpx/petstore_api/models/pet.py | 120 + .../python-httpx/petstore_api/models/pig.py | 140 + .../petstore_api/models/pony_sizes.py | 88 + .../petstore_api/models/poop_cleaning.py | 105 + .../petstore_api/models/primitive_string.py | 89 + .../petstore_api/models/property_map.py | 100 + .../models/property_name_collision.py | 91 + .../petstore_api/models/read_only_first.py | 91 + .../models/second_circular_all_of_ref.py | 99 + .../petstore_api/models/second_ref.py | 95 + .../models/self_reference_model.py | 95 + .../petstore_api/models/single_ref_type.py | 37 + .../models/special_character_enum.py | 45 + .../petstore_api/models/special_model_name.py | 87 + .../petstore_api/models/special_name.py | 105 + .../python-httpx/petstore_api/models/tag.py | 89 + .../python-httpx/petstore_api/models/task.py | 94 + .../petstore_api/models/task_activity.py | 151 + .../petstore_api/models/test_enum.py | 39 + .../models/test_enum_with_default.py | 38 + ..._error_responses_with_model400_response.py | 87 + ..._error_responses_with_model404_response.py | 87 + ..._freeform_additional_properties_request.py | 100 + .../models/test_model_with_enum_default.py | 107 + ...t_for_multipart_requests_request_marker.py | 87 + .../python-httpx/petstore_api/models/tiger.py | 87 + .../python-httpx/petstore_api/models/type.py | 39 + ...t_with_additional_model_list_properties.py | 104 + ..._with_additional_string_list_properties.py | 87 + ...th_additional_properties_request_object.py | 87 + .../python-httpx/petstore_api/models/user.py | 101 + .../petstore_api/models/with_nested_one_of.py | 96 + .../python-httpx/petstore_api/py.typed | 0 .../python-httpx/petstore_api/rest.py | 194 + .../python-httpx/petstore_api/signing.py | 432 + .../petstore/python-httpx/pyproject.toml | 91 + .../petstore/python-httpx/requirements.txt | 7 + .../client/petstore/python-httpx/setup.cfg | 2 + .../client/petstore/python-httpx/setup.py | 53 + .../python-httpx/test-requirements.txt | 6 + .../petstore/python-httpx/test/__init__.py | 0 .../test_additional_properties_any_type.py | 51 + .../test/test_additional_properties_class.py | 58 + .../test/test_additional_properties_object.py | 51 + ...tional_properties_with_description_only.py | 51 + .../test/test_all_of_super_model.py | 51 + .../test/test_all_of_with_single_ref.py | 52 + .../petstore/python-httpx/test/test_animal.py | 53 + .../test/test_another_fake_api.py | 38 + .../python-httpx/test/test_any_of_color.py | 50 + .../python-httpx/test/test_any_of_pig.py | 56 + .../test/test_array_of_array_of_model.py | 57 + .../test_array_of_array_of_number_only.py | 55 + .../test/test_array_of_number_only.py | 53 + .../python-httpx/test/test_array_test.py | 68 + .../test/test_base_discriminator.py | 51 + .../python-httpx/test/test_basque_pig.py | 54 + .../python-httpx/test/test_bathing.py | 56 + .../python-httpx/test/test_capitalization.py | 56 + .../petstore/python-httpx/test/test_cat.py | 51 + .../python-httpx/test/test_category.py | 53 + .../test/test_circular_all_of_ref.py | 54 + .../test/test_circular_reference_model.py | 59 + .../python-httpx/test/test_class_model.py | 51 + .../petstore/python-httpx/test/test_client.py | 51 + .../petstore/python-httpx/test/test_color.py | 50 + .../python-httpx/test/test_creature.py | 56 + .../python-httpx/test/test_creature_info.py | 52 + .../python-httpx/test/test_danish_pig.py | 54 + .../test/test_data_output_format.py | 33 + .../python-httpx/test/test_default_api.py | 37 + .../test/test_deprecated_object.py | 51 + .../test/test_discriminator_all_of_sub.py | 50 + .../test/test_discriminator_all_of_super.py | 52 + .../petstore/python-httpx/test/test_dog.py | 51 + .../python-httpx/test/test_dummy_model.py | 55 + .../python-httpx/test/test_enum_arrays.py | 54 + .../python-httpx/test/test_enum_class.py | 33 + .../test/test_enum_number_vendor_ext.py | 33 + .../test/test_enum_ref_with_default_value.py | 51 + .../python-httpx/test/test_enum_string1.py | 33 + .../python-httpx/test/test_enum_string2.py | 33 + .../test/test_enum_string_vendor_ext.py | 33 + .../python-httpx/test/test_enum_test.py | 64 + .../python-httpx/test/test_fake_api.py | 279 + .../test/test_fake_classname_tags123_api.py | 38 + .../python-httpx/test/test_feeding.py | 56 + .../petstore/python-httpx/test/test_file.py | 51 + .../test/test_file_schema_test_class.py | 56 + .../python-httpx/test/test_first_ref.py | 57 + .../petstore/python-httpx/test/test_foo.py | 51 + .../test/test_foo_get_default_response.py | 52 + .../python-httpx/test/test_format_test.py | 70 + .../test/test_has_only_read_only.py | 52 + .../test/test_health_check_result.py | 51 + .../python-httpx/test/test_hunting_dog.py | 51 + .../test/test_import_test_datetime_api.py | 38 + .../petstore/python-httpx/test/test_info.py | 51 + .../test/test_inner_dict_with_property.py | 51 + .../python-httpx/test/test_input_all_of.py | 55 + .../python-httpx/test/test_int_or_string.py | 50 + .../python-httpx/test/test_list_class.py | 51 + .../test/test_map_of_array_of_model.py | 57 + .../python-httpx/test/test_map_test.py | 64 + ...perties_and_additional_properties_class.py | 57 + .../test/test_model200_response.py | 52 + .../test/test_model_api_response.py | 53 + .../python-httpx/test/test_model_field.py | 51 + .../python-httpx/test/test_model_return.py | 51 + .../python-httpx/test/test_multi_arrays.py | 59 + .../petstore/python-httpx/test/test_name.py | 55 + .../python-httpx/test/test_nullable_class.py | 76 + .../test/test_nullable_property.py | 54 + .../python-httpx/test/test_number_only.py | 51 + ...st_object_to_test_additional_properties.py | 51 + .../test_object_with_deprecated_fields.py | 57 + .../test/test_one_of_enum_string.py | 33 + .../petstore/python-httpx/test/test_order.py | 56 + .../python-httpx/test/test_outer_composite.py | 53 + .../python-httpx/test/test_outer_enum.py | 33 + .../test/test_outer_enum_default_value.py | 33 + .../test/test_outer_enum_integer.py | 33 + .../test_outer_enum_integer_default_value.py | 33 + .../test_outer_object_with_enum_property.py | 53 + .../petstore/python-httpx/test/test_parent.py | 54 + .../test/test_parent_with_optional_dict.py | 54 + .../petstore/python-httpx/test/test_pet.py | 68 + .../python-httpx/test/test_pet_api.py | 94 + .../petstore/python-httpx/test/test_pig.py | 56 + .../python-httpx/test/test_pony_sizes.py | 51 + .../python-httpx/test/test_poop_cleaning.py | 56 + .../test/test_primitive_string.py | 51 + .../python-httpx/test/test_property_map.py | 55 + .../test/test_property_name_collision.py | 53 + .../python-httpx/test/test_read_only_first.py | 52 + .../test/test_second_circular_all_of_ref.py | 54 + .../python-httpx/test/test_second_ref.py | 57 + .../test/test_self_reference_model.py | 57 + .../python-httpx/test/test_single_ref_type.py | 33 + .../test/test_special_character_enum.py | 33 + .../test/test_special_model_name.py | 51 + .../python-httpx/test/test_special_name.py | 55 + .../python-httpx/test/test_store_api.py | 59 + .../petstore/python-httpx/test/test_tag.py | 52 + .../petstore/python-httpx/test/test_task.py | 54 + .../python-httpx/test/test_task_activity.py | 56 + .../python-httpx/test/test_test_enum.py | 33 + .../test/test_test_enum_with_default.py | 33 + ..._error_responses_with_model400_response.py | 51 + ..._error_responses_with_model404_response.py | 51 + ..._freeform_additional_properties_request.py | 51 + .../test/test_test_model_with_enum_default.py | 56 + ...t_for_multipart_requests_request_marker.py | 51 + .../petstore/python-httpx/test/test_tiger.py | 51 + .../petstore/python-httpx/test/test_type.py | 33 + ...t_with_additional_model_list_properties.py | 56 + ..._with_additional_string_list_properties.py | 55 + ...th_additional_properties_request_object.py | 51 + .../petstore/python-httpx/test/test_user.py | 58 + .../python-httpx/test/test_user_api.py | 87 + .../test/test_with_nested_one_of.py | 53 + .../petstore/python-httpx/testfiles/foo.png | Bin 0 -> 43280 bytes .../petstore/python-httpx/tests/__init__.py | 0 .../python-httpx/tests/test_api_client.py | 38 + .../petstore/python-httpx/tests/test_model.py | 285 + .../python-httpx/tests/test_pet_api.py | 244 + .../python-httpx/tests/test_pet_model.py | 122 + .../petstore/python-httpx/tests/test_rest.py | 75 + .../petstore/python-httpx/tests/util.py | 8 + .../client/petstore/python-httpx/tox.ini | 9 + 409 files changed, 46512 insertions(+), 39 deletions(-) create mode 100644 bin/configs/python-httpx.yaml create mode 100644 modules/openapi-generator/src/main/resources/python/httpx/rest.mustache create mode 100644 samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml create mode 100644 samples/openapi3/client/petstore/python-httpx/.gitignore create mode 100644 samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml create mode 100644 samples/openapi3/client/petstore/python-httpx/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/python-httpx/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/python-httpx/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/python-httpx/.travis.yml create mode 100644 samples/openapi3/client/petstore/python-httpx/README.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesObject.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesWithDescriptionOnly.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AllOfSuperModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AllOfWithSingleRef.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AnyOfColor.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/AnyOfPig.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ArrayOfArrayOfModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/BaseDiscriminator.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/BasquePig.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Bathing.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Category.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/CircularAllOfRef.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/CircularReferenceModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Client.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Color.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Creature.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/CreatureInfo.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DanishPig.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DataOutputFormat.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DiscriminatorAllOfSub.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DiscriminatorAllOfSuper.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/DummyModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumNumberVendorExt.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumRefWithDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumString1.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumString2.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumStringVendorExt.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Feeding.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/File.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/FirstRef.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/FooGetDefaultResponse.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/HuntingDog.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ImportTestDatetimeApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Info.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/InnerDictWithProperty.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/InputAllOf.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/IntOrString.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ListClass.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/MapOfArrayOfModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ModelApiResponse.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ModelField.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/MultiArrays.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Name.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/NullableProperty.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ObjectToTestAdditionalProperties.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OneOfEnumString.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Order.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Parent.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ParentWithOptionalDict.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Pig.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/PonySizes.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/PoopCleaning.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/PrimitiveString.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/PropertyMap.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/PropertyNameCollision.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SecondCircularAllOfRef.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SecondRef.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SelfReferenceModel.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SingleRefType.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SpecialCharacterEnum.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/SpecialName.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Task.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TaskActivity.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestEnum.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestEnumWithDefault.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestErrorResponsesWithModel400Response.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestErrorResponsesWithModel404Response.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestModelWithEnumDefault.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/TestObjectForMultipartRequestsRequestMarker.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Tiger.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/Type.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/UnnamedDictWithAdditionalModelListProperties.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/UnnamedDictWithAdditionalStringListProperties.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/UploadFileWithAdditionalPropertiesRequestObject.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/User.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python-httpx/docs/WithNestedOneOf.md create mode 100644 samples/openapi3/client/petstore/python-httpx/git_push.sh create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/default_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/import_test_datetime_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/pet_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/store_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api/user_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/api_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/__init__.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/py.typed create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py create mode 100644 samples/openapi3/client/petstore/python-httpx/petstore_api/signing.py create mode 100644 samples/openapi3/client/petstore/python-httpx/pyproject.toml create mode 100644 samples/openapi3/client/petstore/python-httpx/requirements.txt create mode 100644 samples/openapi3/client/petstore/python-httpx/setup.cfg create mode 100644 samples/openapi3/client/petstore/python-httpx/setup.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-httpx/test/__init__.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_any_type.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_object.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_with_description_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_all_of_super_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_all_of_with_single_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_any_of_color.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_any_of_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_array_of_array_of_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_array_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_base_discriminator.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_basque_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_bathing.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_capitalization.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_cat.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_category.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_circular_all_of_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_circular_reference_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_class_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_client.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_color.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_creature.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_creature_info.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_danish_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_data_output_format.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_default_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_deprecated_object.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_dog.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_dummy_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_number_vendor_ext.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_ref_with_default_value.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_string1.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_string2.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_string_vendor_ext.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_enum_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_fake_classname_tags123_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_feeding.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_file.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_first_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_foo.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_foo_get_default_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_hunting_dog.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_import_test_datetime_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_info.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_inner_dict_with_property.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_input_all_of.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_int_or_string.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_list_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_map_of_array_of_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_map_test.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_model200_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_model_api_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_model_field.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_model_return.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_multi_arrays.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_name.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_nullable_property.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_number_only.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_object_to_test_additional_properties.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_object_with_deprecated_fields.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_one_of_enum_string.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_order.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_outer_object_with_enum_property.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_parent.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_parent_with_optional_dict.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_pet.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_pig.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_pony_sizes.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_poop_cleaning.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_primitive_string.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_property_map.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_property_name_collision.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_second_circular_all_of_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_second_ref.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_self_reference_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_single_ref_type.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_special_character_enum.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_special_name.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_store_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_tag.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_task.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_task_activity.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_enum.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_enum_with_default.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model400_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model404_response.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_inline_freeform_additional_properties_request.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_model_with_enum_default.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_test_object_for_multipart_requests_request_marker.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_tiger.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_type.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_model_list_properties.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_string_list_properties.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_upload_file_with_additional_properties_request_object.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_user.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_user_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/test/test_with_nested_one_of.py create mode 100644 samples/openapi3/client/petstore/python-httpx/testfiles/foo.png create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/__init__.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/test_api_client.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/test_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/test_pet_model.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/test_rest.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tests/util.py create mode 100644 samples/openapi3/client/petstore/python-httpx/tox.ini diff --git a/.github/workflows/samples-python-petstore.yaml b/.github/workflows/samples-python-petstore.yaml index e8b476e9c7f..f5a0254f03e 100644 --- a/.github/workflows/samples-python-petstore.yaml +++ b/.github/workflows/samples-python-petstore.yaml @@ -34,6 +34,7 @@ jobs: - "3.13" sample: - samples/openapi3/client/petstore/python-aiohttp + - samples/openapi3/client/petstore/python-httpx - samples/openapi3/client/petstore/python - samples/openapi3/client/petstore/python-lazyImports services: diff --git a/bin/configs/python-httpx.yaml b/bin/configs/python-httpx.yaml new file mode 100644 index 00000000000..3928bfc0425 --- /dev/null +++ b/bin/configs/python-httpx.yaml @@ -0,0 +1,15 @@ +generatorName: python +outputDir: samples/openapi3/client/petstore/python-httpx +inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python +library: httpx +additionalProperties: + packageName: petstore_api + mapNumberTo: float + poetry1: true +nameMappings: + _type: underscore_type + type_: type_with_underscore +modelNameMappings: + # The OpenAPI spec ApiResponse conflicts with the internal ApiResponse + ApiResponse: ModelApiResponse diff --git a/docs/generators/python.md b/docs/generators/python.md index 0c2df7ed72f..10a032dadac 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |lazyImports|Enable lazy imports.| |false| -|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3| +|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3, httpx| |urllib3| |mapNumberTo|Map number to Union[StrictFloat, StrictInt], StrictStr or float.| |Union[StrictFloat, StrictInt]| |packageName|python package name (convention: snake_case).| |openapi_client| |packageUrl|python package URL.| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 63f5d24933f..149ce57c317 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -157,7 +157,8 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege supportedLibraries.put("urllib3", "urllib3-based client"); supportedLibraries.put("asyncio", "asyncio-based client"); supportedLibraries.put("tornado", "tornado-based client (deprecated)"); - CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: asyncio, tornado (deprecated), urllib3"); + supportedLibraries.put("httpx", "httpx-based client"); + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: asyncio, tornado (deprecated), urllib3, httpx"); libraryOption.setDefault(DEFAULT_LIBRARY); cliOptions.add(libraryOption); setLibrary(DEFAULT_LIBRARY); @@ -330,10 +331,15 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege if ("asyncio".equals(getLibrary())) { supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packagePath(), "rest.py")); + additionalProperties.put("async", "true"); additionalProperties.put("asyncio", "true"); } else if ("tornado".equals(getLibrary())) { supportingFiles.add(new SupportingFile("tornado/rest.mustache", packagePath(), "rest.py")); additionalProperties.put("tornado", "true"); + } else if ("httpx".equals(getLibrary())) { + supportingFiles.add(new SupportingFile("httpx/rest.mustache", packagePath(), "rest.py")); + additionalProperties.put("async", "true"); + additionalProperties.put("httpx", "true"); } else { supportingFiles.add(new SupportingFile("rest.mustache", packagePath(), "rest.py")); } diff --git a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache index f568369cbcc..430fb722f84 100644 --- a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache +++ b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache @@ -28,10 +28,10 @@ To be able to use it, you will need these dependencies in your own package that * urllib3 >= 2.1.0, < 3.0.0 * python-dateutil >= 2.8.2 -{{#asyncio}} +{{#async}} * aiohttp >= 3.8.4 * aiohttp-retry >= 2.8.3 -{{/asyncio}} +{{/async}} {{#tornado}} * tornado >= 4.2, < 5 {{/tornado}} diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 3e440e1fbad..2f1478a7a94 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -32,14 +32,14 @@ class {{classname}}: @validate_call - {{#asyncio}}async {{/asyncio}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{^returnType}}None{{/returnType}}: + {{#async}}async {{/async}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{^returnType}}None{{/returnType}}: {{>partial_api}} - response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + response_data = {{#async}}await {{/async}}self.api_client.call_api( *_param, _request_timeout=_request_timeout ) - {{#asyncio}}await {{/asyncio}}response_data.read() + {{#async}}await {{/async}}response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, @@ -47,14 +47,14 @@ class {{classname}}: @validate_call - {{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{^returnType}}None{{/returnType}}]: + {{#async}}async {{/async}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{^returnType}}None{{/returnType}}]: {{>partial_api}} - response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + response_data = {{#async}}await {{/async}}self.api_client.call_api( *_param, _request_timeout=_request_timeout ) - {{#asyncio}}await {{/asyncio}}response_data.read() + {{#async}}await {{/async}}response_data.read() return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, @@ -62,10 +62,10 @@ class {{classname}}: @validate_call - {{#asyncio}}async {{/asyncio}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType: + {{#async}}async {{/async}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType: {{>partial_api}} - response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + response_data = {{#async}}await {{/async}}self.api_client.call_api( *_param, _request_timeout=_request_timeout ) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 99ed6b8ef00..39c46c0b221 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -88,7 +88,7 @@ class ApiClient: self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' self.client_side_validation = configuration.client_side_validation -{{#asyncio}} +{{#async}} async def __aenter__(self): return self @@ -97,14 +97,14 @@ class ApiClient: async def close(self): await self.rest_client.close() -{{/asyncio}} -{{^asyncio}} +{{/async}} +{{^async}} def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): pass -{{/asyncio}} +{{/async}} @property def user_agent(self): @@ -257,7 +257,7 @@ class ApiClient: {{#tornado}} @tornado.gen.coroutine {{/tornado}} - {{#asyncio}}async {{/asyncio}}def call_api( + {{#async}}async {{/async}}def call_api( self, method, url, @@ -280,7 +280,7 @@ class ApiClient: try: # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.rest_client.request( + response_data = {{#async}}await {{/async}}{{#tornado}}yield {{/tornado}}self.rest_client.request( method, url, headers=header_params, body=body, post_params=post_params, diff --git a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache index f6257e81dba..de357ab12f8 100644 --- a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache @@ -10,7 +10,7 @@ from pprint import pprint {{> python_doc_auth_partial}} # Enter a context with an instance of the API client -{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: +{{#async}}async {{/async}}with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = {{{packageName}}}.{{{classname}}}(api_client) {{#allParams}} @@ -21,7 +21,7 @@ from pprint import pprint {{#summary}} # {{{.}}} {{/summary}} - {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}}api_response = {{/returnType}}{{#async}}await {{/async}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}} print("The response of {{classname}}->{{operationId}}:\n") pprint(api_response) diff --git a/modules/openapi-generator/src/main/resources/python/api_test.mustache b/modules/openapi-generator/src/main/resources/python/api_test.mustache index f80a8fb16b9..44c3e78642f 100644 --- a/modules/openapi-generator/src/main/resources/python/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_test.mustache @@ -8,31 +8,31 @@ import unittest from {{apiPackage}}.{{classFilename}} import {{classname}} -class {{#operations}}Test{{classname}}(unittest.{{#asyncio}}IsolatedAsyncio{{/asyncio}}TestCase): +class {{#operations}}Test{{classname}}(unittest.{{#async}}IsolatedAsyncio{{/async}}TestCase): """{{classname}} unit test stubs""" - {{#asyncio}} + {{#async}} async def asyncSetUp(self) -> None: self.api = {{classname}}() async def asyncTearDown(self) -> None: await self.api.api_client.close() - {{/asyncio}} - {{^asyncio}} + {{/async}} + {{^async}} def setUp(self) -> None: self.api = {{classname}}() def tearDown(self) -> None: pass - {{/asyncio}} + {{/async}} {{#operation}} - {{#asyncio}} + {{#async}} async def test_{{operationId}}(self) -> None: - {{/asyncio}} - {{^asyncio}} + {{/async}} + {{^async}} def test_{{operationId}}(self) -> None: - {{/asyncio}} + {{/async}} """Test case for {{{operationId}}} {{#summary}} diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache index 8db0e56be01..0b079809867 100644 --- a/modules/openapi-generator/src/main/resources/python/common_README.mustache +++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache @@ -8,7 +8,7 @@ from pprint import pprint # Enter a context with an instance of the API client -{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: +{{#async}}async {{/async}}with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = {{{packageName}}}.{{{classname}}}(api_client) {{#allParams}} @@ -19,7 +19,7 @@ from pprint import pprint {{#summary}} # {{{.}}} {{/summary}} - {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}}api_response = {{/returnType}}{{#async}}await {{/async}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}} print("The response of {{classname}}->{{operationId}}:\n") pprint(api_response) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 2601d75a0c8..97e0f93efc3 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -7,9 +7,9 @@ import copy import http.client as httplib import logging from logging import FileHandler -{{^asyncio}} +{{^async}} import multiprocessing -{{/asyncio}} +{{/async}} import sys from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union from typing_extensions import NotRequired, Self @@ -395,13 +395,13 @@ conf = {{{packageName}}}.Configuration( Set this to the SNI value expected by the server. """ - {{#asyncio}} + {{#async}} 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}} + {{/async}} + {{^async}} 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 @@ -409,7 +409,7 @@ conf = {{{packageName}}}.Configuration( requests to the same host, which is often the case here. cpu_count * 5 is used as default value to increase performance. """ - {{/asyncio}} + {{/async}} self.proxy: Optional[str] = None """Proxy URL diff --git a/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache b/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache new file mode 100644 index 00000000000..05e834913d6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache @@ -0,0 +1,185 @@ +# coding: utf-8 + +{{>partial_header}} + + +import io +import json +import re +import ssl +from typing import Optional, Union + +import httpx + +from {{packageName}}.exceptions import ApiException, ApiValueError + +RESTResponseType = httpx.Response + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status_code + self.reason = resp.reason_phrase + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.aread() + return self.data + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + self.maxsize = configuration.connection_pool_maxsize + + self.ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + if configuration.cert_file: + self.ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + self.ssl_context.check_hostname = False + self.ssl_context.verify_mode = ssl.CERT_NONE + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + self.pool_manager: Optional[httpx.AsyncClient] = None + + async def close(self): + if self.pool_manager is not None: + await self.pool_manager.aclose() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None): + """Execute request + + :param method: http request method + :param url: http request 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 _request_timeout: timeout setting 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 + } + + # 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: + args["json"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + args["data"] = dict(post_params) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by httpx + del headers['Content-Type'] + + files = [] + data = {} + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + files.append((k, v)) + else: + # Ensures that dict objects are serialized + if isinstance(v, dict): + v = json.dumps(v) + elif isinstance(v, int): + v = str(v) + data[k] = v + + if files: + args["files"] = files + if data: + 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, str) or 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) + + if self.pool_manager is None: + self.pool_manager = self._create_pool_manager() + + r = await self.pool_manager.request(**args) + return RESTResponse(r) + + def _create_pool_manager(self) -> httpx.AsyncClient: + limits = httpx.Limits(max_connections=self.maxsize) + + proxy = None + if self.proxy: + proxy = httpx.Proxy( + url=self.proxy, + headers=self.proxy_headers + ) + + return httpx.AsyncClient( + limits=limits, + proxy=proxy, + verify=self.ssl_context, + trust_env=True + ) diff --git a/modules/openapi-generator/src/main/resources/python/pyproject.mustache b/modules/openapi-generator/src/main/resources/python/pyproject.mustache index 12997eed86b..eaa40ba035f 100644 --- a/modules/openapi-generator/src/main/resources/python/pyproject.mustache +++ b/modules/openapi-generator/src/main/resources/python/pyproject.mustache @@ -39,6 +39,9 @@ python-dateutil = ">= 2.8.2" aiohttp = ">= 3.8.4" aiohttp-retry = ">= 2.8.3" {{/asyncio}} +{{#httpx}} +httpx = ">= 0.28.1" +{{/httpx}} {{#tornado}} tornado = ">=4.2, <5" {{/tornado}} @@ -58,10 +61,10 @@ requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", "python-dateutil (>=2.8.2)", -{{#asyncio}} +{{#async}} "aiohttp (>=3.8.4)", "aiohttp-retry (>=2.8.3)", -{{/asyncio}} +{{/async}} {{#tornado}} "tornado (>=4.2,<5)", {{/tornado}} diff --git a/modules/openapi-generator/src/main/resources/python/requirements.mustache b/modules/openapi-generator/src/main/resources/python/requirements.mustache index 132751d7a71..ee103eba2d7 100644 --- a/modules/openapi-generator/src/main/resources/python/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/requirements.mustache @@ -4,6 +4,9 @@ python_dateutil >= 2.8.2 aiohttp >= 3.8.4 aiohttp-retry >= 2.8.3 {{/asyncio}} +{{#httpx}} +httpx = ">= 0.28.1" +{{/httpx}} {{#tornado}} tornado = ">= 4.2, < 5" {{/tornado}} diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache index 1fb79c09a2b..b4589687b17 100644 --- a/modules/openapi-generator/src/main/resources/python/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/setup.mustache @@ -21,6 +21,9 @@ REQUIRES = [ "aiohttp >= 3.8.4", "aiohttp-retry >= 2.8.3", {{/asyncio}} +{{#httpx}} + "httpx >= 0.28.1", +{{/httpx}} {{#tornado}} "tornado>=4.2, < 5", {{/tornado}} diff --git a/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml new file mode 100644 index 00000000000..06d03df77f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml @@ -0,0 +1,34 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: petstore_api Python package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov=petstore_api diff --git a/samples/openapi3/client/petstore/python-httpx/.gitignore b/samples/openapi3/client/petstore/python-httpx/.gitignore new file mode 100644 index 00000000000..65b06b95540 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.gitignore @@ -0,0 +1,66 @@ +# 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-httpx/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml new file mode 100644 index 00000000000..eb65f62dea5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=petstore_api + +pytest-3.9: + extends: .pytest + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine +pytest-3.13: + extends: .pytest + image: python:3.13-alpine diff --git a/samples/openapi3/client/petstore/python-httpx/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-httpx/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# 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-httpx/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-httpx/.openapi-generator/FILES new file mode 100644 index 00000000000..6cbba41b5b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.openapi-generator/FILES @@ -0,0 +1,263 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesWithDescriptionOnly.md +docs/AllOfSuperModel.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/AnyOfColor.md +docs/AnyOfPig.md +docs/ArrayOfArrayOfModel.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BaseDiscriminator.md +docs/BasquePig.md +docs/Bathing.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/CircularAllOfRef.md +docs/CircularReferenceModel.md +docs/ClassModel.md +docs/Client.md +docs/Color.md +docs/Creature.md +docs/CreatureInfo.md +docs/DanishPig.md +docs/DataOutputFormat.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/DiscriminatorAllOfSub.md +docs/DiscriminatorAllOfSuper.md +docs/Dog.md +docs/DummyModel.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumNumberVendorExt.md +docs/EnumRefWithDefaultValue.md +docs/EnumString1.md +docs/EnumString2.md +docs/EnumStringVendorExt.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/Feeding.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FirstRef.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/HuntingDog.md +docs/ImportTestDatetimeApi.md +docs/Info.md +docs/InnerDictWithProperty.md +docs/InputAllOf.md +docs/IntOrString.md +docs/ListClass.md +docs/MapOfArrayOfModel.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelField.md +docs/ModelReturn.md +docs/MultiArrays.md +docs/Name.md +docs/NullableClass.md +docs/NullableProperty.md +docs/NumberOnly.md +docs/ObjectToTestAdditionalProperties.md +docs/ObjectWithDeprecatedFields.md +docs/OneOfEnumString.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/Parent.md +docs/ParentWithOptionalDict.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/PonySizes.md +docs/PoopCleaning.md +docs/PrimitiveString.md +docs/PropertyMap.md +docs/PropertyNameCollision.md +docs/ReadOnlyFirst.md +docs/SecondCircularAllOfRef.md +docs/SecondRef.md +docs/SelfReferenceModel.md +docs/SingleRefType.md +docs/SpecialCharacterEnum.md +docs/SpecialModelName.md +docs/SpecialName.md +docs/StoreApi.md +docs/Tag.md +docs/Task.md +docs/TaskActivity.md +docs/TestEnum.md +docs/TestEnumWithDefault.md +docs/TestErrorResponsesWithModel400Response.md +docs/TestErrorResponsesWithModel404Response.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/TestModelWithEnumDefault.md +docs/TestObjectForMultipartRequestsRequestMarker.md +docs/Tiger.md +docs/Type.md +docs/UnnamedDictWithAdditionalModelListProperties.md +docs/UnnamedDictWithAdditionalStringListProperties.md +docs/UploadFileWithAdditionalPropertiesRequestObject.md +docs/User.md +docs/UserApi.md +docs/WithNestedOneOf.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/import_test_datetime_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/api_response.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_class.py +petstore_api/models/additional_properties_object.py +petstore_api/models/additional_properties_with_description_only.py +petstore_api/models/all_of_super_model.py +petstore_api/models/all_of_with_single_ref.py +petstore_api/models/animal.py +petstore_api/models/any_of_color.py +petstore_api/models/any_of_pig.py +petstore_api/models/array_of_array_of_model.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/base_discriminator.py +petstore_api/models/basque_pig.py +petstore_api/models/bathing.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/category.py +petstore_api/models/circular_all_of_ref.py +petstore_api/models/circular_reference_model.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/color.py +petstore_api/models/creature.py +petstore_api/models/creature_info.py +petstore_api/models/danish_pig.py +petstore_api/models/data_output_format.py +petstore_api/models/deprecated_object.py +petstore_api/models/discriminator_all_of_sub.py +petstore_api/models/discriminator_all_of_super.py +petstore_api/models/dog.py +petstore_api/models/dummy_model.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_number_vendor_ext.py +petstore_api/models/enum_ref_with_default_value.py +petstore_api/models/enum_string1.py +petstore_api/models/enum_string2.py +petstore_api/models/enum_string_vendor_ext.py +petstore_api/models/enum_test.py +petstore_api/models/feeding.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/first_ref.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/hunting_dog.py +petstore_api/models/info.py +petstore_api/models/inner_dict_with_property.py +petstore_api/models/input_all_of.py +petstore_api/models/int_or_string.py +petstore_api/models/list_class.py +petstore_api/models/map_of_array_of_model.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_api_response.py +petstore_api/models/model_field.py +petstore_api/models/model_return.py +petstore_api/models/multi_arrays.py +petstore_api/models/name.py +petstore_api/models/nullable_class.py +petstore_api/models/nullable_property.py +petstore_api/models/number_only.py +petstore_api/models/object_to_test_additional_properties.py +petstore_api/models/object_with_deprecated_fields.py +petstore_api/models/one_of_enum_string.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/parent.py +petstore_api/models/parent_with_optional_dict.py +petstore_api/models/pet.py +petstore_api/models/pig.py +petstore_api/models/pony_sizes.py +petstore_api/models/poop_cleaning.py +petstore_api/models/primitive_string.py +petstore_api/models/property_map.py +petstore_api/models/property_name_collision.py +petstore_api/models/read_only_first.py +petstore_api/models/second_circular_all_of_ref.py +petstore_api/models/second_ref.py +petstore_api/models/self_reference_model.py +petstore_api/models/single_ref_type.py +petstore_api/models/special_character_enum.py +petstore_api/models/special_model_name.py +petstore_api/models/special_name.py +petstore_api/models/tag.py +petstore_api/models/task.py +petstore_api/models/task_activity.py +petstore_api/models/test_enum.py +petstore_api/models/test_enum_with_default.py +petstore_api/models/test_error_responses_with_model400_response.py +petstore_api/models/test_error_responses_with_model404_response.py +petstore_api/models/test_inline_freeform_additional_properties_request.py +petstore_api/models/test_model_with_enum_default.py +petstore_api/models/test_object_for_multipart_requests_request_marker.py +petstore_api/models/tiger.py +petstore_api/models/type.py +petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +petstore_api/models/upload_file_with_additional_properties_request_object.py +petstore_api/models/user.py +petstore_api/models/with_nested_one_of.py +petstore_api/py.typed +petstore_api/rest.py +petstore_api/signing.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/openapi3/client/petstore/python-httpx/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-httpx/.openapi-generator/VERSION new file mode 100644 index 00000000000..5e528295308 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.16.0-SNAPSHOT diff --git a/samples/openapi3/client/petstore/python-httpx/.travis.yml b/samples/openapi3/client/petstore/python-httpx/.travis.yml new file mode 100644 index 00000000000..8d62304a94d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + # uncomment the following if needed + #- "3.13-dev" # 3.13 development branch + #- "nightly" # nightly build +# 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-httpx/README.md b/samples/openapi3/client/petstore/python-httpx/README.md new file mode 100644 index 00000000000..311e6e4c2df --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/README.md @@ -0,0 +1,317 @@ +# 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 +- Generator version: 7.16.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.9+ + +## 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 +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +import datetime +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) + client = petstore_api.Client() # Client | client model + + try: + # To test special tags + api_response = await api_instance.call_123_test_special_tags(client) + print("The response of AnotherFakeApi->call_123_test_special_tags:\n") + 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_any_type_request_body**](docs/FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body +*FakeApi* | [**fake_enum_ref_query_parameter**](docs/FakeApi.md#fake_enum_ref_query_parameter) | **GET** /fake/enum_ref_query_parameter | test enum reference query parameter +*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* | [**fake_ref_enum_string**](docs/FakeApi.md#fake_ref_enum_string) | **GET** /fake/ref_enum_string | test ref to enum string +*FakeApi* | [**fake_return_boolean**](docs/FakeApi.md#fake_return_boolean) | **GET** /fake/return_boolean | test returning boolean +*FakeApi* | [**fake_return_byte_like_json**](docs/FakeApi.md#fake_return_byte_like_json) | **GET** /fake/return_byte_like_json | test byte like json +*FakeApi* | [**fake_return_enum**](docs/FakeApi.md#fake_return_enum) | **GET** /fake/return_enum | test returning enum +*FakeApi* | [**fake_return_enum_like_json**](docs/FakeApi.md#fake_return_enum_like_json) | **GET** /fake/return_enum_like_json | test enum like json +*FakeApi* | [**fake_return_float**](docs/FakeApi.md#fake_return_float) | **GET** /fake/return_float | test returning float +*FakeApi* | [**fake_return_int**](docs/FakeApi.md#fake_return_int) | **GET** /fake/return_int | test returning int +*FakeApi* | [**fake_return_list_of_objects**](docs/FakeApi.md#fake_return_list_of_objects) | **GET** /fake/return_list_of_object | test returning list of objects +*FakeApi* | [**fake_return_str_like_json**](docs/FakeApi.md#fake_return_str_like_json) | **GET** /fake/return_str_like_json | test str like json +*FakeApi* | [**fake_return_string**](docs/FakeApi.md#fake_return_string) | **GET** /fake/return_string | test returning string +*FakeApi* | [**fake_uuid_example**](docs/FakeApi.md#fake_uuid_example) | **GET** /fake/uuid_example | test uuid example +*FakeApi* | [**test_additional_properties_reference**](docs/FakeApi.md#test_additional_properties_reference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*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_date_time_query_parameter**](docs/FakeApi.md#test_date_time_query_parameter) | **PUT** /fake/date-time-query-params | +*FakeApi* | [**test_empty_and_non_empty_responses**](docs/FakeApi.md#test_empty_and_non_empty_responses) | **POST** /fake/empty_and_non_empty_responses | test empty and non-empty responses +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_error_responses_with_model**](docs/FakeApi.md#test_error_responses_with_model) | **POST** /fake/error_responses_with_model | test error responses with model +*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_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_object_for_multipart_requests**](docs/FakeApi.md#test_object_for_multipart_requests) | **POST** /fake/object_for_multipart_requests | +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeApi* | [**upload_file_with_additional_properties**](docs/FakeApi.md#upload_file_with_additional_properties) | **POST** /fake/upload_file_with_additional_properties | uploads a file and additional properties using multipart/form-data +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*ImportTestDatetimeApi* | [**import_test_return_datetime**](docs/ImportTestDatetimeApi.md#import_test_return_datetime) | **GET** /import_test/return_datetime | test date time +*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) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md) + - [AllOfSuperModel](docs/AllOfSuperModel.md) + - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md) + - [Animal](docs/Animal.md) + - [AnyOfColor](docs/AnyOfColor.md) + - [AnyOfPig](docs/AnyOfPig.md) + - [ArrayOfArrayOfModel](docs/ArrayOfArrayOfModel.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [BaseDiscriminator](docs/BaseDiscriminator.md) + - [BasquePig](docs/BasquePig.md) + - [Bathing](docs/Bathing.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [Category](docs/Category.md) + - [CircularAllOfRef](docs/CircularAllOfRef.md) + - [CircularReferenceModel](docs/CircularReferenceModel.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Color](docs/Color.md) + - [Creature](docs/Creature.md) + - [CreatureInfo](docs/CreatureInfo.md) + - [DanishPig](docs/DanishPig.md) + - [DataOutputFormat](docs/DataOutputFormat.md) + - [DeprecatedObject](docs/DeprecatedObject.md) + - [DiscriminatorAllOfSub](docs/DiscriminatorAllOfSub.md) + - [DiscriminatorAllOfSuper](docs/DiscriminatorAllOfSuper.md) + - [Dog](docs/Dog.md) + - [DummyModel](docs/DummyModel.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumNumberVendorExt](docs/EnumNumberVendorExt.md) + - [EnumRefWithDefaultValue](docs/EnumRefWithDefaultValue.md) + - [EnumString1](docs/EnumString1.md) + - [EnumString2](docs/EnumString2.md) + - [EnumStringVendorExt](docs/EnumStringVendorExt.md) + - [EnumTest](docs/EnumTest.md) + - [Feeding](docs/Feeding.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FirstRef](docs/FirstRef.md) + - [Foo](docs/Foo.md) + - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [HuntingDog](docs/HuntingDog.md) + - [Info](docs/Info.md) + - [InnerDictWithProperty](docs/InnerDictWithProperty.md) + - [InputAllOf](docs/InputAllOf.md) + - [IntOrString](docs/IntOrString.md) + - [ListClass](docs/ListClass.md) + - [MapOfArrayOfModel](docs/MapOfArrayOfModel.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelField](docs/ModelField.md) + - [ModelReturn](docs/ModelReturn.md) + - [MultiArrays](docs/MultiArrays.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableProperty](docs/NullableProperty.md) + - [NumberOnly](docs/NumberOnly.md) + - [ObjectToTestAdditionalProperties](docs/ObjectToTestAdditionalProperties.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) + - [OneOfEnumString](docs/OneOfEnumString.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) + - [Parent](docs/Parent.md) + - [ParentWithOptionalDict](docs/ParentWithOptionalDict.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [PonySizes](docs/PonySizes.md) + - [PoopCleaning](docs/PoopCleaning.md) + - [PrimitiveString](docs/PrimitiveString.md) + - [PropertyMap](docs/PropertyMap.md) + - [PropertyNameCollision](docs/PropertyNameCollision.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SecondCircularAllOfRef](docs/SecondCircularAllOfRef.md) + - [SecondRef](docs/SecondRef.md) + - [SelfReferenceModel](docs/SelfReferenceModel.md) + - [SingleRefType](docs/SingleRefType.md) + - [SpecialCharacterEnum](docs/SpecialCharacterEnum.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [SpecialName](docs/SpecialName.md) + - [Tag](docs/Tag.md) + - [Task](docs/Task.md) + - [TaskActivity](docs/TaskActivity.md) + - [TestEnum](docs/TestEnum.md) + - [TestEnumWithDefault](docs/TestEnumWithDefault.md) + - [TestErrorResponsesWithModel400Response](docs/TestErrorResponsesWithModel400Response.md) + - [TestErrorResponsesWithModel404Response](docs/TestErrorResponsesWithModel404Response.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [TestModelWithEnumDefault](docs/TestModelWithEnumDefault.md) + - [TestObjectForMultipartRequestsRequestMarker](docs/TestObjectForMultipartRequestsRequestMarker.md) + - [Tiger](docs/Tiger.md) + - [Type](docs/Type.md) + - [UnnamedDictWithAdditionalModelListProperties](docs/UnnamedDictWithAdditionalModelListProperties.md) + - [UnnamedDictWithAdditionalStringListProperties](docs/UnnamedDictWithAdditionalStringListProperties.md) + - [UploadFileWithAdditionalPropertiesRequestObject](docs/UploadFileWithAdditionalPropertiesRequestObject.md) + - [User](docs/User.md) + - [WithNestedOneOf](docs/WithNestedOneOf.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 + + + + diff --git a/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesAnyType.md b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 00000000000..314cba3a614 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,29 @@ +# AdditionalPropertiesAnyType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType + +# TODO update the JSON string below +json = "{}" +# create an instance of AdditionalPropertiesAnyType from a JSON string +additional_properties_any_type_instance = AdditionalPropertiesAnyType.from_json(json) +# print the JSON string representation of the object +print(AdditionalPropertiesAnyType.to_json()) + +# convert the object into a dict +additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict() +# create an instance of AdditionalPropertiesAnyType from a dict +additional_properties_any_type_from_dict = AdditionalPropertiesAnyType.from_dict(additional_properties_any_type_dict) +``` +[[Back to Model list]](../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-httpx/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..8d4c08707f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesClass.md @@ -0,0 +1,30 @@ +# AdditionalPropertiesClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **Dict[str, str]** | | [optional] +**map_of_map_property** | **Dict[str, Dict[str, str]]** | | [optional] + +## Example + +```python +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass + +# TODO update the JSON string below +json = "{}" +# create an instance of AdditionalPropertiesClass from a JSON string +additional_properties_class_instance = AdditionalPropertiesClass.from_json(json) +# print the JSON string representation of the object +print(AdditionalPropertiesClass.to_json()) + +# convert the object into a dict +additional_properties_class_dict = additional_properties_class_instance.to_dict() +# create an instance of AdditionalPropertiesClass from a dict +additional_properties_class_from_dict = AdditionalPropertiesClass.from_dict(additional_properties_class_dict) +``` +[[Back to Model list]](../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-httpx/docs/AdditionalPropertiesObject.md b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesObject.md new file mode 100644 index 00000000000..d647ec64896 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesObject.md @@ -0,0 +1,29 @@ +# AdditionalPropertiesObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.additional_properties_object import AdditionalPropertiesObject + +# TODO update the JSON string below +json = "{}" +# create an instance of AdditionalPropertiesObject from a JSON string +additional_properties_object_instance = AdditionalPropertiesObject.from_json(json) +# print the JSON string representation of the object +print(AdditionalPropertiesObject.to_json()) + +# convert the object into a dict +additional_properties_object_dict = additional_properties_object_instance.to_dict() +# create an instance of AdditionalPropertiesObject from a dict +additional_properties_object_from_dict = AdditionalPropertiesObject.from_dict(additional_properties_object_dict) +``` +[[Back to Model list]](../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-httpx/docs/AdditionalPropertiesWithDescriptionOnly.md b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesWithDescriptionOnly.md new file mode 100644 index 00000000000..061f5524872 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AdditionalPropertiesWithDescriptionOnly.md @@ -0,0 +1,29 @@ +# AdditionalPropertiesWithDescriptionOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly + +# TODO update the JSON string below +json = "{}" +# create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string +additional_properties_with_description_only_instance = AdditionalPropertiesWithDescriptionOnly.from_json(json) +# print the JSON string representation of the object +print(AdditionalPropertiesWithDescriptionOnly.to_json()) + +# convert the object into a dict +additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict() +# create an instance of AdditionalPropertiesWithDescriptionOnly from a dict +additional_properties_with_description_only_from_dict = AdditionalPropertiesWithDescriptionOnly.from_dict(additional_properties_with_description_only_dict) +``` +[[Back to Model list]](../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-httpx/docs/AllOfSuperModel.md b/samples/openapi3/client/petstore/python-httpx/docs/AllOfSuperModel.md new file mode 100644 index 00000000000..421a1527f1e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AllOfSuperModel.md @@ -0,0 +1,29 @@ +# AllOfSuperModel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.all_of_super_model import AllOfSuperModel + +# TODO update the JSON string below +json = "{}" +# create an instance of AllOfSuperModel from a JSON string +all_of_super_model_instance = AllOfSuperModel.from_json(json) +# print the JSON string representation of the object +print(AllOfSuperModel.to_json()) + +# convert the object into a dict +all_of_super_model_dict = all_of_super_model_instance.to_dict() +# create an instance of AllOfSuperModel from a dict +all_of_super_model_from_dict = AllOfSuperModel.from_dict(all_of_super_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-httpx/docs/AllOfWithSingleRef.md new file mode 100644 index 00000000000..203a4b5da3d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AllOfWithSingleRef.md @@ -0,0 +1,30 @@ +# AllOfWithSingleRef + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | | [optional] +**single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional] + +## Example + +```python +from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef + +# TODO update the JSON string below +json = "{}" +# create an instance of AllOfWithSingleRef from a JSON string +all_of_with_single_ref_instance = AllOfWithSingleRef.from_json(json) +# print the JSON string representation of the object +print(AllOfWithSingleRef.to_json()) + +# convert the object into a dict +all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict() +# create an instance of AllOfWithSingleRef from a dict +all_of_with_single_ref_from_dict = AllOfWithSingleRef.from_dict(all_of_with_single_ref_dict) +``` +[[Back to Model list]](../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-httpx/docs/Animal.md b/samples/openapi3/client/petstore/python-httpx/docs/Animal.md new file mode 100644 index 00000000000..381d27b66e4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Animal.md @@ -0,0 +1,30 @@ +# Animal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] [default to 'red'] + +## Example + +```python +from petstore_api.models.animal import Animal + +# TODO update the JSON string below +json = "{}" +# create an instance of Animal from a JSON string +animal_instance = Animal.from_json(json) +# print the JSON string representation of the object +print(Animal.to_json()) + +# convert the object into a dict +animal_dict = animal_instance.to_dict() +# create an instance of Animal from a dict +animal_from_dict = Animal.from_dict(animal_dict) +``` +[[Back to Model list]](../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-httpx/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-httpx/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..59bc936ed5e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AnotherFakeApi.md @@ -0,0 +1,77 @@ +# 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 petstore_api +from petstore_api.models.client import Client +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) + client = petstore_api.Client() # Client | client model + + try: + # To test special tags + api_response = await api_instance.call_123_test_special_tags(client) + print("The response of AnotherFakeApi->call_123_test_special_tags:\n") + pprint(api_response) + except Exception 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-httpx/docs/AnyOfColor.md b/samples/openapi3/client/petstore/python-httpx/docs/AnyOfColor.md new file mode 100644 index 00000000000..6ed75dd7b48 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AnyOfColor.md @@ -0,0 +1,29 @@ +# AnyOfColor + +Any of RGB array, RGBA array, or hex string. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.any_of_color import AnyOfColor + +# TODO update the JSON string below +json = "{}" +# create an instance of AnyOfColor from a JSON string +any_of_color_instance = AnyOfColor.from_json(json) +# print the JSON string representation of the object +print(AnyOfColor.to_json()) + +# convert the object into a dict +any_of_color_dict = any_of_color_instance.to_dict() +# create an instance of AnyOfColor from a dict +any_of_color_from_dict = AnyOfColor.from_dict(any_of_color_dict) +``` +[[Back to Model list]](../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-httpx/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-httpx/docs/AnyOfPig.md new file mode 100644 index 00000000000..9367e226189 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/AnyOfPig.md @@ -0,0 +1,31 @@ +# AnyOfPig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | +**size** | **int** | | + +## Example + +```python +from petstore_api.models.any_of_pig import AnyOfPig + +# TODO update the JSON string below +json = "{}" +# create an instance of AnyOfPig from a JSON string +any_of_pig_instance = AnyOfPig.from_json(json) +# print the JSON string representation of the object +print(AnyOfPig.to_json()) + +# convert the object into a dict +any_of_pig_dict = any_of_pig_instance.to_dict() +# create an instance of AnyOfPig from a dict +any_of_pig_from_dict = AnyOfPig.from_dict(any_of_pig_dict) +``` +[[Back to Model list]](../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-httpx/docs/ArrayOfArrayOfModel.md b/samples/openapi3/client/petstore/python-httpx/docs/ArrayOfArrayOfModel.md new file mode 100644 index 00000000000..f866863d53f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ArrayOfArrayOfModel.md @@ -0,0 +1,29 @@ +# ArrayOfArrayOfModel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**another_property** | **List[List[Tag]]** | | [optional] + +## Example + +```python +from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel + +# TODO update the JSON string below +json = "{}" +# create an instance of ArrayOfArrayOfModel from a JSON string +array_of_array_of_model_instance = ArrayOfArrayOfModel.from_json(json) +# print the JSON string representation of the object +print(ArrayOfArrayOfModel.to_json()) + +# convert the object into a dict +array_of_array_of_model_dict = array_of_array_of_model_instance.to_dict() +# create an instance of ArrayOfArrayOfModel from a dict +array_of_array_of_model_from_dict = ArrayOfArrayOfModel.from_dict(array_of_array_of_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-httpx/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..32bd2dfbf1e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,29 @@ +# ArrayOfArrayOfNumberOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **List[List[float]]** | | [optional] + +## Example + +```python +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly + +# TODO update the JSON string below +json = "{}" +# create an instance of ArrayOfArrayOfNumberOnly from a JSON string +array_of_array_of_number_only_instance = ArrayOfArrayOfNumberOnly.from_json(json) +# print the JSON string representation of the object +print(ArrayOfArrayOfNumberOnly.to_json()) + +# convert the object into a dict +array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict() +# create an instance of ArrayOfArrayOfNumberOnly from a dict +array_of_array_of_number_only_from_dict = ArrayOfArrayOfNumberOnly.from_dict(array_of_array_of_number_only_dict) +``` +[[Back to Model list]](../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-httpx/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-httpx/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..b814d759494 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ArrayOfNumberOnly.md @@ -0,0 +1,29 @@ +# ArrayOfNumberOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **List[float]** | | [optional] + +## Example + +```python +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly + +# TODO update the JSON string below +json = "{}" +# create an instance of ArrayOfNumberOnly from a JSON string +array_of_number_only_instance = ArrayOfNumberOnly.from_json(json) +# print the JSON string representation of the object +print(ArrayOfNumberOnly.to_json()) + +# convert the object into a dict +array_of_number_only_dict = array_of_number_only_instance.to_dict() +# create an instance of ArrayOfNumberOnly from a dict +array_of_number_only_from_dict = ArrayOfNumberOnly.from_dict(array_of_number_only_dict) +``` +[[Back to Model list]](../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-httpx/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-httpx/docs/ArrayTest.md new file mode 100644 index 00000000000..ed871fae662 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ArrayTest.md @@ -0,0 +1,32 @@ +# ArrayTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **List[str]** | | [optional] +**array_of_nullable_float** | **List[Optional[float]]** | | [optional] +**array_array_of_integer** | **List[List[int]]** | | [optional] +**array_array_of_model** | **List[List[ReadOnlyFirst]]** | | [optional] + +## Example + +```python +from petstore_api.models.array_test import ArrayTest + +# TODO update the JSON string below +json = "{}" +# create an instance of ArrayTest from a JSON string +array_test_instance = ArrayTest.from_json(json) +# print the JSON string representation of the object +print(ArrayTest.to_json()) + +# convert the object into a dict +array_test_dict = array_test_instance.to_dict() +# create an instance of ArrayTest from a dict +array_test_from_dict = ArrayTest.from_dict(array_test_dict) +``` +[[Back to Model list]](../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-httpx/docs/BaseDiscriminator.md b/samples/openapi3/client/petstore/python-httpx/docs/BaseDiscriminator.md new file mode 100644 index 00000000000..fcdbeb032e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/BaseDiscriminator.md @@ -0,0 +1,29 @@ +# BaseDiscriminator + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type_name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.base_discriminator import BaseDiscriminator + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseDiscriminator from a JSON string +base_discriminator_instance = BaseDiscriminator.from_json(json) +# print the JSON string representation of the object +print(BaseDiscriminator.to_json()) + +# convert the object into a dict +base_discriminator_dict = base_discriminator_instance.to_dict() +# create an instance of BaseDiscriminator from a dict +base_discriminator_from_dict = BaseDiscriminator.from_dict(base_discriminator_dict) +``` +[[Back to Model list]](../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-httpx/docs/BasquePig.md b/samples/openapi3/client/petstore/python-httpx/docs/BasquePig.md new file mode 100644 index 00000000000..ee28d628722 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/BasquePig.md @@ -0,0 +1,30 @@ +# BasquePig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | + +## Example + +```python +from petstore_api.models.basque_pig import BasquePig + +# TODO update the JSON string below +json = "{}" +# create an instance of BasquePig from a JSON string +basque_pig_instance = BasquePig.from_json(json) +# print the JSON string representation of the object +print(BasquePig.to_json()) + +# convert the object into a dict +basque_pig_dict = basque_pig_instance.to_dict() +# create an instance of BasquePig from a dict +basque_pig_from_dict = BasquePig.from_dict(basque_pig_dict) +``` +[[Back to Model list]](../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-httpx/docs/Bathing.md b/samples/openapi3/client/petstore/python-httpx/docs/Bathing.md new file mode 100644 index 00000000000..6ad70e2f67c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Bathing.md @@ -0,0 +1,31 @@ +# Bathing + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_name** | **str** | | +**function_name** | **str** | | +**content** | **str** | | + +## Example + +```python +from petstore_api.models.bathing import Bathing + +# TODO update the JSON string below +json = "{}" +# create an instance of Bathing from a JSON string +bathing_instance = Bathing.from_json(json) +# print the JSON string representation of the object +print(Bathing.to_json()) + +# convert the object into a dict +bathing_dict = bathing_instance.to_dict() +# create an instance of Bathing from a dict +bathing_from_dict = Bathing.from_dict(bathing_dict) +``` +[[Back to Model list]](../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-httpx/docs/Capitalization.md b/samples/openapi3/client/petstore/python-httpx/docs/Capitalization.md new file mode 100644 index 00000000000..6f564a8ed8c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Capitalization.md @@ -0,0 +1,34 @@ +# 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] + +## Example + +```python +from petstore_api.models.capitalization import Capitalization + +# TODO update the JSON string below +json = "{}" +# create an instance of Capitalization from a JSON string +capitalization_instance = Capitalization.from_json(json) +# print the JSON string representation of the object +print(Capitalization.to_json()) + +# convert the object into a dict +capitalization_dict = capitalization_instance.to_dict() +# create an instance of Capitalization from a dict +capitalization_from_dict = Capitalization.from_dict(capitalization_dict) +``` +[[Back to Model list]](../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-httpx/docs/Cat.md b/samples/openapi3/client/petstore/python-httpx/docs/Cat.md new file mode 100644 index 00000000000..d0e39efdb33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Cat.md @@ -0,0 +1,29 @@ +# Cat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +## Example + +```python +from petstore_api.models.cat import Cat + +# TODO update the JSON string below +json = "{}" +# create an instance of Cat from a JSON string +cat_instance = Cat.from_json(json) +# print the JSON string representation of the object +print(Cat.to_json()) + +# convert the object into a dict +cat_dict = cat_instance.to_dict() +# create an instance of Cat from a dict +cat_from_dict = Cat.from_dict(cat_dict) +``` +[[Back to Model list]](../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-httpx/docs/Category.md b/samples/openapi3/client/petstore/python-httpx/docs/Category.md new file mode 100644 index 00000000000..dbde14b7344 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Category.md @@ -0,0 +1,30 @@ +# Category + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [default to 'default-name'] + +## Example + +```python +from petstore_api.models.category import Category + +# TODO update the JSON string below +json = "{}" +# create an instance of Category from a JSON string +category_instance = Category.from_json(json) +# print the JSON string representation of the object +print(Category.to_json()) + +# convert the object into a dict +category_dict = category_instance.to_dict() +# create an instance of Category from a dict +category_from_dict = Category.from_dict(category_dict) +``` +[[Back to Model list]](../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-httpx/docs/CircularAllOfRef.md b/samples/openapi3/client/petstore/python-httpx/docs/CircularAllOfRef.md new file mode 100644 index 00000000000..65b171177e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/CircularAllOfRef.md @@ -0,0 +1,30 @@ +# CircularAllOfRef + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**second_circular_all_of_ref** | [**List[SecondCircularAllOfRef]**](SecondCircularAllOfRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.circular_all_of_ref import CircularAllOfRef + +# TODO update the JSON string below +json = "{}" +# create an instance of CircularAllOfRef from a JSON string +circular_all_of_ref_instance = CircularAllOfRef.from_json(json) +# print the JSON string representation of the object +print(CircularAllOfRef.to_json()) + +# convert the object into a dict +circular_all_of_ref_dict = circular_all_of_ref_instance.to_dict() +# create an instance of CircularAllOfRef from a dict +circular_all_of_ref_from_dict = CircularAllOfRef.from_dict(circular_all_of_ref_dict) +``` +[[Back to Model list]](../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-httpx/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-httpx/docs/CircularReferenceModel.md new file mode 100644 index 00000000000..87216f7273a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/CircularReferenceModel.md @@ -0,0 +1,30 @@ +# CircularReferenceModel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | [optional] +**nested** | [**FirstRef**](FirstRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.circular_reference_model import CircularReferenceModel + +# TODO update the JSON string below +json = "{}" +# create an instance of CircularReferenceModel from a JSON string +circular_reference_model_instance = CircularReferenceModel.from_json(json) +# print the JSON string representation of the object +print(CircularReferenceModel.to_json()) + +# convert the object into a dict +circular_reference_model_dict = circular_reference_model_instance.to_dict() +# create an instance of CircularReferenceModel from a dict +circular_reference_model_from_dict = CircularReferenceModel.from_dict(circular_reference_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/ClassModel.md b/samples/openapi3/client/petstore/python-httpx/docs/ClassModel.md new file mode 100644 index 00000000000..ea76a5c157b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ClassModel.md @@ -0,0 +1,30 @@ +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_class** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.class_model import ClassModel + +# TODO update the JSON string below +json = "{}" +# create an instance of ClassModel from a JSON string +class_model_instance = ClassModel.from_json(json) +# print the JSON string representation of the object +print(ClassModel.to_json()) + +# convert the object into a dict +class_model_dict = class_model_instance.to_dict() +# create an instance of ClassModel from a dict +class_model_from_dict = ClassModel.from_dict(class_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/Client.md b/samples/openapi3/client/petstore/python-httpx/docs/Client.md new file mode 100644 index 00000000000..22321c18915 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Client.md @@ -0,0 +1,29 @@ +# Client + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.client import Client + +# TODO update the JSON string below +json = "{}" +# create an instance of Client from a JSON string +client_instance = Client.from_json(json) +# print the JSON string representation of the object +print(Client.to_json()) + +# convert the object into a dict +client_dict = client_instance.to_dict() +# create an instance of Client from a dict +client_from_dict = Client.from_dict(client_dict) +``` +[[Back to Model list]](../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-httpx/docs/Color.md b/samples/openapi3/client/petstore/python-httpx/docs/Color.md new file mode 100644 index 00000000000..9ac3ab2e91f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Color.md @@ -0,0 +1,29 @@ +# Color + +RGB array, RGBA array, or hex string. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.color import Color + +# TODO update the JSON string below +json = "{}" +# create an instance of Color from a JSON string +color_instance = Color.from_json(json) +# print the JSON string representation of the object +print(Color.to_json()) + +# convert the object into a dict +color_dict = color_instance.to_dict() +# create an instance of Color from a dict +color_from_dict = Color.from_dict(color_dict) +``` +[[Back to Model list]](../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-httpx/docs/Creature.md b/samples/openapi3/client/petstore/python-httpx/docs/Creature.md new file mode 100644 index 00000000000..a4710214c19 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Creature.md @@ -0,0 +1,30 @@ +# Creature + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**info** | [**CreatureInfo**](CreatureInfo.md) | | +**type** | **str** | | + +## Example + +```python +from petstore_api.models.creature import Creature + +# TODO update the JSON string below +json = "{}" +# create an instance of Creature from a JSON string +creature_instance = Creature.from_json(json) +# print the JSON string representation of the object +print(Creature.to_json()) + +# convert the object into a dict +creature_dict = creature_instance.to_dict() +# create an instance of Creature from a dict +creature_from_dict = Creature.from_dict(creature_dict) +``` +[[Back to Model list]](../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-httpx/docs/CreatureInfo.md b/samples/openapi3/client/petstore/python-httpx/docs/CreatureInfo.md new file mode 100644 index 00000000000..db3b82bb9ff --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/CreatureInfo.md @@ -0,0 +1,29 @@ +# CreatureInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | + +## Example + +```python +from petstore_api.models.creature_info import CreatureInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatureInfo from a JSON string +creature_info_instance = CreatureInfo.from_json(json) +# print the JSON string representation of the object +print(CreatureInfo.to_json()) + +# convert the object into a dict +creature_info_dict = creature_info_instance.to_dict() +# create an instance of CreatureInfo from a dict +creature_info_from_dict = CreatureInfo.from_dict(creature_info_dict) +``` +[[Back to Model list]](../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-httpx/docs/DanishPig.md b/samples/openapi3/client/petstore/python-httpx/docs/DanishPig.md new file mode 100644 index 00000000000..16941388832 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DanishPig.md @@ -0,0 +1,30 @@ +# DanishPig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**size** | **int** | | + +## Example + +```python +from petstore_api.models.danish_pig import DanishPig + +# TODO update the JSON string below +json = "{}" +# create an instance of DanishPig from a JSON string +danish_pig_instance = DanishPig.from_json(json) +# print the JSON string representation of the object +print(DanishPig.to_json()) + +# convert the object into a dict +danish_pig_dict = danish_pig_instance.to_dict() +# create an instance of DanishPig from a dict +danish_pig_from_dict = DanishPig.from_dict(danish_pig_dict) +``` +[[Back to Model list]](../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-httpx/docs/DataOutputFormat.md b/samples/openapi3/client/petstore/python-httpx/docs/DataOutputFormat.md new file mode 100644 index 00000000000..d9df2a1cffd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DataOutputFormat.md @@ -0,0 +1,14 @@ +# DataOutputFormat + + +## Enum + +* `JSON` (value: `'JSON'`) + +* `CSV` (value: `'CSV'`) + +* `XML` (value: `'XML'`) + +[[Back to Model list]](../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-httpx/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-httpx/docs/DefaultApi.md new file mode 100644 index 00000000000..de6ed62ca68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DefaultApi.md @@ -0,0 +1,68 @@ +# 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 petstore_api +from petstore_api.models.foo_get_default_response import FooGetDefaultResponse +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.DefaultApi(api_client) + + try: + api_response = await api_instance.foo_get() + print("The response of DefaultApi->foo_get:\n") + pprint(api_response) + except Exception 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-httpx/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-httpx/docs/DeprecatedObject.md new file mode 100644 index 00000000000..6b362f379ba --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DeprecatedObject.md @@ -0,0 +1,29 @@ +# DeprecatedObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.deprecated_object import DeprecatedObject + +# TODO update the JSON string below +json = "{}" +# create an instance of DeprecatedObject from a JSON string +deprecated_object_instance = DeprecatedObject.from_json(json) +# print the JSON string representation of the object +print(DeprecatedObject.to_json()) + +# convert the object into a dict +deprecated_object_dict = deprecated_object_instance.to_dict() +# create an instance of DeprecatedObject from a dict +deprecated_object_from_dict = DeprecatedObject.from_dict(deprecated_object_dict) +``` +[[Back to Model list]](../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-httpx/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-httpx/docs/DiscriminatorAllOfSub.md new file mode 100644 index 00000000000..f72b6e8e68c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DiscriminatorAllOfSub.md @@ -0,0 +1,28 @@ +# DiscriminatorAllOfSub + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSub from a JSON string +discriminator_all_of_sub_instance = DiscriminatorAllOfSub.from_json(json) +# print the JSON string representation of the object +print(DiscriminatorAllOfSub.to_json()) + +# convert the object into a dict +discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() +# create an instance of DiscriminatorAllOfSub from a dict +discriminator_all_of_sub_from_dict = DiscriminatorAllOfSub.from_dict(discriminator_all_of_sub_dict) +``` +[[Back to Model list]](../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-httpx/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-httpx/docs/DiscriminatorAllOfSuper.md new file mode 100644 index 00000000000..477c05bfc44 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DiscriminatorAllOfSuper.md @@ -0,0 +1,29 @@ +# DiscriminatorAllOfSuper + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**element_type** | **str** | | + +## Example + +```python +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSuper from a JSON string +discriminator_all_of_super_instance = DiscriminatorAllOfSuper.from_json(json) +# print the JSON string representation of the object +print(DiscriminatorAllOfSuper.to_json()) + +# convert the object into a dict +discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() +# create an instance of DiscriminatorAllOfSuper from a dict +discriminator_all_of_super_from_dict = DiscriminatorAllOfSuper.from_dict(discriminator_all_of_super_dict) +``` +[[Back to Model list]](../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-httpx/docs/Dog.md b/samples/openapi3/client/petstore/python-httpx/docs/Dog.md new file mode 100644 index 00000000000..ed23f613d01 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Dog.md @@ -0,0 +1,29 @@ +# Dog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.dog import Dog + +# TODO update the JSON string below +json = "{}" +# create an instance of Dog from a JSON string +dog_instance = Dog.from_json(json) +# print the JSON string representation of the object +print(Dog.to_json()) + +# convert the object into a dict +dog_dict = dog_instance.to_dict() +# create an instance of Dog from a dict +dog_from_dict = Dog.from_dict(dog_dict) +``` +[[Back to Model list]](../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-httpx/docs/DummyModel.md b/samples/openapi3/client/petstore/python-httpx/docs/DummyModel.md new file mode 100644 index 00000000000..01b675977f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/DummyModel.md @@ -0,0 +1,30 @@ +# DummyModel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**self_ref** | [**SelfReferenceModel**](SelfReferenceModel.md) | | [optional] + +## Example + +```python +from petstore_api.models.dummy_model import DummyModel + +# TODO update the JSON string below +json = "{}" +# create an instance of DummyModel from a JSON string +dummy_model_instance = DummyModel.from_json(json) +# print the JSON string representation of the object +print(DummyModel.to_json()) + +# convert the object into a dict +dummy_model_dict = dummy_model_instance.to_dict() +# create an instance of DummyModel from a dict +dummy_model_from_dict = DummyModel.from_dict(dummy_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumArrays.md new file mode 100644 index 00000000000..f44617497bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumArrays.md @@ -0,0 +1,30 @@ +# EnumArrays + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **List[str]** | | [optional] + +## Example + +```python +from petstore_api.models.enum_arrays import EnumArrays + +# TODO update the JSON string below +json = "{}" +# create an instance of EnumArrays from a JSON string +enum_arrays_instance = EnumArrays.from_json(json) +# print the JSON string representation of the object +print(EnumArrays.to_json()) + +# convert the object into a dict +enum_arrays_dict = enum_arrays_instance.to_dict() +# create an instance of EnumArrays from a dict +enum_arrays_from_dict = EnumArrays.from_dict(enum_arrays_dict) +``` +[[Back to Model list]](../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-httpx/docs/EnumClass.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumClass.md new file mode 100644 index 00000000000..725b617bdad --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumClass.md @@ -0,0 +1,14 @@ +# EnumClass + + +## Enum + +* `ABC` (value: `'_abc'`) + +* `MINUS_EFG` (value: `'-efg'`) + +* `LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS` (value: `'(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-httpx/docs/EnumNumberVendorExt.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumNumberVendorExt.md new file mode 100644 index 00000000000..4c1572b1d27 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumNumberVendorExt.md @@ -0,0 +1,14 @@ +# EnumNumberVendorExt + + +## Enum + +* `FortyTwo` (value: `42`) + +* `Eigtheen` (value: `18`) + +* `FiftySix` (value: `56`) + +[[Back to Model list]](../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-httpx/docs/EnumRefWithDefaultValue.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumRefWithDefaultValue.md new file mode 100644 index 00000000000..eeb0dc66969 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumRefWithDefaultValue.md @@ -0,0 +1,29 @@ +# EnumRefWithDefaultValue + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to DataOutputFormat.JSON] + +## Example + +```python +from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue + +# TODO update the JSON string below +json = "{}" +# create an instance of EnumRefWithDefaultValue from a JSON string +enum_ref_with_default_value_instance = EnumRefWithDefaultValue.from_json(json) +# print the JSON string representation of the object +print(EnumRefWithDefaultValue.to_json()) + +# convert the object into a dict +enum_ref_with_default_value_dict = enum_ref_with_default_value_instance.to_dict() +# create an instance of EnumRefWithDefaultValue from a dict +enum_ref_with_default_value_from_dict = EnumRefWithDefaultValue.from_dict(enum_ref_with_default_value_dict) +``` +[[Back to Model list]](../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-httpx/docs/EnumString1.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumString1.md new file mode 100644 index 00000000000..aa214538bca --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumString1.md @@ -0,0 +1,12 @@ +# EnumString1 + + +## Enum + +* `A` (value: `'a'`) + +* `B` (value: `'b'`) + +[[Back to Model list]](../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-httpx/docs/EnumString2.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumString2.md new file mode 100644 index 00000000000..d1b49f8dddd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumString2.md @@ -0,0 +1,12 @@ +# EnumString2 + + +## Enum + +* `C` (value: `'c'`) + +* `D` (value: `'d'`) + +[[Back to Model list]](../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-httpx/docs/EnumStringVendorExt.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumStringVendorExt.md new file mode 100644 index 00000000000..ce6077c18a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumStringVendorExt.md @@ -0,0 +1,14 @@ +# EnumStringVendorExt + + +## Enum + +* `FOO_XEnumVarname` (value: `'FOO'`) + +* `BarVar_XEnumVarname` (value: `'Bar'`) + +* `bazVar_XEnumVarname` (value: `'baz'`) + +[[Back to Model list]](../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-httpx/docs/EnumTest.md b/samples/openapi3/client/petstore/python-httpx/docs/EnumTest.md new file mode 100644 index 00000000000..9f96c605d88 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/EnumTest.md @@ -0,0 +1,41 @@ +# EnumTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **str** | | [optional] +**enum_string_required** | **str** | | +**enum_integer_default** | **int** | | [optional] [default to 5] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**enum_string_single_member** | **str** | | [optional] +**enum_integer_single_member** | **int** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to OuterEnumDefaultValue.PLACED] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OuterEnumIntegerDefaultValue.NUMBER_0] +**enum_number_vendor_ext** | [**EnumNumberVendorExt**](EnumNumberVendorExt.md) | | [optional] +**enum_string_vendor_ext** | [**EnumStringVendorExt**](EnumStringVendorExt.md) | | [optional] + +## Example + +```python +from petstore_api.models.enum_test import EnumTest + +# TODO update the JSON string below +json = "{}" +# create an instance of EnumTest from a JSON string +enum_test_instance = EnumTest.from_json(json) +# print the JSON string representation of the object +print(EnumTest.to_json()) + +# convert the object into a dict +enum_test_dict = enum_test_instance.to_dict() +# create an instance of EnumTest from a dict +enum_test_from_dict = EnumTest.from_dict(enum_test_dict) +``` +[[Back to Model list]](../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-httpx/docs/FakeApi.md b/samples/openapi3/client/petstore/python-httpx/docs/FakeApi.md new file mode 100644 index 00000000000..c843e3940d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/FakeApi.md @@ -0,0 +1,2540 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_any_type_request_body**](FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body +[**fake_enum_ref_query_parameter**](FakeApi.md#fake_enum_ref_query_parameter) | **GET** /fake/enum_ref_query_parameter | test enum reference query parameter +[**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 | +[**fake_ref_enum_string**](FakeApi.md#fake_ref_enum_string) | **GET** /fake/ref_enum_string | test ref to enum string +[**fake_return_boolean**](FakeApi.md#fake_return_boolean) | **GET** /fake/return_boolean | test returning boolean +[**fake_return_byte_like_json**](FakeApi.md#fake_return_byte_like_json) | **GET** /fake/return_byte_like_json | test byte like json +[**fake_return_enum**](FakeApi.md#fake_return_enum) | **GET** /fake/return_enum | test returning enum +[**fake_return_enum_like_json**](FakeApi.md#fake_return_enum_like_json) | **GET** /fake/return_enum_like_json | test enum like json +[**fake_return_float**](FakeApi.md#fake_return_float) | **GET** /fake/return_float | test returning float +[**fake_return_int**](FakeApi.md#fake_return_int) | **GET** /fake/return_int | test returning int +[**fake_return_list_of_objects**](FakeApi.md#fake_return_list_of_objects) | **GET** /fake/return_list_of_object | test returning list of objects +[**fake_return_str_like_json**](FakeApi.md#fake_return_str_like_json) | **GET** /fake/return_str_like_json | test str like json +[**fake_return_string**](FakeApi.md#fake_return_string) | **GET** /fake/return_string | test returning string +[**fake_uuid_example**](FakeApi.md#fake_uuid_example) | **GET** /fake/uuid_example | test uuid example +[**test_additional_properties_reference**](FakeApi.md#test_additional_properties_reference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +[**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_date_time_query_parameter**](FakeApi.md#test_date_time_query_parameter) | **PUT** /fake/date-time-query-params | +[**test_empty_and_non_empty_responses**](FakeApi.md#test_empty_and_non_empty_responses) | **POST** /fake/empty_and_non_empty_responses | test empty and non-empty responses +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_error_responses_with_model**](FakeApi.md#test_error_responses_with_model) | **POST** /fake/error_responses_with_model | test error responses with model +[**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_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_object_for_multipart_requests**](FakeApi.md#test_object_for_multipart_requests) | **POST** /fake/object_for_multipart_requests | +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map +[**upload_file_with_additional_properties**](FakeApi.md#upload_file_with_additional_properties) | **POST** /fake/upload_file_with_additional_properties | uploads a file and additional properties using multipart/form-data + + +# **fake_any_type_request_body** +> fake_any_type_request_body(body=body) + +test any type request body + +### Example + + +```python +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.FakeApi(api_client) + body = None # object | (optional) + + try: + # test any type request body + await api_instance.fake_any_type_request_body(body=body) + except Exception as e: + print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **object**| | [optional] + +### 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** | OK | - | + +[[Back to top]](#) [[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_enum_ref_query_parameter** +> fake_enum_ref_query_parameter(enum_ref=enum_ref) + +test enum reference query parameter + +### Example + + +```python +import petstore_api +from petstore_api.models.enum_class import EnumClass +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.FakeApi(api_client) + enum_ref = -efg # EnumClass | enum reference (optional) (default to -efg) + + try: + # test enum reference query parameter + await api_instance.fake_enum_ref_query_parameter(enum_ref=enum_ref) + except Exception as e: + print("Exception when calling FakeApi->fake_enum_ref_query_parameter: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_ref** | [**EnumClass**](.md)| enum reference | [optional] [default to -efg] + +### 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** | Get successful | - | + +[[Back to top]](#) [[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 petstore_api +from petstore_api.models.health_check_result import HealthCheckResult +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.FakeApi(api_client) + + try: + # Health check endpoint + api_response = await api_instance.fake_health_get() + print("The response of FakeApi->fake_health_get:\n") + pprint(api_response) + except Exception 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 +import petstore_api +from petstore_api.models.pet import Pet +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. +from petstore_api import signing +import datetime + +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.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 +async 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 + await api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1) + except Exception 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 +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.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) + + try: + api_response = await api_instance.fake_outer_boolean_serialize(body=body) + print("The response of FakeApi->fake_outer_boolean_serialize:\n") + pprint(api_response) + except Exception 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 +import petstore_api +from petstore_api.models.outer_composite import OuterComposite +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.FakeApi(api_client) + outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) + + try: + api_response = await api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) + print("The response of FakeApi->fake_outer_composite_serialize:\n") + pprint(api_response) + except Exception 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 +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.FakeApi(api_client) + body = 3.4 # float | Input number as post body (optional) + + try: + api_response = await api_instance.fake_outer_number_serialize(body=body) + print("The response of FakeApi->fake_outer_number_serialize:\n") + pprint(api_response) + except Exception 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 +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.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) + + try: + api_response = await api_instance.fake_outer_string_serialize(body=body) + print("The response of FakeApi->fake_outer_string_serialize:\n") + pprint(api_response) + except Exception 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, param=param) + +Test serialization of enum (int) properties with examples + +### Example + + +```python +import petstore_api +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty +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.FakeApi(api_client) + outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body + param = [petstore_api.OuterEnumInteger()] # List[OuterEnumInteger] | (optional) + + try: + api_response = await api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property, param=param) + print("The response of FakeApi->fake_property_enum_integer_serialize:\n") + pprint(api_response) + except Exception 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 | + **param** | [**List[OuterEnumInteger]**](OuterEnumInteger.md)| | [optional] + +### 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) + +# **fake_ref_enum_string** +> EnumClass fake_ref_enum_string() + +test ref to enum string + +### Example + + +```python +import petstore_api +from petstore_api.models.enum_class import EnumClass +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.FakeApi(api_client) + + try: + # test ref to enum string + api_response = await api_instance.fake_ref_enum_string() + print("The response of FakeApi->fake_ref_enum_string:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_ref_enum_string: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**EnumClass**](EnumClass.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: plain/text + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_boolean** +> bool fake_return_boolean() + +test returning boolean + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test returning boolean + api_response = await api_instance.fake_return_boolean() + print("The response of FakeApi->fake_return_boolean:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_boolean: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_byte_like_json** +> bytearray fake_return_byte_like_json() + +test byte like json + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test byte like json + api_response = await api_instance.fake_return_byte_like_json() + print("The response of FakeApi->fake_return_byte_like_json:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_byte_like_json: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**bytearray** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: plain/text + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_enum** +> str fake_return_enum() + +test returning enum + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test returning enum + api_response = await api_instance.fake_return_enum() + print("The response of FakeApi->fake_return_enum:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_enum: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_enum_like_json** +> str fake_return_enum_like_json() + +test enum like json + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test enum like json + api_response = await api_instance.fake_return_enum_like_json() + print("The response of FakeApi->fake_return_enum_like_json:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_enum_like_json: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: plain/text + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_float** +> float fake_return_float() + +test returning float + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test returning float + api_response = await api_instance.fake_return_float() + print("The response of FakeApi->fake_return_float:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_float: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**float** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_int** +> int fake_return_int() + +test returning int + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test returning int + api_response = await api_instance.fake_return_int() + print("The response of FakeApi->fake_return_int:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_int: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**int** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_list_of_objects** +> List[List[Tag]] fake_return_list_of_objects() + +test returning list of objects + +### Example + + +```python +import petstore_api +from petstore_api.models.tag import Tag +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.FakeApi(api_client) + + try: + # test returning list of objects + api_response = await api_instance.fake_return_list_of_objects() + print("The response of FakeApi->fake_return_list_of_objects:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_list_of_objects: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**List[List[Tag]]** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_str_like_json** +> str fake_return_str_like_json() + +test str like json + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test str like json + api_response = await api_instance.fake_return_str_like_json() + print("The response of FakeApi->fake_return_str_like_json:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_str_like_json: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: plain/text + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_return_string** +> str fake_return_string() + +test returning string + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test returning string + api_response = await api_instance.fake_return_string() + print("The response of FakeApi->fake_return_string:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->fake_return_string: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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_uuid_example** +> fake_uuid_example(uuid_example) + +test uuid example + +### Example + + +```python +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.FakeApi(api_client) + uuid_example = '84529ad2-2265-4e15-b76b-c17025d848f6' # str | uuid example + + try: + # test uuid example + await api_instance.fake_uuid_example(uuid_example) + except Exception as e: + print("Exception when calling FakeApi->fake_uuid_example: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid_example** | **str**| uuid example | + +### 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** | Get successful | - | + +[[Back to top]](#) [[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_additional_properties_reference** +> test_additional_properties_reference(request_body) + +test referenced additionalProperties + + + +### Example + + +```python +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.FakeApi(api_client) + request_body = None # Dict[str, object] | request body + + try: + # test referenced additionalProperties + await api_instance.test_additional_properties_reference(request_body) + except Exception as e: + print("Exception when calling FakeApi->test_additional_properties_reference: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Dict[str, object]**](object.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_body_with_binary** +> test_body_with_binary(body) + +For this test, the body has to be a binary file. + +### Example + + +```python +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.FakeApi(api_client) + body = None # bytearray | image to upload + + try: + await api_instance.test_body_with_binary(body) + except Exception as e: + print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bytearray**| 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 +import petstore_api +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +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.FakeApi(api_client) + file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | + + try: + await api_instance.test_body_with_file_schema(file_schema_test_class) + except Exception 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 petstore_api +from petstore_api.models.user import User +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.FakeApi(api_client) + query = 'query_example' # str | + user = petstore_api.User() # User | + + try: + await api_instance.test_body_with_query_params(query, user) + except Exception 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 petstore_api +from petstore_api.models.client import Client +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.FakeApi(api_client) + client = petstore_api.Client() # Client | client model + + try: + # To test \"client\" model + api_response = await api_instance.test_client_model(client) + print("The response of FakeApi->test_client_model:\n") + pprint(api_response) + except Exception 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_date_time_query_parameter** +> test_date_time_query_parameter(date_time_query, str_query) + +### Example + + +```python +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.FakeApi(api_client) + date_time_query = '2013-10-20T19:20:30+01:00' # datetime | + str_query = 'str_query_example' # str | + + try: + await api_instance.test_date_time_query_parameter(date_time_query, str_query) + except Exception as e: + print("Exception when calling FakeApi->test_date_time_query_parameter: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **date_time_query** | **datetime**| | + **str_query** | **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) + +# **test_empty_and_non_empty_responses** +> test_empty_and_non_empty_responses() + +test empty and non-empty responses + + + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test empty and non-empty responses + await api_instance.test_empty_and_non_empty_responses() + except Exception as e: + print("Exception when calling FakeApi->test_empty_and_non_empty_responses: %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**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Success, but no response content | - | +**206** | Partial response content | - | + +[[Back to top]](#) [[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, var_float=var_float, string=string, binary=binary, byte_with_max_length=byte_with_max_length, var_date=var_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 +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 = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# 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.FakeApi(api_client) + number = 3.4 # float | None + double = 3.4 # float | None + pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None + byte = None # bytearray | None + integer = 56 # int | None (optional) + int32 = 56 # int | None (optional) + int64 = 56 # int | None (optional) + var_float = 3.4 # float | None (optional) + string = 'string_example' # str | None (optional) + binary = None # bytearray | None (optional) + byte_with_max_length = None # bytearray | None (optional) + var_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 假端點 偽のエンドポイント 가짜 엔드 포인트 + await api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, var_float=var_float, string=string, binary=binary, byte_with_max_length=byte_with_max_length, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback) + except Exception 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** | **bytearray**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **var_float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **bytearray**| None | [optional] + **byte_with_max_length** | **bytearray**| None | [optional] + **var_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_error_responses_with_model** +> test_error_responses_with_model() + +test error responses with model + +### Example + + +```python +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.FakeApi(api_client) + + try: + # test error responses with model + await api_instance.test_error_responses_with_model() + except Exception as e: + print("Exception when calling FakeApi->test_error_responses_with_model: %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**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Success, but no response content | - | +**400** | | - | +**404** | | - | + +[[Back to top]](#) [[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 +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 = os.environ["BEARER_TOKEN"] +) + +# 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.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) + await 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 Exception 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** | Someting 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 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.FakeApi(api_client) + request_body = {'key': 'request_body_example'} # Dict[str, str] | request body + + try: + # test inline additionalProperties + await api_instance.test_inline_additional_properties(request_body) + except Exception 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_inline_freeform_additional_properties** +> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + +test inline free-form additionalProperties + + + +### Example + + +```python +import petstore_api +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +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.FakeApi(api_client) + test_inline_freeform_additional_properties_request = petstore_api.TestInlineFreeformAdditionalPropertiesRequest() # TestInlineFreeformAdditionalPropertiesRequest | request body + + try: + # test inline free-form additionalProperties + await api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request) + except Exception as e: + print("Exception when calling FakeApi->test_inline_freeform_additional_properties: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 +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.FakeApi(api_client) + param = 'param_example' # str | field1 + param2 = 'param2_example' # str | field2 + + try: + # test json serialization of form data + await api_instance.test_json_form_data(param, param2) + except Exception 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_object_for_multipart_requests** +> test_object_for_multipart_requests(marker) + +### Example + + +```python +import petstore_api +from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker +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.FakeApi(api_client) + marker = petstore_api.TestObjectForMultipartRequestsRequestMarker() # TestObjectForMultipartRequestsRequestMarker | + + try: + await api_instance.test_object_for_multipart_requests(marker) + except Exception as e: + print("Exception when calling FakeApi->test_object_for_multipart_requests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **marker** | [**TestObjectForMultipartRequestsRequestMarker**](TestObjectForMultipartRequestsRequestMarker.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **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_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 +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.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: + await api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) + except Exception 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) + +# **test_string_map_reference** +> test_string_map_reference(request_body) + +test referenced string map + + + +### Example + + +```python +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.FakeApi(api_client) + request_body = {'key': 'request_body_example'} # Dict[str, str] | request body + + try: + # test referenced string map + await api_instance.test_string_map_reference(request_body) + except Exception as e: + print("Exception when calling FakeApi->test_string_map_reference: %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) + +# **upload_file_with_additional_properties** +> ModelApiResponse upload_file_with_additional_properties(file, object=object, count=count) + +uploads a file and additional properties using multipart/form-data + + + +### Example + + +```python +import petstore_api +from petstore_api.models.model_api_response import ModelApiResponse +from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject +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.FakeApi(api_client) + file = None # bytearray | file to upload + object = petstore_api.UploadFileWithAdditionalPropertiesRequestObject() # UploadFileWithAdditionalPropertiesRequestObject | (optional) + count = 56 # int | Integer count (optional) + + try: + # uploads a file and additional properties using multipart/form-data + api_response = await api_instance.upload_file_with_additional_properties(file, object=object, count=count) + print("The response of FakeApi->upload_file_with_additional_properties:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FakeApi->upload_file_with_additional_properties: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **bytearray**| file to upload | + **object** | [**UploadFileWithAdditionalPropertiesRequestObject**](UploadFileWithAdditionalPropertiesRequestObject.md)| | [optional] + **count** | **int**| Integer count | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.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-httpx/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-httpx/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..d0d98577a5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/FakeClassnameTags123Api.md @@ -0,0 +1,88 @@ +# 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 petstore_api +from petstore_api.models.client import Client +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'] = os.environ["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 +async 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 = await api_instance.test_classname(client) + print("The response of FakeClassnameTags123Api->test_classname:\n") + pprint(api_response) + except Exception 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-httpx/docs/Feeding.md b/samples/openapi3/client/petstore/python-httpx/docs/Feeding.md new file mode 100644 index 00000000000..9f92b5d964d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Feeding.md @@ -0,0 +1,31 @@ +# Feeding + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_name** | **str** | | +**function_name** | **str** | | +**content** | **str** | | + +## Example + +```python +from petstore_api.models.feeding import Feeding + +# TODO update the JSON string below +json = "{}" +# create an instance of Feeding from a JSON string +feeding_instance = Feeding.from_json(json) +# print the JSON string representation of the object +print(Feeding.to_json()) + +# convert the object into a dict +feeding_dict = feeding_instance.to_dict() +# create an instance of Feeding from a dict +feeding_from_dict = Feeding.from_dict(feeding_dict) +``` +[[Back to Model list]](../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-httpx/docs/File.md b/samples/openapi3/client/petstore/python-httpx/docs/File.md new file mode 100644 index 00000000000..23f0567411c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/File.md @@ -0,0 +1,30 @@ +# File + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **str** | Test capitalization | [optional] + +## Example + +```python +from petstore_api.models.file import File + +# TODO update the JSON string below +json = "{}" +# create an instance of File from a JSON string +file_instance = File.from_json(json) +# print the JSON string representation of the object +print(File.to_json()) + +# convert the object into a dict +file_dict = file_instance.to_dict() +# create an instance of File from a dict +file_from_dict = File.from_dict(file_dict) +``` +[[Back to Model list]](../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-httpx/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-httpx/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..e1118042a8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/FileSchemaTestClass.md @@ -0,0 +1,30 @@ +# FileSchemaTestClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] +**files** | [**List[File]**](File.md) | | [optional] + +## Example + +```python +from petstore_api.models.file_schema_test_class import FileSchemaTestClass + +# TODO update the JSON string below +json = "{}" +# create an instance of FileSchemaTestClass from a JSON string +file_schema_test_class_instance = FileSchemaTestClass.from_json(json) +# print the JSON string representation of the object +print(FileSchemaTestClass.to_json()) + +# convert the object into a dict +file_schema_test_class_dict = file_schema_test_class_instance.to_dict() +# create an instance of FileSchemaTestClass from a dict +file_schema_test_class_from_dict = FileSchemaTestClass.from_dict(file_schema_test_class_dict) +``` +[[Back to Model list]](../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-httpx/docs/FirstRef.md b/samples/openapi3/client/petstore/python-httpx/docs/FirstRef.md new file mode 100644 index 00000000000..94b8ddc5ac2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/FirstRef.md @@ -0,0 +1,30 @@ +# FirstRef + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**self_ref** | [**SecondRef**](SecondRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.first_ref import FirstRef + +# TODO update the JSON string below +json = "{}" +# create an instance of FirstRef from a JSON string +first_ref_instance = FirstRef.from_json(json) +# print the JSON string representation of the object +print(FirstRef.to_json()) + +# convert the object into a dict +first_ref_dict = first_ref_instance.to_dict() +# create an instance of FirstRef from a dict +first_ref_from_dict = FirstRef.from_dict(first_ref_dict) +``` +[[Back to Model list]](../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-httpx/docs/Foo.md b/samples/openapi3/client/petstore/python-httpx/docs/Foo.md new file mode 100644 index 00000000000..f635b0daa6d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Foo.md @@ -0,0 +1,29 @@ +# Foo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [default to 'bar'] + +## Example + +```python +from petstore_api.models.foo import Foo + +# TODO update the JSON string below +json = "{}" +# create an instance of Foo from a JSON string +foo_instance = Foo.from_json(json) +# print the JSON string representation of the object +print(Foo.to_json()) + +# convert the object into a dict +foo_dict = foo_instance.to_dict() +# create an instance of Foo from a dict +foo_from_dict = Foo.from_dict(foo_dict) +``` +[[Back to Model list]](../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-httpx/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-httpx/docs/FooGetDefaultResponse.md new file mode 100644 index 00000000000..8d84f795b00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/FooGetDefaultResponse.md @@ -0,0 +1,29 @@ +# FooGetDefaultResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +## Example + +```python +from petstore_api.models.foo_get_default_response import FooGetDefaultResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FooGetDefaultResponse from a JSON string +foo_get_default_response_instance = FooGetDefaultResponse.from_json(json) +# print the JSON string representation of the object +print(FooGetDefaultResponse.to_json()) + +# convert the object into a dict +foo_get_default_response_dict = foo_get_default_response_instance.to_dict() +# create an instance of FooGetDefaultResponse from a dict +foo_get_default_response_from_dict = FooGetDefaultResponse.from_dict(foo_get_default_response_dict) +``` +[[Back to Model list]](../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-httpx/docs/FormatTest.md b/samples/openapi3/client/petstore/python-httpx/docs/FormatTest.md new file mode 100644 index 00000000000..6be7fc01757 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/FormatTest.md @@ -0,0 +1,45 @@ +# FormatTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **float** | | +**var_float** | **float** | | [optional] +**double** | **float** | | [optional] +**decimal** | **decimal.Decimal** | | [optional] +**string** | **str** | | [optional] +**string_with_double_quote_pattern** | **str** | | [optional] +**byte** | **bytearray** | | [optional] +**binary** | **bytearray** | | [optional] +**var_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] + +## Example + +```python +from petstore_api.models.format_test import FormatTest + +# TODO update the JSON string below +json = "{}" +# create an instance of FormatTest from a JSON string +format_test_instance = FormatTest.from_json(json) +# print the JSON string representation of the object +print(FormatTest.to_json()) + +# convert the object into a dict +format_test_dict = format_test_instance.to_dict() +# create an instance of FormatTest from a dict +format_test_from_dict = FormatTest.from_dict(format_test_dict) +``` +[[Back to Model list]](../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-httpx/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-httpx/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..fdc48781b15 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/HasOnlyReadOnly.md @@ -0,0 +1,30 @@ +# HasOnlyReadOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] + +## Example + +```python +from petstore_api.models.has_only_read_only import HasOnlyReadOnly + +# TODO update the JSON string below +json = "{}" +# create an instance of HasOnlyReadOnly from a JSON string +has_only_read_only_instance = HasOnlyReadOnly.from_json(json) +# print the JSON string representation of the object +print(HasOnlyReadOnly.to_json()) + +# convert the object into a dict +has_only_read_only_dict = has_only_read_only_instance.to_dict() +# create an instance of HasOnlyReadOnly from a dict +has_only_read_only_from_dict = HasOnlyReadOnly.from_dict(has_only_read_only_dict) +``` +[[Back to Model list]](../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-httpx/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-httpx/docs/HealthCheckResult.md new file mode 100644 index 00000000000..d4a2b187167 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/HealthCheckResult.md @@ -0,0 +1,30 @@ +# 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] + +## Example + +```python +from petstore_api.models.health_check_result import HealthCheckResult + +# TODO update the JSON string below +json = "{}" +# create an instance of HealthCheckResult from a JSON string +health_check_result_instance = HealthCheckResult.from_json(json) +# print the JSON string representation of the object +print(HealthCheckResult.to_json()) + +# convert the object into a dict +health_check_result_dict = health_check_result_instance.to_dict() +# create an instance of HealthCheckResult from a dict +health_check_result_from_dict = HealthCheckResult.from_dict(health_check_result_dict) +``` +[[Back to Model list]](../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-httpx/docs/HuntingDog.md b/samples/openapi3/client/petstore/python-httpx/docs/HuntingDog.md new file mode 100644 index 00000000000..6db6745dd02 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/HuntingDog.md @@ -0,0 +1,29 @@ +# HuntingDog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_trained** | **bool** | | [optional] + +## Example + +```python +from petstore_api.models.hunting_dog import HuntingDog + +# TODO update the JSON string below +json = "{}" +# create an instance of HuntingDog from a JSON string +hunting_dog_instance = HuntingDog.from_json(json) +# print the JSON string representation of the object +print(HuntingDog.to_json()) + +# convert the object into a dict +hunting_dog_dict = hunting_dog_instance.to_dict() +# create an instance of HuntingDog from a dict +hunting_dog_from_dict = HuntingDog.from_dict(hunting_dog_dict) +``` +[[Back to Model list]](../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-httpx/docs/ImportTestDatetimeApi.md b/samples/openapi3/client/petstore/python-httpx/docs/ImportTestDatetimeApi.md new file mode 100644 index 00000000000..fd20b1e873d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ImportTestDatetimeApi.md @@ -0,0 +1,70 @@ +# petstore_api.ImportTestDatetimeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**import_test_return_datetime**](ImportTestDatetimeApi.md#import_test_return_datetime) | **GET** /import_test/return_datetime | test date time + + +# **import_test_return_datetime** +> datetime import_test_return_datetime() + +test date time + +### Example + + +```python +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.ImportTestDatetimeApi(api_client) + + try: + # test date time + api_response = await api_instance.import_test_return_datetime() + print("The response of ImportTestDatetimeApi->import_test_return_datetime:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ImportTestDatetimeApi->import_test_return_datetime: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**datetime** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[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-httpx/docs/Info.md b/samples/openapi3/client/petstore/python-httpx/docs/Info.md new file mode 100644 index 00000000000..db88778a914 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Info.md @@ -0,0 +1,29 @@ +# Info + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**val** | [**BaseDiscriminator**](BaseDiscriminator.md) | | [optional] + +## Example + +```python +from petstore_api.models.info import Info + +# TODO update the JSON string below +json = "{}" +# create an instance of Info from a JSON string +info_instance = Info.from_json(json) +# print the JSON string representation of the object +print(Info.to_json()) + +# convert the object into a dict +info_dict = info_instance.to_dict() +# create an instance of Info from a dict +info_from_dict = Info.from_dict(info_dict) +``` +[[Back to Model list]](../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-httpx/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-httpx/docs/InnerDictWithProperty.md new file mode 100644 index 00000000000..7b82ebb770b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/InnerDictWithProperty.md @@ -0,0 +1,29 @@ +# InnerDictWithProperty + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a_property** | **object** | | [optional] + +## Example + +```python +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of InnerDictWithProperty from a JSON string +inner_dict_with_property_instance = InnerDictWithProperty.from_json(json) +# print the JSON string representation of the object +print(InnerDictWithProperty.to_json()) + +# convert the object into a dict +inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() +# create an instance of InnerDictWithProperty from a dict +inner_dict_with_property_from_dict = InnerDictWithProperty.from_dict(inner_dict_with_property_dict) +``` +[[Back to Model list]](../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-httpx/docs/InputAllOf.md b/samples/openapi3/client/petstore/python-httpx/docs/InputAllOf.md new file mode 100644 index 00000000000..45298f5308f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/InputAllOf.md @@ -0,0 +1,29 @@ +# InputAllOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_data** | [**Dict[str, Tag]**](Tag.md) | | [optional] + +## Example + +```python +from petstore_api.models.input_all_of import InputAllOf + +# TODO update the JSON string below +json = "{}" +# create an instance of InputAllOf from a JSON string +input_all_of_instance = InputAllOf.from_json(json) +# print the JSON string representation of the object +print(InputAllOf.to_json()) + +# convert the object into a dict +input_all_of_dict = input_all_of_instance.to_dict() +# create an instance of InputAllOf from a dict +input_all_of_from_dict = InputAllOf.from_dict(input_all_of_dict) +``` +[[Back to Model list]](../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-httpx/docs/IntOrString.md b/samples/openapi3/client/petstore/python-httpx/docs/IntOrString.md new file mode 100644 index 00000000000..b4070b9a8c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/IntOrString.md @@ -0,0 +1,28 @@ +# IntOrString + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.int_or_string import IntOrString + +# TODO update the JSON string below +json = "{}" +# create an instance of IntOrString from a JSON string +int_or_string_instance = IntOrString.from_json(json) +# print the JSON string representation of the object +print(IntOrString.to_json()) + +# convert the object into a dict +int_or_string_dict = int_or_string_instance.to_dict() +# create an instance of IntOrString from a dict +int_or_string_from_dict = IntOrString.from_dict(int_or_string_dict) +``` +[[Back to Model list]](../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-httpx/docs/ListClass.md b/samples/openapi3/client/petstore/python-httpx/docs/ListClass.md new file mode 100644 index 00000000000..01068b7d22c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ListClass.md @@ -0,0 +1,29 @@ +# ListClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_123_list** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.list_class import ListClass + +# TODO update the JSON string below +json = "{}" +# create an instance of ListClass from a JSON string +list_class_instance = ListClass.from_json(json) +# print the JSON string representation of the object +print(ListClass.to_json()) + +# convert the object into a dict +list_class_dict = list_class_instance.to_dict() +# create an instance of ListClass from a dict +list_class_from_dict = ListClass.from_dict(list_class_dict) +``` +[[Back to Model list]](../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-httpx/docs/MapOfArrayOfModel.md b/samples/openapi3/client/petstore/python-httpx/docs/MapOfArrayOfModel.md new file mode 100644 index 00000000000..71a4ef66b68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/MapOfArrayOfModel.md @@ -0,0 +1,29 @@ +# MapOfArrayOfModel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shop_id_to_org_online_lip_map** | **Dict[str, List[Tag]]** | | [optional] + +## Example + +```python +from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel + +# TODO update the JSON string below +json = "{}" +# create an instance of MapOfArrayOfModel from a JSON string +map_of_array_of_model_instance = MapOfArrayOfModel.from_json(json) +# print the JSON string representation of the object +print(MapOfArrayOfModel.to_json()) + +# convert the object into a dict +map_of_array_of_model_dict = map_of_array_of_model_instance.to_dict() +# create an instance of MapOfArrayOfModel from a dict +map_of_array_of_model_from_dict = MapOfArrayOfModel.from_dict(map_of_array_of_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/MapTest.md b/samples/openapi3/client/petstore/python-httpx/docs/MapTest.md new file mode 100644 index 00000000000..d04b82e9378 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/MapTest.md @@ -0,0 +1,32 @@ +# 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] + +## Example + +```python +from petstore_api.models.map_test import MapTest + +# TODO update the JSON string below +json = "{}" +# create an instance of MapTest from a JSON string +map_test_instance = MapTest.from_json(json) +# print the JSON string representation of the object +print(MapTest.to_json()) + +# convert the object into a dict +map_test_dict = map_test_instance.to_dict() +# create an instance of MapTest from a dict +map_test_from_dict = MapTest.from_dict(map_test_dict) +``` +[[Back to Model list]](../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-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..0dc994275d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,31 @@ +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**Dict[str, Animal]**](Animal.md) | | [optional] + +## Example + +```python +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass + +# TODO update the JSON string below +json = "{}" +# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string +mixed_properties_and_additional_properties_class_instance = MixedPropertiesAndAdditionalPropertiesClass.from_json(json) +# print the JSON string representation of the object +print(MixedPropertiesAndAdditionalPropertiesClass.to_json()) + +# convert the object into a dict +mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict() +# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict +mixed_properties_and_additional_properties_class_from_dict = MixedPropertiesAndAdditionalPropertiesClass.from_dict(mixed_properties_and_additional_properties_class_dict) +``` +[[Back to Model list]](../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-httpx/docs/Model200Response.md b/samples/openapi3/client/petstore/python-httpx/docs/Model200Response.md new file mode 100644 index 00000000000..7fdbdefc6ce --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Model200Response.md @@ -0,0 +1,31 @@ +# Model200Response + +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**var_class** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.model200_response import Model200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of Model200Response from a JSON string +model200_response_instance = Model200Response.from_json(json) +# print the JSON string representation of the object +print(Model200Response.to_json()) + +# convert the object into a dict +model200_response_dict = model200_response_instance.to_dict() +# create an instance of Model200Response from a dict +model200_response_from_dict = Model200Response.from_dict(model200_response_dict) +``` +[[Back to Model list]](../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-httpx/docs/ModelApiResponse.md b/samples/openapi3/client/petstore/python-httpx/docs/ModelApiResponse.md new file mode 100644 index 00000000000..5ddc0db2a0f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ModelApiResponse.md @@ -0,0 +1,31 @@ +# ModelApiResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.model_api_response import ModelApiResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelApiResponse from a JSON string +model_api_response_instance = ModelApiResponse.from_json(json) +# print the JSON string representation of the object +print(ModelApiResponse.to_json()) + +# convert the object into a dict +model_api_response_dict = model_api_response_instance.to_dict() +# create an instance of ModelApiResponse from a dict +model_api_response_from_dict = ModelApiResponse.from_dict(model_api_response_dict) +``` +[[Back to Model list]](../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-httpx/docs/ModelField.md b/samples/openapi3/client/petstore/python-httpx/docs/ModelField.md new file mode 100644 index 00000000000..9073b5dbdb0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ModelField.md @@ -0,0 +1,29 @@ +# ModelField + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_field** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.model_field import ModelField + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelField from a JSON string +model_field_instance = ModelField.from_json(json) +# print the JSON string representation of the object +print(ModelField.to_json()) + +# convert the object into a dict +model_field_dict = model_field_instance.to_dict() +# create an instance of ModelField from a dict +model_field_from_dict = ModelField.from_dict(model_field_dict) +``` +[[Back to Model list]](../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-httpx/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-httpx/docs/ModelReturn.md new file mode 100644 index 00000000000..7d327053b0c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ModelReturn.md @@ -0,0 +1,30 @@ +# ModelReturn + +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_return** | **int** | | [optional] + +## Example + +```python +from petstore_api.models.model_return import ModelReturn + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelReturn from a JSON string +model_return_instance = ModelReturn.from_json(json) +# print the JSON string representation of the object +print(ModelReturn.to_json()) + +# convert the object into a dict +model_return_dict = model_return_instance.to_dict() +# create an instance of ModelReturn from a dict +model_return_from_dict = ModelReturn.from_dict(model_return_dict) +``` +[[Back to Model list]](../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-httpx/docs/MultiArrays.md b/samples/openapi3/client/petstore/python-httpx/docs/MultiArrays.md new file mode 100644 index 00000000000..fea5139e7e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/MultiArrays.md @@ -0,0 +1,30 @@ +# MultiArrays + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | [**List[Tag]**](Tag.md) | | [optional] +**files** | [**List[File]**](File.md) | Another array of objects in addition to tags (mypy check to not to reuse the same iterator) | [optional] + +## Example + +```python +from petstore_api.models.multi_arrays import MultiArrays + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiArrays from a JSON string +multi_arrays_instance = MultiArrays.from_json(json) +# print the JSON string representation of the object +print(MultiArrays.to_json()) + +# convert the object into a dict +multi_arrays_dict = multi_arrays_instance.to_dict() +# create an instance of MultiArrays from a dict +multi_arrays_from_dict = MultiArrays.from_dict(multi_arrays_dict) +``` +[[Back to Model list]](../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-httpx/docs/Name.md b/samples/openapi3/client/petstore/python-httpx/docs/Name.md new file mode 100644 index 00000000000..5a04ec1ada0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Name.md @@ -0,0 +1,33 @@ +# Name + +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**var_property** | **str** | | [optional] +**var_123_number** | **int** | | [optional] [readonly] + +## Example + +```python +from petstore_api.models.name import Name + +# TODO update the JSON string below +json = "{}" +# create an instance of Name from a JSON string +name_instance = Name.from_json(json) +# print the JSON string representation of the object +print(Name.to_json()) + +# convert the object into a dict +name_dict = name_instance.to_dict() +# create an instance of Name from a dict +name_from_dict = Name.from_dict(name_dict) +``` +[[Back to Model list]](../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-httpx/docs/NullableClass.md b/samples/openapi3/client/petstore/python-httpx/docs/NullableClass.md new file mode 100644 index 00000000000..0387dcc2c67 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/NullableClass.md @@ -0,0 +1,41 @@ +# NullableClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required_integer_prop** | **int** | | +**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[Optional[object]]** | | [optional] +**array_items_nullable** | **List[Optional[object]]** | | [optional] +**object_nullable_prop** | **Dict[str, object]** | | [optional] +**object_and_items_nullable_prop** | **Dict[str, Optional[object]]** | | [optional] +**object_items_nullable** | **Dict[str, Optional[object]]** | | [optional] + +## Example + +```python +from petstore_api.models.nullable_class import NullableClass + +# TODO update the JSON string below +json = "{}" +# create an instance of NullableClass from a JSON string +nullable_class_instance = NullableClass.from_json(json) +# print the JSON string representation of the object +print(NullableClass.to_json()) + +# convert the object into a dict +nullable_class_dict = nullable_class_instance.to_dict() +# create an instance of NullableClass from a dict +nullable_class_from_dict = NullableClass.from_dict(nullable_class_dict) +``` +[[Back to Model list]](../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-httpx/docs/NullableProperty.md b/samples/openapi3/client/petstore/python-httpx/docs/NullableProperty.md new file mode 100644 index 00000000000..30edaf4844b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/NullableProperty.md @@ -0,0 +1,30 @@ +# NullableProperty + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**name** | **str** | | + +## Example + +```python +from petstore_api.models.nullable_property import NullableProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of NullableProperty from a JSON string +nullable_property_instance = NullableProperty.from_json(json) +# print the JSON string representation of the object +print(NullableProperty.to_json()) + +# convert the object into a dict +nullable_property_dict = nullable_property_instance.to_dict() +# create an instance of NullableProperty from a dict +nullable_property_from_dict = NullableProperty.from_dict(nullable_property_dict) +``` +[[Back to Model list]](../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-httpx/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-httpx/docs/NumberOnly.md new file mode 100644 index 00000000000..415dd25585d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/NumberOnly.md @@ -0,0 +1,29 @@ +# NumberOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +## Example + +```python +from petstore_api.models.number_only import NumberOnly + +# TODO update the JSON string below +json = "{}" +# create an instance of NumberOnly from a JSON string +number_only_instance = NumberOnly.from_json(json) +# print the JSON string representation of the object +print(NumberOnly.to_json()) + +# convert the object into a dict +number_only_dict = number_only_instance.to_dict() +# create an instance of NumberOnly from a dict +number_only_from_dict = NumberOnly.from_dict(number_only_dict) +``` +[[Back to Model list]](../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-httpx/docs/ObjectToTestAdditionalProperties.md b/samples/openapi3/client/petstore/python-httpx/docs/ObjectToTestAdditionalProperties.md new file mode 100644 index 00000000000..f6bc34c98e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ObjectToTestAdditionalProperties.md @@ -0,0 +1,30 @@ +# ObjectToTestAdditionalProperties + +Minimal object + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_property** | **bool** | Property | [optional] [default to False] + +## Example + +```python +from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectToTestAdditionalProperties from a JSON string +object_to_test_additional_properties_instance = ObjectToTestAdditionalProperties.from_json(json) +# print the JSON string representation of the object +print(ObjectToTestAdditionalProperties.to_json()) + +# convert the object into a dict +object_to_test_additional_properties_dict = object_to_test_additional_properties_instance.to_dict() +# create an instance of ObjectToTestAdditionalProperties from a dict +object_to_test_additional_properties_from_dict = ObjectToTestAdditionalProperties.from_dict(object_to_test_additional_properties_dict) +``` +[[Back to Model list]](../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-httpx/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-httpx/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..6dbd2ace04f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,32 @@ +# ObjectWithDeprecatedFields + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**id** | **float** | | [optional] +**deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | **List[str]** | | [optional] + +## Example + +```python +from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectWithDeprecatedFields from a JSON string +object_with_deprecated_fields_instance = ObjectWithDeprecatedFields.from_json(json) +# print the JSON string representation of the object +print(ObjectWithDeprecatedFields.to_json()) + +# convert the object into a dict +object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict() +# create an instance of ObjectWithDeprecatedFields from a dict +object_with_deprecated_fields_from_dict = ObjectWithDeprecatedFields.from_dict(object_with_deprecated_fields_dict) +``` +[[Back to Model list]](../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-httpx/docs/OneOfEnumString.md b/samples/openapi3/client/petstore/python-httpx/docs/OneOfEnumString.md new file mode 100644 index 00000000000..6f1b157c36c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OneOfEnumString.md @@ -0,0 +1,17 @@ +# OneOfEnumString + +oneOf enum strings + +## Enum + +* `A` (value: `'a'`) + +* `B` (value: `'b'`) + +* `C` (value: `'c'`) + +* `D` (value: `'d'`) + +[[Back to Model list]](../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-httpx/docs/Order.md b/samples/openapi3/client/petstore/python-httpx/docs/Order.md new file mode 100644 index 00000000000..00526b8d04b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Order.md @@ -0,0 +1,34 @@ +# 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] + +## Example + +```python +from petstore_api.models.order import Order + +# TODO update the JSON string below +json = "{}" +# create an instance of Order from a JSON string +order_instance = Order.from_json(json) +# print the JSON string representation of the object +print(Order.to_json()) + +# convert the object into a dict +order_dict = order_instance.to_dict() +# create an instance of Order from a dict +order_from_dict = Order.from_dict(order_dict) +``` +[[Back to Model list]](../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-httpx/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-httpx/docs/OuterComposite.md new file mode 100644 index 00000000000..c8242c2d265 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OuterComposite.md @@ -0,0 +1,31 @@ +# OuterComposite + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **float** | | [optional] +**my_string** | **str** | | [optional] +**my_boolean** | **bool** | | [optional] + +## Example + +```python +from petstore_api.models.outer_composite import OuterComposite + +# TODO update the JSON string below +json = "{}" +# create an instance of OuterComposite from a JSON string +outer_composite_instance = OuterComposite.from_json(json) +# print the JSON string representation of the object +print(OuterComposite.to_json()) + +# convert the object into a dict +outer_composite_dict = outer_composite_instance.to_dict() +# create an instance of OuterComposite from a dict +outer_composite_from_dict = OuterComposite.from_dict(outer_composite_dict) +``` +[[Back to Model list]](../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-httpx/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnum.md new file mode 100644 index 00000000000..9ba4f91069a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnum.md @@ -0,0 +1,14 @@ +# OuterEnum + + +## Enum + +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'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-httpx/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..0c97f8c9cb6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# OuterEnumDefaultValue + + +## Enum + +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'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-httpx/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..052b5163814 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# OuterEnumInteger + + +## Enum + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `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-httpx/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..66cd0abdb0a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,16 @@ +# OuterEnumIntegerDefaultValue + + +## Enum + +* `NUMBER_MINUS_1` (value: `-1`) + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `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-httpx/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-httpx/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 00000000000..6137dbd98da --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,30 @@ +# OuterObjectWithEnumProperty + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**str_value** | [**OuterEnum**](OuterEnum.md) | | [optional] +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +## Example + +```python +from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of OuterObjectWithEnumProperty from a JSON string +outer_object_with_enum_property_instance = OuterObjectWithEnumProperty.from_json(json) +# print the JSON string representation of the object +print(OuterObjectWithEnumProperty.to_json()) + +# convert the object into a dict +outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict() +# create an instance of OuterObjectWithEnumProperty from a dict +outer_object_with_enum_property_from_dict = OuterObjectWithEnumProperty.from_dict(outer_object_with_enum_property_dict) +``` +[[Back to Model list]](../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-httpx/docs/Parent.md b/samples/openapi3/client/petstore/python-httpx/docs/Parent.md new file mode 100644 index 00000000000..7387f9250aa --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Parent.md @@ -0,0 +1,29 @@ +# Parent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_dict** | [**Dict[str, InnerDictWithProperty]**](InnerDictWithProperty.md) | | [optional] + +## Example + +```python +from petstore_api.models.parent import Parent + +# TODO update the JSON string below +json = "{}" +# create an instance of Parent from a JSON string +parent_instance = Parent.from_json(json) +# print the JSON string representation of the object +print(Parent.to_json()) + +# convert the object into a dict +parent_dict = parent_instance.to_dict() +# create an instance of Parent from a dict +parent_from_dict = Parent.from_dict(parent_dict) +``` +[[Back to Model list]](../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-httpx/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-httpx/docs/ParentWithOptionalDict.md new file mode 100644 index 00000000000..bfc8688ea26 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ParentWithOptionalDict.md @@ -0,0 +1,29 @@ +# ParentWithOptionalDict + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_dict** | [**Dict[str, InnerDictWithProperty]**](InnerDictWithProperty.md) | | [optional] + +## Example + +```python +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict + +# TODO update the JSON string below +json = "{}" +# create an instance of ParentWithOptionalDict from a JSON string +parent_with_optional_dict_instance = ParentWithOptionalDict.from_json(json) +# print the JSON string representation of the object +print(ParentWithOptionalDict.to_json()) + +# convert the object into a dict +parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() +# create an instance of ParentWithOptionalDict from a dict +parent_with_optional_dict_from_dict = ParentWithOptionalDict.from_dict(parent_with_optional_dict_dict) +``` +[[Back to Model list]](../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-httpx/docs/Pet.md b/samples/openapi3/client/petstore/python-httpx/docs/Pet.md new file mode 100644 index 00000000000..5329cf2fb92 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Pet.md @@ -0,0 +1,34 @@ +# 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] + +## Example + +```python +from petstore_api.models.pet import Pet + +# TODO update the JSON string below +json = "{}" +# create an instance of Pet from a JSON string +pet_instance = Pet.from_json(json) +# print the JSON string representation of the object +print(Pet.to_json()) + +# convert the object into a dict +pet_dict = pet_instance.to_dict() +# create an instance of Pet from a dict +pet_from_dict = Pet.from_dict(pet_dict) +``` +[[Back to Model list]](../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-httpx/docs/PetApi.md b/samples/openapi3/client/petstore/python-httpx/docs/PetApi.md new file mode 100644 index 00000000000..5c94968b7ca --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/PetApi.md @@ -0,0 +1,962 @@ +# 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 +import petstore_api +from petstore_api.models.pet import Pet +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. + +configuration.access_token = os.environ["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. +from petstore_api import signing +import datetime + +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.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 +async 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 + await api_instance.add_pet(pet) + except Exception 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 | +|-------------|-------------|------------------| +**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 +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. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# 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.PetApi(api_client) + pet_id = 56 # int | Pet id to delete + api_key = 'api_key_example' # str | (optional) + + try: + # Deletes a pet + await api_instance.delete_pet(pet_id, api_key=api_key) + except Exception 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 +import petstore_api +from petstore_api.models.pet import Pet +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. + +configuration.access_token = os.environ["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. +from petstore_api import signing +import datetime + +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.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 +async 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 = await api_instance.find_pets_by_status(status) + print("The response of PetApi->find_pets_by_status:\n") + pprint(api_response) + except Exception 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_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** +> 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 +import petstore_api +from petstore_api.models.pet import Pet +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. + +configuration.access_token = os.environ["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. +from petstore_api import signing +import datetime + +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.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 +async 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 = await api_instance.find_pets_by_tags(tags) + print("The response of PetApi->find_pets_by_tags:\n") + pprint(api_response) + except Exception 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_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 petstore_api +from petstore_api.models.pet import Pet +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'] = os.environ["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 +async 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 = await api_instance.get_pet_by_id(pet_id) + print("The response of PetApi->get_pet_by_id:\n") + pprint(api_response) + except Exception 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 petstore_api +from petstore_api.models.pet import Pet +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. + +configuration.access_token = os.environ["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. +from petstore_api import signing +import datetime + +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.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 +async 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 + await api_instance.update_pet(pet) + except Exception 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 | +|-------------|-------------|------------------| +**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 +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. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# 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.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 + await api_instance.update_pet_with_form(pet_id, name=name, status=status) + except Exception 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** +> ModelApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) + +uploads an image + + + +### Example + +* OAuth Authentication (petstore_auth): + +```python +import petstore_api +from petstore_api.models.model_api_response import ModelApiResponse +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. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# 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.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 = None # bytearray | file to upload (optional) + + try: + # uploads an image + api_response = await api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + print("The response of PetApi->upload_file:\n") + pprint(api_response) + except Exception 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** | **bytearray**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.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** +> ModelApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + +uploads an image (required) + + + +### Example + +* OAuth Authentication (petstore_auth): + +```python +import petstore_api +from petstore_api.models.model_api_response import ModelApiResponse +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. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# 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.PetApi(api_client) + pet_id = 56 # int | ID of pet to update + required_file = None # bytearray | file to upload + additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) + + try: + # uploads an image (required) + api_response = await api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + print("The response of PetApi->upload_file_with_required_file:\n") + pprint(api_response) + except Exception 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** | **bytearray**| file to upload | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.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-httpx/docs/Pig.md b/samples/openapi3/client/petstore/python-httpx/docs/Pig.md new file mode 100644 index 00000000000..62593067608 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Pig.md @@ -0,0 +1,31 @@ +# Pig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | +**size** | **int** | | + +## Example + +```python +from petstore_api.models.pig import Pig + +# TODO update the JSON string below +json = "{}" +# create an instance of Pig from a JSON string +pig_instance = Pig.from_json(json) +# print the JSON string representation of the object +print(Pig.to_json()) + +# convert the object into a dict +pig_dict = pig_instance.to_dict() +# create an instance of Pig from a dict +pig_from_dict = Pig.from_dict(pig_dict) +``` +[[Back to Model list]](../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-httpx/docs/PonySizes.md b/samples/openapi3/client/petstore/python-httpx/docs/PonySizes.md new file mode 100644 index 00000000000..ced44c87206 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/PonySizes.md @@ -0,0 +1,29 @@ +# PonySizes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**Type**](Type.md) | | [optional] + +## Example + +```python +from petstore_api.models.pony_sizes import PonySizes + +# TODO update the JSON string below +json = "{}" +# create an instance of PonySizes from a JSON string +pony_sizes_instance = PonySizes.from_json(json) +# print the JSON string representation of the object +print(PonySizes.to_json()) + +# convert the object into a dict +pony_sizes_dict = pony_sizes_instance.to_dict() +# create an instance of PonySizes from a dict +pony_sizes_from_dict = PonySizes.from_dict(pony_sizes_dict) +``` +[[Back to Model list]](../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-httpx/docs/PoopCleaning.md b/samples/openapi3/client/petstore/python-httpx/docs/PoopCleaning.md new file mode 100644 index 00000000000..8f9c25e0831 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/PoopCleaning.md @@ -0,0 +1,31 @@ +# PoopCleaning + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_name** | **str** | | +**function_name** | **str** | | +**content** | **str** | | + +## Example + +```python +from petstore_api.models.poop_cleaning import PoopCleaning + +# TODO update the JSON string below +json = "{}" +# create an instance of PoopCleaning from a JSON string +poop_cleaning_instance = PoopCleaning.from_json(json) +# print the JSON string representation of the object +print(PoopCleaning.to_json()) + +# convert the object into a dict +poop_cleaning_dict = poop_cleaning_instance.to_dict() +# create an instance of PoopCleaning from a dict +poop_cleaning_from_dict = PoopCleaning.from_dict(poop_cleaning_dict) +``` +[[Back to Model list]](../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-httpx/docs/PrimitiveString.md b/samples/openapi3/client/petstore/python-httpx/docs/PrimitiveString.md new file mode 100644 index 00000000000..85ceb632e16 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/PrimitiveString.md @@ -0,0 +1,29 @@ +# PrimitiveString + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.primitive_string import PrimitiveString + +# TODO update the JSON string below +json = "{}" +# create an instance of PrimitiveString from a JSON string +primitive_string_instance = PrimitiveString.from_json(json) +# print the JSON string representation of the object +print(PrimitiveString.to_json()) + +# convert the object into a dict +primitive_string_dict = primitive_string_instance.to_dict() +# create an instance of PrimitiveString from a dict +primitive_string_from_dict = PrimitiveString.from_dict(primitive_string_dict) +``` +[[Back to Model list]](../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-httpx/docs/PropertyMap.md b/samples/openapi3/client/petstore/python-httpx/docs/PropertyMap.md new file mode 100644 index 00000000000..a55a0e5c6f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/PropertyMap.md @@ -0,0 +1,29 @@ +# PropertyMap + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_data** | [**Dict[str, Tag]**](Tag.md) | | [optional] + +## Example + +```python +from petstore_api.models.property_map import PropertyMap + +# TODO update the JSON string below +json = "{}" +# create an instance of PropertyMap from a JSON string +property_map_instance = PropertyMap.from_json(json) +# print the JSON string representation of the object +print(PropertyMap.to_json()) + +# convert the object into a dict +property_map_dict = property_map_instance.to_dict() +# create an instance of PropertyMap from a dict +property_map_from_dict = PropertyMap.from_dict(property_map_dict) +``` +[[Back to Model list]](../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-httpx/docs/PropertyNameCollision.md b/samples/openapi3/client/petstore/python-httpx/docs/PropertyNameCollision.md new file mode 100644 index 00000000000..40c233670dd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/PropertyNameCollision.md @@ -0,0 +1,31 @@ +# PropertyNameCollision + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underscore_type** | **str** | | [optional] +**type** | **str** | | [optional] +**type_with_underscore** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.property_name_collision import PropertyNameCollision + +# TODO update the JSON string below +json = "{}" +# create an instance of PropertyNameCollision from a JSON string +property_name_collision_instance = PropertyNameCollision.from_json(json) +# print the JSON string representation of the object +print(PropertyNameCollision.to_json()) + +# convert the object into a dict +property_name_collision_dict = property_name_collision_instance.to_dict() +# create an instance of PropertyNameCollision from a dict +property_name_collision_from_dict = PropertyNameCollision.from_dict(property_name_collision_dict) +``` +[[Back to Model list]](../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-httpx/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-httpx/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..686ec5da41c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/ReadOnlyFirst.md @@ -0,0 +1,30 @@ +# ReadOnlyFirst + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.read_only_first import ReadOnlyFirst + +# TODO update the JSON string below +json = "{}" +# create an instance of ReadOnlyFirst from a JSON string +read_only_first_instance = ReadOnlyFirst.from_json(json) +# print the JSON string representation of the object +print(ReadOnlyFirst.to_json()) + +# convert the object into a dict +read_only_first_dict = read_only_first_instance.to_dict() +# create an instance of ReadOnlyFirst from a dict +read_only_first_from_dict = ReadOnlyFirst.from_dict(read_only_first_dict) +``` +[[Back to Model list]](../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-httpx/docs/SecondCircularAllOfRef.md b/samples/openapi3/client/petstore/python-httpx/docs/SecondCircularAllOfRef.md new file mode 100644 index 00000000000..65ebdd4c7e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SecondCircularAllOfRef.md @@ -0,0 +1,30 @@ +# SecondCircularAllOfRef + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**circular_all_of_ref** | [**List[CircularAllOfRef]**](CircularAllOfRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef + +# TODO update the JSON string below +json = "{}" +# create an instance of SecondCircularAllOfRef from a JSON string +second_circular_all_of_ref_instance = SecondCircularAllOfRef.from_json(json) +# print the JSON string representation of the object +print(SecondCircularAllOfRef.to_json()) + +# convert the object into a dict +second_circular_all_of_ref_dict = second_circular_all_of_ref_instance.to_dict() +# create an instance of SecondCircularAllOfRef from a dict +second_circular_all_of_ref_from_dict = SecondCircularAllOfRef.from_dict(second_circular_all_of_ref_dict) +``` +[[Back to Model list]](../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-httpx/docs/SecondRef.md b/samples/openapi3/client/petstore/python-httpx/docs/SecondRef.md new file mode 100644 index 00000000000..dfb1a0ac6db --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SecondRef.md @@ -0,0 +1,30 @@ +# SecondRef + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**circular_ref** | [**CircularReferenceModel**](CircularReferenceModel.md) | | [optional] + +## Example + +```python +from petstore_api.models.second_ref import SecondRef + +# TODO update the JSON string below +json = "{}" +# create an instance of SecondRef from a JSON string +second_ref_instance = SecondRef.from_json(json) +# print the JSON string representation of the object +print(SecondRef.to_json()) + +# convert the object into a dict +second_ref_dict = second_ref_instance.to_dict() +# create an instance of SecondRef from a dict +second_ref_from_dict = SecondRef.from_dict(second_ref_dict) +``` +[[Back to Model list]](../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-httpx/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-httpx/docs/SelfReferenceModel.md new file mode 100644 index 00000000000..208cdac04b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SelfReferenceModel.md @@ -0,0 +1,30 @@ +# SelfReferenceModel + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | [optional] +**nested** | [**DummyModel**](DummyModel.md) | | [optional] + +## Example + +```python +from petstore_api.models.self_reference_model import SelfReferenceModel + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfReferenceModel from a JSON string +self_reference_model_instance = SelfReferenceModel.from_json(json) +# print the JSON string representation of the object +print(SelfReferenceModel.to_json()) + +# convert the object into a dict +self_reference_model_dict = self_reference_model_instance.to_dict() +# create an instance of SelfReferenceModel from a dict +self_reference_model_from_dict = SelfReferenceModel.from_dict(self_reference_model_dict) +``` +[[Back to Model list]](../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-httpx/docs/SingleRefType.md b/samples/openapi3/client/petstore/python-httpx/docs/SingleRefType.md new file mode 100644 index 00000000000..8f0f60e5678 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SingleRefType.md @@ -0,0 +1,12 @@ +# SingleRefType + + +## Enum + +* `ADMIN` (value: `'admin'`) + +* `USER` (value: `'user'`) + +[[Back to Model list]](../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-httpx/docs/SpecialCharacterEnum.md b/samples/openapi3/client/petstore/python-httpx/docs/SpecialCharacterEnum.md new file mode 100644 index 00000000000..71a3affc4fe --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SpecialCharacterEnum.md @@ -0,0 +1,28 @@ +# SpecialCharacterEnum + + +## Enum + +* `ENUM_456` (value: `'456'`) + +* `ENUM_123ABC` (value: `'123abc'`) + +* `UNDERSCORE` (value: `'_'`) + +* `SPACE` (value: `' '`) + +* `AMPERSAND` (value: `'&'`) + +* `DOLLAR` (value: `'$'`) + +* `GREATER_THAN_EQUAL` (value: `'>='`) + +* `THIS_IS_EXCLAMATION` (value: `'this_is_!'`) + +* `IMPORT` (value: `'import'`) + +* `HELLO_WORLD` (value: `' hello world '`) + +[[Back to Model list]](../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-httpx/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-httpx/docs/SpecialModelName.md new file mode 100644 index 00000000000..35303f34efd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SpecialModelName.md @@ -0,0 +1,29 @@ +# SpecialModelName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +## Example + +```python +from petstore_api.models.special_model_name import SpecialModelName + +# TODO update the JSON string below +json = "{}" +# create an instance of SpecialModelName from a JSON string +special_model_name_instance = SpecialModelName.from_json(json) +# print the JSON string representation of the object +print(SpecialModelName.to_json()) + +# convert the object into a dict +special_model_name_dict = special_model_name_instance.to_dict() +# create an instance of SpecialModelName from a dict +special_model_name_from_dict = SpecialModelName.from_dict(special_model_name_dict) +``` +[[Back to Model list]](../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-httpx/docs/SpecialName.md b/samples/openapi3/client/petstore/python-httpx/docs/SpecialName.md new file mode 100644 index 00000000000..ccc550b16e3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/SpecialName.md @@ -0,0 +1,31 @@ +# SpecialName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_property** | **int** | | [optional] +**var_async** | [**Category**](Category.md) | | [optional] +**var_schema** | **str** | pet status in the store | [optional] + +## Example + +```python +from petstore_api.models.special_name import SpecialName + +# TODO update the JSON string below +json = "{}" +# create an instance of SpecialName from a JSON string +special_name_instance = SpecialName.from_json(json) +# print the JSON string representation of the object +print(SpecialName.to_json()) + +# convert the object into a dict +special_name_dict = special_name_instance.to_dict() +# create an instance of SpecialName from a dict +special_name_from_dict = SpecialName.from_dict(special_name_dict) +``` +[[Back to Model list]](../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-httpx/docs/StoreApi.md b/samples/openapi3/client/petstore/python-httpx/docs/StoreApi.md new file mode 100644 index 00000000000..27f240911fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/StoreApi.md @@ -0,0 +1,291 @@ +# 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 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.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted + + try: + # Delete purchase order by ID + await api_instance.delete_order(order_id) + except Exception 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 +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'] = os.environ["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 +async 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 = await api_instance.get_inventory() + print("The response of StoreApi->get_inventory:\n") + pprint(api_response) + except Exception 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 generated exceptions + +### Example + + +```python +import petstore_api +from petstore_api.models.order import Order +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.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched + + try: + # Find purchase order by ID + api_response = await api_instance.get_order_by_id(order_id) + print("The response of StoreApi->get_order_by_id:\n") + pprint(api_response) + except Exception 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 petstore_api +from petstore_api.models.order import Order +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.StoreApi(api_client) + order = petstore_api.Order() # Order | order placed for purchasing the pet + + try: + # Place an order for a pet + api_response = await api_instance.place_order(order) + print("The response of StoreApi->place_order:\n") + pprint(api_response) + except Exception 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-httpx/docs/Tag.md b/samples/openapi3/client/petstore/python-httpx/docs/Tag.md new file mode 100644 index 00000000000..4106d9cfe5d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Tag.md @@ -0,0 +1,30 @@ +# Tag + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.tag import Tag + +# TODO update the JSON string below +json = "{}" +# create an instance of Tag from a JSON string +tag_instance = Tag.from_json(json) +# print the JSON string representation of the object +print(Tag.to_json()) + +# convert the object into a dict +tag_dict = tag_instance.to_dict() +# create an instance of Tag from a dict +tag_from_dict = Tag.from_dict(tag_dict) +``` +[[Back to Model list]](../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-httpx/docs/Task.md b/samples/openapi3/client/petstore/python-httpx/docs/Task.md new file mode 100644 index 00000000000..211ce76cdfe --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Task.md @@ -0,0 +1,31 @@ +# Task + +Used to test oneOf enums with only one string value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**activity** | [**TaskActivity**](TaskActivity.md) | | + +## Example + +```python +from petstore_api.models.task import Task + +# TODO update the JSON string below +json = "{}" +# create an instance of Task from a JSON string +task_instance = Task.from_json(json) +# print the JSON string representation of the object +print(Task.to_json()) + +# convert the object into a dict +task_dict = task_instance.to_dict() +# create an instance of Task from a dict +task_from_dict = Task.from_dict(task_dict) +``` +[[Back to Model list]](../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-httpx/docs/TaskActivity.md b/samples/openapi3/client/petstore/python-httpx/docs/TaskActivity.md new file mode 100644 index 00000000000..e905a477292 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TaskActivity.md @@ -0,0 +1,31 @@ +# TaskActivity + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_name** | **str** | | +**function_name** | **str** | | +**content** | **str** | | + +## Example + +```python +from petstore_api.models.task_activity import TaskActivity + +# TODO update the JSON string below +json = "{}" +# create an instance of TaskActivity from a JSON string +task_activity_instance = TaskActivity.from_json(json) +# print the JSON string representation of the object +print(TaskActivity.to_json()) + +# convert the object into a dict +task_activity_dict = task_activity_instance.to_dict() +# create an instance of TaskActivity from a dict +task_activity_from_dict = TaskActivity.from_dict(task_activity_dict) +``` +[[Back to Model list]](../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-httpx/docs/TestEnum.md b/samples/openapi3/client/petstore/python-httpx/docs/TestEnum.md new file mode 100644 index 00000000000..612b62bd4dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestEnum.md @@ -0,0 +1,16 @@ +# TestEnum + + +## Enum + +* `ONE` (value: `'ONE'`) + +* `TWO` (value: `'TWO'`) + +* `THREE` (value: `'THREE'`) + +* `FOUR` (value: `'foUr'`) + +[[Back to Model list]](../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-httpx/docs/TestEnumWithDefault.md b/samples/openapi3/client/petstore/python-httpx/docs/TestEnumWithDefault.md new file mode 100644 index 00000000000..ac8591c95c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestEnumWithDefault.md @@ -0,0 +1,14 @@ +# TestEnumWithDefault + + +## Enum + +* `EIN` (value: `'EIN'`) + +* `ZWEI` (value: `'ZWEI'`) + +* `DREI` (value: `'DREI'`) + +[[Back to Model list]](../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-httpx/docs/TestErrorResponsesWithModel400Response.md b/samples/openapi3/client/petstore/python-httpx/docs/TestErrorResponsesWithModel400Response.md new file mode 100644 index 00000000000..be416bbad0f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestErrorResponsesWithModel400Response.md @@ -0,0 +1,29 @@ +# TestErrorResponsesWithModel400Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reason400** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response + +# TODO update the JSON string below +json = "{}" +# create an instance of TestErrorResponsesWithModel400Response from a JSON string +test_error_responses_with_model400_response_instance = TestErrorResponsesWithModel400Response.from_json(json) +# print the JSON string representation of the object +print(TestErrorResponsesWithModel400Response.to_json()) + +# convert the object into a dict +test_error_responses_with_model400_response_dict = test_error_responses_with_model400_response_instance.to_dict() +# create an instance of TestErrorResponsesWithModel400Response from a dict +test_error_responses_with_model400_response_from_dict = TestErrorResponsesWithModel400Response.from_dict(test_error_responses_with_model400_response_dict) +``` +[[Back to Model list]](../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-httpx/docs/TestErrorResponsesWithModel404Response.md b/samples/openapi3/client/petstore/python-httpx/docs/TestErrorResponsesWithModel404Response.md new file mode 100644 index 00000000000..1c984f847bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestErrorResponsesWithModel404Response.md @@ -0,0 +1,29 @@ +# TestErrorResponsesWithModel404Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reason404** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response + +# TODO update the JSON string below +json = "{}" +# create an instance of TestErrorResponsesWithModel404Response from a JSON string +test_error_responses_with_model404_response_instance = TestErrorResponsesWithModel404Response.from_json(json) +# print the JSON string representation of the object +print(TestErrorResponsesWithModel404Response.to_json()) + +# convert the object into a dict +test_error_responses_with_model404_response_dict = test_error_responses_with_model404_response_instance.to_dict() +# create an instance of TestErrorResponsesWithModel404Response from a dict +test_error_responses_with_model404_response_from_dict = TestErrorResponsesWithModel404Response.from_dict(test_error_responses_with_model404_response_dict) +``` +[[Back to Model list]](../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-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..511132d689b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,29 @@ +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**some_property** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string +test_inline_freeform_additional_properties_request_instance = TestInlineFreeformAdditionalPropertiesRequest.from_json(json) +# print the JSON string representation of the object +print(TestInlineFreeformAdditionalPropertiesRequest.to_json()) + +# convert the object into a dict +test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() +# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict +test_inline_freeform_additional_properties_request_from_dict = TestInlineFreeformAdditionalPropertiesRequest.from_dict(test_inline_freeform_additional_properties_request_dict) +``` +[[Back to Model list]](../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-httpx/docs/TestModelWithEnumDefault.md b/samples/openapi3/client/petstore/python-httpx/docs/TestModelWithEnumDefault.md new file mode 100644 index 00000000000..7d46e86deba --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestModelWithEnumDefault.md @@ -0,0 +1,33 @@ +# TestModelWithEnumDefault + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_enum** | [**TestEnum**](TestEnum.md) | | +**test_string** | **str** | | [optional] +**test_enum_with_default** | [**TestEnumWithDefault**](TestEnumWithDefault.md) | | [optional] [default to TestEnumWithDefault.ZWEI] +**test_string_with_default** | **str** | | [optional] [default to 'ahoy matey'] +**test_inline_defined_enum_with_default** | **str** | | [optional] [default to 'B'] + +## Example + +```python +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault + +# TODO update the JSON string below +json = "{}" +# create an instance of TestModelWithEnumDefault from a JSON string +test_model_with_enum_default_instance = TestModelWithEnumDefault.from_json(json) +# print the JSON string representation of the object +print(TestModelWithEnumDefault.to_json()) + +# convert the object into a dict +test_model_with_enum_default_dict = test_model_with_enum_default_instance.to_dict() +# create an instance of TestModelWithEnumDefault from a dict +test_model_with_enum_default_from_dict = TestModelWithEnumDefault.from_dict(test_model_with_enum_default_dict) +``` +[[Back to Model list]](../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-httpx/docs/TestObjectForMultipartRequestsRequestMarker.md b/samples/openapi3/client/petstore/python-httpx/docs/TestObjectForMultipartRequestsRequestMarker.md new file mode 100644 index 00000000000..ff0ca9ee00a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/TestObjectForMultipartRequestsRequestMarker.md @@ -0,0 +1,29 @@ +# TestObjectForMultipartRequestsRequestMarker + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker + +# TODO update the JSON string below +json = "{}" +# create an instance of TestObjectForMultipartRequestsRequestMarker from a JSON string +test_object_for_multipart_requests_request_marker_instance = TestObjectForMultipartRequestsRequestMarker.from_json(json) +# print the JSON string representation of the object +print(TestObjectForMultipartRequestsRequestMarker.to_json()) + +# convert the object into a dict +test_object_for_multipart_requests_request_marker_dict = test_object_for_multipart_requests_request_marker_instance.to_dict() +# create an instance of TestObjectForMultipartRequestsRequestMarker from a dict +test_object_for_multipart_requests_request_marker_from_dict = TestObjectForMultipartRequestsRequestMarker.from_dict(test_object_for_multipart_requests_request_marker_dict) +``` +[[Back to Model list]](../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-httpx/docs/Tiger.md b/samples/openapi3/client/petstore/python-httpx/docs/Tiger.md new file mode 100644 index 00000000000..f1cf2133f0f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Tiger.md @@ -0,0 +1,29 @@ +# Tiger + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skill** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.tiger import Tiger + +# TODO update the JSON string below +json = "{}" +# create an instance of Tiger from a JSON string +tiger_instance = Tiger.from_json(json) +# print the JSON string representation of the object +print(Tiger.to_json()) + +# convert the object into a dict +tiger_dict = tiger_instance.to_dict() +# create an instance of Tiger from a dict +tiger_from_dict = Tiger.from_dict(tiger_dict) +``` +[[Back to Model list]](../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-httpx/docs/Type.md b/samples/openapi3/client/petstore/python-httpx/docs/Type.md new file mode 100644 index 00000000000..f7ff2903a72 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/Type.md @@ -0,0 +1,16 @@ +# Type + + +## Enum + +* `NUMBER_2_DOT_0` (value: `2.0`) + +* `NUMBER_1_DOT_0` (value: `1.0`) + +* `NUMBER_0_DOT_5` (value: `0.5`) + +* `NUMBER_0_DOT_25` (value: `0.25`) + +[[Back to Model list]](../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-httpx/docs/UnnamedDictWithAdditionalModelListProperties.md b/samples/openapi3/client/petstore/python-httpx/docs/UnnamedDictWithAdditionalModelListProperties.md new file mode 100644 index 00000000000..68cd00ab0a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/UnnamedDictWithAdditionalModelListProperties.md @@ -0,0 +1,29 @@ +# UnnamedDictWithAdditionalModelListProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dict_property** | **Dict[str, List[CreatureInfo]]** | | [optional] + +## Example + +```python +from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties + +# TODO update the JSON string below +json = "{}" +# create an instance of UnnamedDictWithAdditionalModelListProperties from a JSON string +unnamed_dict_with_additional_model_list_properties_instance = UnnamedDictWithAdditionalModelListProperties.from_json(json) +# print the JSON string representation of the object +print(UnnamedDictWithAdditionalModelListProperties.to_json()) + +# convert the object into a dict +unnamed_dict_with_additional_model_list_properties_dict = unnamed_dict_with_additional_model_list_properties_instance.to_dict() +# create an instance of UnnamedDictWithAdditionalModelListProperties from a dict +unnamed_dict_with_additional_model_list_properties_from_dict = UnnamedDictWithAdditionalModelListProperties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) +``` +[[Back to Model list]](../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-httpx/docs/UnnamedDictWithAdditionalStringListProperties.md b/samples/openapi3/client/petstore/python-httpx/docs/UnnamedDictWithAdditionalStringListProperties.md new file mode 100644 index 00000000000..045b0e22ad0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/UnnamedDictWithAdditionalStringListProperties.md @@ -0,0 +1,29 @@ +# UnnamedDictWithAdditionalStringListProperties + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dict_property** | **Dict[str, List[str]]** | | [optional] + +## Example + +```python +from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties + +# TODO update the JSON string below +json = "{}" +# create an instance of UnnamedDictWithAdditionalStringListProperties from a JSON string +unnamed_dict_with_additional_string_list_properties_instance = UnnamedDictWithAdditionalStringListProperties.from_json(json) +# print the JSON string representation of the object +print(UnnamedDictWithAdditionalStringListProperties.to_json()) + +# convert the object into a dict +unnamed_dict_with_additional_string_list_properties_dict = unnamed_dict_with_additional_string_list_properties_instance.to_dict() +# create an instance of UnnamedDictWithAdditionalStringListProperties from a dict +unnamed_dict_with_additional_string_list_properties_from_dict = UnnamedDictWithAdditionalStringListProperties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) +``` +[[Back to Model list]](../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-httpx/docs/UploadFileWithAdditionalPropertiesRequestObject.md b/samples/openapi3/client/petstore/python-httpx/docs/UploadFileWithAdditionalPropertiesRequestObject.md new file mode 100644 index 00000000000..14102778037 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/UploadFileWithAdditionalPropertiesRequestObject.md @@ -0,0 +1,30 @@ +# UploadFileWithAdditionalPropertiesRequestObject + +Additional object + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject + +# TODO update the JSON string below +json = "{}" +# create an instance of UploadFileWithAdditionalPropertiesRequestObject from a JSON string +upload_file_with_additional_properties_request_object_instance = UploadFileWithAdditionalPropertiesRequestObject.from_json(json) +# print the JSON string representation of the object +print(UploadFileWithAdditionalPropertiesRequestObject.to_json()) + +# convert the object into a dict +upload_file_with_additional_properties_request_object_dict = upload_file_with_additional_properties_request_object_instance.to_dict() +# create an instance of UploadFileWithAdditionalPropertiesRequestObject from a dict +upload_file_with_additional_properties_request_object_from_dict = UploadFileWithAdditionalPropertiesRequestObject.from_dict(upload_file_with_additional_properties_request_object_dict) +``` +[[Back to Model list]](../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-httpx/docs/User.md b/samples/openapi3/client/petstore/python-httpx/docs/User.md new file mode 100644 index 00000000000..c45d26d2704 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/User.md @@ -0,0 +1,36 @@ +# 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] + +## Example + +```python +from petstore_api.models.user import User + +# TODO update the JSON string below +json = "{}" +# create an instance of User from a JSON string +user_instance = User.from_json(json) +# print the JSON string representation of the object +print(User.to_json()) + +# convert the object into a dict +user_dict = user_instance.to_dict() +# create an instance of User from a dict +user_from_dict = User.from_dict(user_dict) +``` +[[Back to Model list]](../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-httpx/docs/UserApi.md b/samples/openapi3/client/petstore/python-httpx/docs/UserApi.md new file mode 100644 index 00000000000..5bb4ccfdf22 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/UserApi.md @@ -0,0 +1,550 @@ +# 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 petstore_api +from petstore_api.models.user import User +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.UserApi(api_client) + user = petstore_api.User() # User | Created user object + + try: + # Create user + await api_instance.create_user(user) + except Exception 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 petstore_api +from petstore_api.models.user import User +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.UserApi(api_client) + user = [petstore_api.User()] # List[User] | List of user object + + try: + # Creates list of users with given input array + await api_instance.create_users_with_array_input(user) + except Exception 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 +import petstore_api +from petstore_api.models.user import User +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.UserApi(api_client) + user = [petstore_api.User()] # List[User] | List of user object + + try: + # Creates list of users with given input array + await api_instance.create_users_with_list_input(user) + except Exception 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 +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.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted + + try: + # Delete user + await api_instance.delete_user(username) + except Exception 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 petstore_api +from petstore_api.models.user import User +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.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 = await api_instance.get_user_by_name(username) + print("The response of UserApi->get_user_by_name:\n") + pprint(api_response) + except Exception 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 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.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 = await api_instance.login_user(username, password) + print("The response of UserApi->login_user:\n") + pprint(api_response) + except Exception 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 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.UserApi(api_client) + + try: + # Logs out current logged in user session + await api_instance.logout_user() + except Exception 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 petstore_api +from petstore_api.models.user import User +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.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted + user = petstore_api.User() # User | Updated user object + + try: + # Updated user + await api_instance.update_user(username, user) + except Exception 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-httpx/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-httpx/docs/WithNestedOneOf.md new file mode 100644 index 00000000000..e7bbbc28fc2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/docs/WithNestedOneOf.md @@ -0,0 +1,31 @@ +# WithNestedOneOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | [optional] +**nested_pig** | [**Pig**](Pig.md) | | [optional] +**nested_oneof_enum_string** | [**OneOfEnumString**](OneOfEnumString.md) | | [optional] + +## Example + +```python +from petstore_api.models.with_nested_one_of import WithNestedOneOf + +# TODO update the JSON string below +json = "{}" +# create an instance of WithNestedOneOf from a JSON string +with_nested_one_of_instance = WithNestedOneOf.from_json(json) +# print the JSON string representation of the object +print(WithNestedOneOf.to_json()) + +# convert the object into a dict +with_nested_one_of_dict = with_nested_one_of_instance.to_dict() +# create an instance of WithNestedOneOf from a dict +with_nested_one_of_from_dict = WithNestedOneOf.from_dict(with_nested_one_of_dict) +``` +[[Back to Model list]](../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-httpx/git_push.sh b/samples/openapi3/client/petstore/python-httpx/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/git_push.sh @@ -0,0 +1,57 @@ +#!/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-httpx/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/__init__.py new file mode 100644 index 00000000000..278f6dfecf4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/__init__.py @@ -0,0 +1,288 @@ +# 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: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# Define package exports +__all__ = [ + "AnotherFakeApi", + "DefaultApi", + "FakeApi", + "FakeClassnameTags123Api", + "ImportTestDatetimeApi", + "PetApi", + "StoreApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "HttpSigningConfiguration", + "AdditionalPropertiesAnyType", + "AdditionalPropertiesClass", + "AdditionalPropertiesObject", + "AdditionalPropertiesWithDescriptionOnly", + "AllOfSuperModel", + "AllOfWithSingleRef", + "Animal", + "AnyOfColor", + "AnyOfPig", + "ArrayOfArrayOfModel", + "ArrayOfArrayOfNumberOnly", + "ArrayOfNumberOnly", + "ArrayTest", + "BaseDiscriminator", + "BasquePig", + "Bathing", + "Capitalization", + "Cat", + "Category", + "CircularAllOfRef", + "CircularReferenceModel", + "ClassModel", + "Client", + "Color", + "Creature", + "CreatureInfo", + "DanishPig", + "DataOutputFormat", + "DeprecatedObject", + "DiscriminatorAllOfSub", + "DiscriminatorAllOfSuper", + "Dog", + "DummyModel", + "EnumArrays", + "EnumClass", + "EnumNumberVendorExt", + "EnumRefWithDefaultValue", + "EnumString1", + "EnumString2", + "EnumStringVendorExt", + "EnumTest", + "Feeding", + "File", + "FileSchemaTestClass", + "FirstRef", + "Foo", + "FooGetDefaultResponse", + "FormatTest", + "HasOnlyReadOnly", + "HealthCheckResult", + "HuntingDog", + "Info", + "InnerDictWithProperty", + "InputAllOf", + "IntOrString", + "ListClass", + "MapOfArrayOfModel", + "MapTest", + "MixedPropertiesAndAdditionalPropertiesClass", + "Model200Response", + "ModelApiResponse", + "ModelField", + "ModelReturn", + "MultiArrays", + "Name", + "NullableClass", + "NullableProperty", + "NumberOnly", + "ObjectToTestAdditionalProperties", + "ObjectWithDeprecatedFields", + "OneOfEnumString", + "Order", + "OuterComposite", + "OuterEnum", + "OuterEnumDefaultValue", + "OuterEnumInteger", + "OuterEnumIntegerDefaultValue", + "OuterObjectWithEnumProperty", + "Parent", + "ParentWithOptionalDict", + "Pet", + "Pig", + "PonySizes", + "PoopCleaning", + "PrimitiveString", + "PropertyMap", + "PropertyNameCollision", + "ReadOnlyFirst", + "SecondCircularAllOfRef", + "SecondRef", + "SelfReferenceModel", + "SingleRefType", + "SpecialCharacterEnum", + "SpecialModelName", + "SpecialName", + "Tag", + "Task", + "TaskActivity", + "TestEnum", + "TestEnumWithDefault", + "TestErrorResponsesWithModel400Response", + "TestErrorResponsesWithModel404Response", + "TestInlineFreeformAdditionalPropertiesRequest", + "TestModelWithEnumDefault", + "TestObjectForMultipartRequestsRequestMarker", + "Tiger", + "Type", + "UnnamedDictWithAdditionalModelListProperties", + "UnnamedDictWithAdditionalStringListProperties", + "UploadFileWithAdditionalPropertiesRequestObject", + "User", + "WithNestedOneOf", +] + +# import apis into sdk package +from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi +from petstore_api.api.default_api import DefaultApi as DefaultApi +from petstore_api.api.fake_api import FakeApi as FakeApi +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api as FakeClassnameTags123Api +from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi as ImportTestDatetimeApi +from petstore_api.api.pet_api import PetApi as PetApi +from petstore_api.api.store_api import StoreApi as StoreApi +from petstore_api.api.user_api import UserApi as UserApi + +# import ApiClient +from petstore_api.api_response import ApiResponse as ApiResponse +from petstore_api.api_client import ApiClient as ApiClient +from petstore_api.configuration import Configuration as Configuration +from petstore_api.exceptions import OpenApiException as OpenApiException +from petstore_api.exceptions import ApiTypeError as ApiTypeError +from petstore_api.exceptions import ApiValueError as ApiValueError +from petstore_api.exceptions import ApiKeyError as ApiKeyError +from petstore_api.exceptions import ApiAttributeError as ApiAttributeError +from petstore_api.exceptions import ApiException as ApiException +from petstore_api.signing import HttpSigningConfiguration as HttpSigningConfiguration + +# import models into sdk package +from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType as AdditionalPropertiesAnyType +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass as AdditionalPropertiesClass +from petstore_api.models.additional_properties_object import AdditionalPropertiesObject as AdditionalPropertiesObject +from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly as AdditionalPropertiesWithDescriptionOnly +from petstore_api.models.all_of_super_model import AllOfSuperModel as AllOfSuperModel +from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef as AllOfWithSingleRef +from petstore_api.models.animal import Animal as Animal +from petstore_api.models.any_of_color import AnyOfColor as AnyOfColor +from petstore_api.models.any_of_pig import AnyOfPig as AnyOfPig +from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel as ArrayOfArrayOfModel +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly as ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly as ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest as ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator as BaseDiscriminator +from petstore_api.models.basque_pig import BasquePig as BasquePig +from petstore_api.models.bathing import Bathing as Bathing +from petstore_api.models.capitalization import Capitalization as Capitalization +from petstore_api.models.cat import Cat as Cat +from petstore_api.models.category import Category as Category +from petstore_api.models.circular_all_of_ref import CircularAllOfRef as CircularAllOfRef +from petstore_api.models.circular_reference_model import CircularReferenceModel as CircularReferenceModel +from petstore_api.models.class_model import ClassModel as ClassModel +from petstore_api.models.client import Client as Client +from petstore_api.models.color import Color as Color +from petstore_api.models.creature import Creature as Creature +from petstore_api.models.creature_info import CreatureInfo as CreatureInfo +from petstore_api.models.danish_pig import DanishPig as DanishPig +from petstore_api.models.data_output_format import DataOutputFormat as DataOutputFormat +from petstore_api.models.deprecated_object import DeprecatedObject as DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub as DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper as DiscriminatorAllOfSuper +from petstore_api.models.dog import Dog as Dog +from petstore_api.models.dummy_model import DummyModel as DummyModel +from petstore_api.models.enum_arrays import EnumArrays as EnumArrays +from petstore_api.models.enum_class import EnumClass as EnumClass +from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt as EnumNumberVendorExt +from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue as EnumRefWithDefaultValue +from petstore_api.models.enum_string1 import EnumString1 as EnumString1 +from petstore_api.models.enum_string2 import EnumString2 as EnumString2 +from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt as EnumStringVendorExt +from petstore_api.models.enum_test import EnumTest as EnumTest +from petstore_api.models.feeding import Feeding as Feeding +from petstore_api.models.file import File as File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass as FileSchemaTestClass +from petstore_api.models.first_ref import FirstRef as FirstRef +from petstore_api.models.foo import Foo as Foo +from petstore_api.models.foo_get_default_response import FooGetDefaultResponse as FooGetDefaultResponse +from petstore_api.models.format_test import FormatTest as FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly as HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult as HealthCheckResult +from petstore_api.models.hunting_dog import HuntingDog as HuntingDog +from petstore_api.models.info import Info as Info +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty as InnerDictWithProperty +from petstore_api.models.input_all_of import InputAllOf as InputAllOf +from petstore_api.models.int_or_string import IntOrString as IntOrString +from petstore_api.models.list_class import ListClass as ListClass +from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel as MapOfArrayOfModel +from petstore_api.models.map_test import MapTest as MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass as MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response as Model200Response +from petstore_api.models.model_api_response import ModelApiResponse as ModelApiResponse +from petstore_api.models.model_field import ModelField as ModelField +from petstore_api.models.model_return import ModelReturn as ModelReturn +from petstore_api.models.multi_arrays import MultiArrays as MultiArrays +from petstore_api.models.name import Name as Name +from petstore_api.models.nullable_class import NullableClass as NullableClass +from petstore_api.models.nullable_property import NullableProperty as NullableProperty +from petstore_api.models.number_only import NumberOnly as NumberOnly +from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties as ObjectToTestAdditionalProperties +from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields as ObjectWithDeprecatedFields +from petstore_api.models.one_of_enum_string import OneOfEnumString as OneOfEnumString +from petstore_api.models.order import Order as Order +from petstore_api.models.outer_composite import OuterComposite as OuterComposite +from petstore_api.models.outer_enum import OuterEnum as OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue as OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger as OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue as OuterEnumIntegerDefaultValue +from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty as OuterObjectWithEnumProperty +from petstore_api.models.parent import Parent as Parent +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict as ParentWithOptionalDict +from petstore_api.models.pet import Pet as Pet +from petstore_api.models.pig import Pig as Pig +from petstore_api.models.pony_sizes import PonySizes as PonySizes +from petstore_api.models.poop_cleaning import PoopCleaning as PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString as PrimitiveString +from petstore_api.models.property_map import PropertyMap as PropertyMap +from petstore_api.models.property_name_collision import PropertyNameCollision as PropertyNameCollision +from petstore_api.models.read_only_first import ReadOnlyFirst as ReadOnlyFirst +from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef as SecondCircularAllOfRef +from petstore_api.models.second_ref import SecondRef as SecondRef +from petstore_api.models.self_reference_model import SelfReferenceModel as SelfReferenceModel +from petstore_api.models.single_ref_type import SingleRefType as SingleRefType +from petstore_api.models.special_character_enum import SpecialCharacterEnum as SpecialCharacterEnum +from petstore_api.models.special_model_name import SpecialModelName as SpecialModelName +from petstore_api.models.special_name import SpecialName as SpecialName +from petstore_api.models.tag import Tag as Tag +from petstore_api.models.task import Task as Task +from petstore_api.models.task_activity import TaskActivity as TaskActivity +from petstore_api.models.test_enum import TestEnum as TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault as TestEnumWithDefault +from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response as TestErrorResponsesWithModel400Response +from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response as TestErrorResponsesWithModel404Response +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest as TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault as TestModelWithEnumDefault +from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker as TestObjectForMultipartRequestsRequestMarker +from petstore_api.models.tiger import Tiger as Tiger +from petstore_api.models.type import Type as Type +from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties as UnnamedDictWithAdditionalModelListProperties +from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties as UnnamedDictWithAdditionalStringListProperties +from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject as UploadFileWithAdditionalPropertiesRequestObject +from petstore_api.models.user import User as User +from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/__init__.py new file mode 100644 index 00000000000..79d2ab7dc93 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/__init__.py @@ -0,0 +1,12 @@ +# 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.import_test_datetime_api import ImportTestDatetimeApi +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-httpx/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/another_fake_api.py new file mode 100644 index 00000000000..b1d830a31ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/another_fake_api.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from petstore_api.models.client import Client + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class AnotherFakeApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def call_123_test_special_tags( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Client: + """To test special tags + + To test special tags and operation ID starting with number + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._call_123_test_special_tags_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def call_123_test_special_tags_with_http_info( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Client]: + """To test special tags + + To test special tags and operation ID starting with number + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._call_123_test_special_tags_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def call_123_test_special_tags_without_preload_content( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """To test special tags + + To test special tags and operation ID starting with number + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._call_123_test_special_tags_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _call_123_test_special_tags_serialize( + self, + client, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if client is not None: + _body_params = client + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/another-fake/dummy', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/default_api.py new file mode 100644 index 00000000000..bf2c62a53ae --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/default_api.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from petstore_api.models.foo_get_default_response import FooGetDefaultResponse + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class DefaultApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def foo_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FooGetDefaultResponse: + """foo_get + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._foo_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def foo_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FooGetDefaultResponse]: + """foo_get + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._foo_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def foo_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """foo_get + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._foo_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _foo_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/foo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_api.py new file mode 100644 index 00000000000..bafaa8698d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_api.py @@ -0,0 +1,10120 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import date, datetime +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from uuid import UUID +from petstore_api.models.client import Client +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.model_api_response import ModelApiResponse +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty +from petstore_api.models.pet import Pet +from petstore_api.models.tag import Tag +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker +from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject +from petstore_api.models.user import User + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class FakeApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def fake_any_type_request_body( + self, + body: Optional[Dict[str, Any]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test any type request body + + + :param body: + :type body: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_any_type_request_body_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_any_type_request_body_with_http_info( + self, + body: Optional[Dict[str, Any]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test any type request body + + + :param body: + :type body: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_any_type_request_body_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_any_type_request_body_without_preload_content( + self, + body: Optional[Dict[str, Any]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test any type request body + + + :param body: + :type body: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_any_type_request_body_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_any_type_request_body_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/any_type_body', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_enum_ref_query_parameter( + self, + enum_ref: Annotated[Optional[EnumClass], Field(description="enum reference")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test enum reference query parameter + + + :param enum_ref: enum reference + :type enum_ref: EnumClass + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_enum_ref_query_parameter_serialize( + enum_ref=enum_ref, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_enum_ref_query_parameter_with_http_info( + self, + enum_ref: Annotated[Optional[EnumClass], Field(description="enum reference")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test enum reference query parameter + + + :param enum_ref: enum reference + :type enum_ref: EnumClass + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_enum_ref_query_parameter_serialize( + enum_ref=enum_ref, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_enum_ref_query_parameter_without_preload_content( + self, + enum_ref: Annotated[Optional[EnumClass], Field(description="enum reference")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test enum reference query parameter + + + :param enum_ref: enum reference + :type enum_ref: EnumClass + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_enum_ref_query_parameter_serialize( + enum_ref=enum_ref, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_enum_ref_query_parameter_serialize( + self, + enum_ref, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if enum_ref is not None: + + _query_params.append(('enum_ref', enum_ref.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/enum_ref_query_parameter', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_health_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthCheckResult: + """Health check endpoint + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_health_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckResult", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_health_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthCheckResult]: + """Health check endpoint + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_health_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckResult", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_health_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Health check endpoint + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_health_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckResult", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_health_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/health', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_http_signature_test( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + query_1: Annotated[Optional[StrictStr], Field(description="query parameter")] = None, + header_1: Annotated[Optional[StrictStr], Field(description="header parameter")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test http signature authentication + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_http_signature_test_serialize( + pet=pet, + query_1=query_1, + header_1=header_1, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_http_signature_test_with_http_info( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + query_1: Annotated[Optional[StrictStr], Field(description="query parameter")] = None, + header_1: Annotated[Optional[StrictStr], Field(description="header parameter")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test http signature authentication + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_http_signature_test_serialize( + pet=pet, + query_1=query_1, + header_1=header_1, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_http_signature_test_without_preload_content( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + query_1: Annotated[Optional[StrictStr], Field(description="query parameter")] = None, + header_1: Annotated[Optional[StrictStr], Field(description="header parameter")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test http signature authentication + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_http_signature_test_serialize( + pet=pet, + query_1=query_1, + header_1=header_1, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_http_signature_test_serialize( + self, + pet, + query_1, + header_1, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if query_1 is not None: + + _query_params.append(('query_1', query_1)) + + # process the header parameters + if header_1 is not None: + _header_params['header_1'] = header_1 + # process the form parameters + # process the body parameter + if pet is not None: + _body_params = pet + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/xml' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'http_signature_test' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/http-signature-test', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_outer_boolean_serialize( + self, + body: Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bool: + """fake_outer_boolean_serialize + + Test serialization of outer boolean types + + :param body: Input boolean as post body + :type body: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_boolean_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bool", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_outer_boolean_serialize_with_http_info( + self, + body: Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bool]: + """fake_outer_boolean_serialize + + Test serialization of outer boolean types + + :param body: Input boolean as post body + :type body: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_boolean_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bool", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_outer_boolean_serialize_without_preload_content( + self, + body: Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """fake_outer_boolean_serialize + + Test serialization of outer boolean types + + :param body: Input boolean as post body + :type body: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_boolean_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bool", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_outer_boolean_serialize_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/outer/boolean', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_outer_composite_serialize( + self, + outer_composite: Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OuterComposite: + """fake_outer_composite_serialize + + Test serialization of object with outer number type + + :param outer_composite: Input composite as post body + :type outer_composite: OuterComposite + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_composite_serialize_serialize( + outer_composite=outer_composite, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OuterComposite", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_outer_composite_serialize_with_http_info( + self, + outer_composite: Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OuterComposite]: + """fake_outer_composite_serialize + + Test serialization of object with outer number type + + :param outer_composite: Input composite as post body + :type outer_composite: OuterComposite + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_composite_serialize_serialize( + outer_composite=outer_composite, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OuterComposite", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_outer_composite_serialize_without_preload_content( + self, + outer_composite: Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """fake_outer_composite_serialize + + Test serialization of object with outer number type + + :param outer_composite: Input composite as post body + :type outer_composite: OuterComposite + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_composite_serialize_serialize( + outer_composite=outer_composite, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OuterComposite", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_outer_composite_serialize_serialize( + self, + outer_composite, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if outer_composite is not None: + _body_params = outer_composite + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/outer/composite', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_outer_number_serialize( + self, + body: Annotated[Optional[float], Field(description="Input number as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> float: + """fake_outer_number_serialize + + Test serialization of outer number types + + :param body: Input number as post body + :type body: float + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_number_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "float", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_outer_number_serialize_with_http_info( + self, + body: Annotated[Optional[float], Field(description="Input number as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[float]: + """fake_outer_number_serialize + + Test serialization of outer number types + + :param body: Input number as post body + :type body: float + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_number_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "float", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_outer_number_serialize_without_preload_content( + self, + body: Annotated[Optional[float], Field(description="Input number as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """fake_outer_number_serialize + + Test serialization of outer number types + + :param body: Input number as post body + :type body: float + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_number_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "float", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_outer_number_serialize_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/outer/number', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_outer_string_serialize( + self, + body: Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """fake_outer_string_serialize + + Test serialization of outer string types + + :param body: Input string as post body + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_string_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_outer_string_serialize_with_http_info( + self, + body: Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """fake_outer_string_serialize + + Test serialization of outer string types + + :param body: Input string as post body + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_string_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_outer_string_serialize_without_preload_content( + self, + body: Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """fake_outer_string_serialize + + Test serialization of outer string types + + :param body: Input string as post body + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_outer_string_serialize_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_outer_string_serialize_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/outer/string', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_property_enum_integer_serialize( + self, + outer_object_with_enum_property: Annotated[OuterObjectWithEnumProperty, Field(description="Input enum (int) as post body")], + param: Optional[List[OuterEnumInteger]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OuterObjectWithEnumProperty: + """fake_property_enum_integer_serialize + + Test serialization of enum (int) properties with examples + + :param outer_object_with_enum_property: Input enum (int) as post body (required) + :type outer_object_with_enum_property: OuterObjectWithEnumProperty + :param param: + :type param: List[OuterEnumInteger] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_property_enum_integer_serialize_serialize( + outer_object_with_enum_property=outer_object_with_enum_property, + param=param, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OuterObjectWithEnumProperty", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_property_enum_integer_serialize_with_http_info( + self, + outer_object_with_enum_property: Annotated[OuterObjectWithEnumProperty, Field(description="Input enum (int) as post body")], + param: Optional[List[OuterEnumInteger]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OuterObjectWithEnumProperty]: + """fake_property_enum_integer_serialize + + Test serialization of enum (int) properties with examples + + :param outer_object_with_enum_property: Input enum (int) as post body (required) + :type outer_object_with_enum_property: OuterObjectWithEnumProperty + :param param: + :type param: List[OuterEnumInteger] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_property_enum_integer_serialize_serialize( + outer_object_with_enum_property=outer_object_with_enum_property, + param=param, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OuterObjectWithEnumProperty", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_property_enum_integer_serialize_without_preload_content( + self, + outer_object_with_enum_property: Annotated[OuterObjectWithEnumProperty, Field(description="Input enum (int) as post body")], + param: Optional[List[OuterEnumInteger]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """fake_property_enum_integer_serialize + + Test serialization of enum (int) properties with examples + + :param outer_object_with_enum_property: Input enum (int) as post body (required) + :type outer_object_with_enum_property: OuterObjectWithEnumProperty + :param param: + :type param: List[OuterEnumInteger] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_property_enum_integer_serialize_serialize( + outer_object_with_enum_property=outer_object_with_enum_property, + param=param, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OuterObjectWithEnumProperty", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_property_enum_integer_serialize_serialize( + self, + outer_object_with_enum_property, + param, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'param': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if param is not None: + + _query_params.append(('param', param)) + + # process the header parameters + # process the form parameters + # process the body parameter + if outer_object_with_enum_property is not None: + _body_params = outer_object_with_enum_property + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/property/enum-int', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_ref_enum_string( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EnumClass: + """test ref to enum string + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_ref_enum_string_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EnumClass", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_ref_enum_string_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EnumClass]: + """test ref to enum string + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_ref_enum_string_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EnumClass", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_ref_enum_string_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test ref to enum string + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_ref_enum_string_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EnumClass", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_ref_enum_string_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/ref_enum_string', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_boolean( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bool: + """test returning boolean + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_boolean_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bool", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_boolean_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bool]: + """test returning boolean + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_boolean_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bool", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_boolean_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test returning boolean + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_boolean_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bool", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_boolean_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_boolean', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_byte_like_json( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """test byte like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_byte_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_byte_like_json_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """test byte like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_byte_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_byte_like_json_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test byte like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_byte_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_byte_like_json_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_byte_like_json', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_enum( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """test returning enum + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_enum_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_enum_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """test returning enum + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_enum_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_enum_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test returning enum + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_enum_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_enum_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_enum', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_enum_like_json( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """test enum like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_enum_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_enum_like_json_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """test enum like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_enum_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_enum_like_json_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test enum like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_enum_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_enum_like_json_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_enum_like_json', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_float( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> float: + """test returning float + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_float_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "float", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_float_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[float]: + """test returning float + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_float_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "float", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_float_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test returning float + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_float_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "float", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_float_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_float', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_int( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> int: + """test returning int + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_int_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_int_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[int]: + """test returning int + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_int_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_int_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test returning int + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_int_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_int_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_int', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_list_of_objects( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[List[Tag]]: + """test returning list of objects + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_list_of_objects_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[List[Tag]]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_list_of_objects_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[List[Tag]]]: + """test returning list of objects + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_list_of_objects_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[List[Tag]]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_list_of_objects_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test returning list of objects + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_list_of_objects_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[List[Tag]]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_list_of_objects_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_list_of_object', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_str_like_json( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """test str like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_str_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_str_like_json_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """test str like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_str_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_str_like_json_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test str like json + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_str_like_json_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_str_like_json_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_str_like_json', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_return_string( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """test returning string + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_string_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_return_string_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """test returning string + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_string_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_return_string_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test returning string + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_return_string_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_return_string_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/return_string', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fake_uuid_example( + self, + uuid_example: Annotated[UUID, Field(description="uuid example")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test uuid example + + + :param uuid_example: uuid example (required) + :type uuid_example: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_uuid_example_serialize( + uuid_example=uuid_example, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fake_uuid_example_with_http_info( + self, + uuid_example: Annotated[UUID, Field(description="uuid example")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test uuid example + + + :param uuid_example: uuid example (required) + :type uuid_example: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_uuid_example_serialize( + uuid_example=uuid_example, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fake_uuid_example_without_preload_content( + self, + uuid_example: Annotated[UUID, Field(description="uuid example")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test uuid example + + + :param uuid_example: uuid example (required) + :type uuid_example: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fake_uuid_example_serialize( + uuid_example=uuid_example, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fake_uuid_example_serialize( + self, + uuid_example, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if uuid_example is not None: + + _query_params.append(('uuid_example', uuid_example)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/uuid_example', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_additional_properties_reference( + self, + request_body: Annotated[Dict[str, Any], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test referenced additionalProperties + + + + :param request_body: request body (required) + :type request_body: Dict[str, object] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_additional_properties_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_additional_properties_reference_with_http_info( + self, + request_body: Annotated[Dict[str, Any], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test referenced additionalProperties + + + + :param request_body: request body (required) + :type request_body: Dict[str, object] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_additional_properties_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_additional_properties_reference_without_preload_content( + self, + request_body: Annotated[Dict[str, Any], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test referenced additionalProperties + + + + :param request_body: request body (required) + :type request_body: Dict[str, object] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_additional_properties_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_additional_properties_reference_serialize( + self, + request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request_body is not None: + _body_params = request_body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/additionalProperties-reference', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_body_with_binary( + self, + body: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="image to upload")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test_body_with_binary + + For this test, the body has to be a binary file. + + :param body: image to upload (required) + :type body: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_binary_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_body_with_binary_with_http_info( + self, + body: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="image to upload")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test_body_with_binary + + For this test, the body has to be a binary file. + + :param body: image to upload (required) + :type body: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_binary_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_body_with_binary_without_preload_content( + self, + body: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="image to upload")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test_body_with_binary + + For this test, the body has to be a binary file. + + :param body: image to upload (required) + :type body: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_binary_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_body_with_binary_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + # convert to byte array if the input is a file name (str) + if isinstance(body, str): + with open(body, "rb") as _fp: + _body_params = _fp.read() + elif isinstance(body, tuple): + # drop the filename from the tuple + _body_params = body[1] + else: + _body_params = body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'image/png' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fake/body-with-binary', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_body_with_file_schema( + self, + file_schema_test_class: FileSchemaTestClass, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test_body_with_file_schema + + For this test, the body for this request must reference a schema named `File`. + + :param file_schema_test_class: (required) + :type file_schema_test_class: FileSchemaTestClass + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_file_schema_serialize( + file_schema_test_class=file_schema_test_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_body_with_file_schema_with_http_info( + self, + file_schema_test_class: FileSchemaTestClass, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test_body_with_file_schema + + For this test, the body for this request must reference a schema named `File`. + + :param file_schema_test_class: (required) + :type file_schema_test_class: FileSchemaTestClass + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_file_schema_serialize( + file_schema_test_class=file_schema_test_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_body_with_file_schema_without_preload_content( + self, + file_schema_test_class: FileSchemaTestClass, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test_body_with_file_schema + + For this test, the body for this request must reference a schema named `File`. + + :param file_schema_test_class: (required) + :type file_schema_test_class: FileSchemaTestClass + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_file_schema_serialize( + file_schema_test_class=file_schema_test_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_body_with_file_schema_serialize( + self, + file_schema_test_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if file_schema_test_class is not None: + _body_params = file_schema_test_class + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fake/body-with-file-schema', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_body_with_query_params( + self, + query: StrictStr, + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test_body_with_query_params + + + :param query: (required) + :type query: str + :param user: (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_query_params_serialize( + query=query, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_body_with_query_params_with_http_info( + self, + query: StrictStr, + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test_body_with_query_params + + + :param query: (required) + :type query: str + :param user: (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_query_params_serialize( + query=query, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_body_with_query_params_without_preload_content( + self, + query: StrictStr, + user: User, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test_body_with_query_params + + + :param query: (required) + :type query: str + :param user: (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_body_with_query_params_serialize( + query=query, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_body_with_query_params_serialize( + self, + query, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if query is not None: + + _query_params.append(('query', query)) + + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fake/body-with-query-params', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_client_model( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Client: + """To test \"client\" model + + To test \"client\" model + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_client_model_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_client_model_with_http_info( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Client]: + """To test \"client\" model + + To test \"client\" model + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_client_model_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_client_model_without_preload_content( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """To test \"client\" model + + To test \"client\" model + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_client_model_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_client_model_serialize( + self, + client, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if client is not None: + _body_params = client + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/fake', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_date_time_query_parameter( + self, + date_time_query: datetime, + str_query: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test_date_time_query_parameter + + + :param date_time_query: (required) + :type date_time_query: datetime + :param str_query: (required) + :type str_query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_date_time_query_parameter_serialize( + date_time_query=date_time_query, + str_query=str_query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_date_time_query_parameter_with_http_info( + self, + date_time_query: datetime, + str_query: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test_date_time_query_parameter + + + :param date_time_query: (required) + :type date_time_query: datetime + :param str_query: (required) + :type str_query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_date_time_query_parameter_serialize( + date_time_query=date_time_query, + str_query=str_query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_date_time_query_parameter_without_preload_content( + self, + date_time_query: datetime, + str_query: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test_date_time_query_parameter + + + :param date_time_query: (required) + :type date_time_query: datetime + :param str_query: (required) + :type str_query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_date_time_query_parameter_serialize( + date_time_query=date_time_query, + str_query=str_query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_date_time_query_parameter_serialize( + self, + date_time_query, + str_query, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if date_time_query is not None: + if isinstance(date_time_query, datetime): + _query_params.append( + ( + 'date_time_query', + date_time_query.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('date_time_query', date_time_query)) + + if str_query is not None: + + _query_params.append(('str_query', str_query)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fake/date-time-query-params', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_empty_and_non_empty_responses( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test empty and non-empty responses + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_empty_and_non_empty_responses_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '206': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_empty_and_non_empty_responses_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test empty and non-empty responses + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_empty_and_non_empty_responses_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '206': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_empty_and_non_empty_responses_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test empty and non-empty responses + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_empty_and_non_empty_responses_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '206': "str", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_empty_and_non_empty_responses_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/empty_and_non_empty_responses', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_endpoint_parameters( + self, + number: Annotated[float, Field(le=543.2, ge=32.1, description="None")], + double: Annotated[float, Field(le=123.4, ge=67.8, description="None")], + pattern_without_delimiter: Annotated[str, Field(strict=True, description="None")], + byte: Annotated[Union[StrictBytes, StrictStr], Field(description="None")], + integer: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=10)]], Field(description="None")] = None, + int32: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=20)]], Field(description="None")] = None, + int64: Annotated[Optional[StrictInt], Field(description="None")] = None, + var_float: Annotated[Optional[Annotated[float, Field(le=987.6)]], Field(description="None")] = None, + string: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="None")] = None, + binary: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="None")] = None, + byte_with_max_length: Annotated[Optional[Union[Annotated[bytes, Field(strict=True, max_length=64)], Annotated[str, Field(strict=True, max_length=64)]]], Field(description="None")] = None, + var_date: Annotated[Optional[date], Field(description="None")] = None, + date_time: Annotated[Optional[datetime], Field(description="None")] = None, + password: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=64)]], Field(description="None")] = None, + param_callback: Annotated[Optional[StrictStr], Field(description="None")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + :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: bytearray + :param integer: None + :type integer: int + :param int32: None + :type int32: int + :param int64: None + :type int64: int + :param var_float: None + :type var_float: float + :param string: None + :type string: str + :param binary: None + :type binary: bytearray + :param byte_with_max_length: None + :type byte_with_max_length: bytearray + :param var_date: None + :type var_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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_endpoint_parameters_serialize( + number=number, + double=double, + pattern_without_delimiter=pattern_without_delimiter, + byte=byte, + integer=integer, + int32=int32, + int64=int64, + var_float=var_float, + string=string, + binary=binary, + byte_with_max_length=byte_with_max_length, + var_date=var_date, + date_time=date_time, + password=password, + param_callback=param_callback, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_endpoint_parameters_with_http_info( + self, + number: Annotated[float, Field(le=543.2, ge=32.1, description="None")], + double: Annotated[float, Field(le=123.4, ge=67.8, description="None")], + pattern_without_delimiter: Annotated[str, Field(strict=True, description="None")], + byte: Annotated[Union[StrictBytes, StrictStr], Field(description="None")], + integer: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=10)]], Field(description="None")] = None, + int32: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=20)]], Field(description="None")] = None, + int64: Annotated[Optional[StrictInt], Field(description="None")] = None, + var_float: Annotated[Optional[Annotated[float, Field(le=987.6)]], Field(description="None")] = None, + string: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="None")] = None, + binary: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="None")] = None, + byte_with_max_length: Annotated[Optional[Union[Annotated[bytes, Field(strict=True, max_length=64)], Annotated[str, Field(strict=True, max_length=64)]]], Field(description="None")] = None, + var_date: Annotated[Optional[date], Field(description="None")] = None, + date_time: Annotated[Optional[datetime], Field(description="None")] = None, + password: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=64)]], Field(description="None")] = None, + param_callback: Annotated[Optional[StrictStr], Field(description="None")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + :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: bytearray + :param integer: None + :type integer: int + :param int32: None + :type int32: int + :param int64: None + :type int64: int + :param var_float: None + :type var_float: float + :param string: None + :type string: str + :param binary: None + :type binary: bytearray + :param byte_with_max_length: None + :type byte_with_max_length: bytearray + :param var_date: None + :type var_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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_endpoint_parameters_serialize( + number=number, + double=double, + pattern_without_delimiter=pattern_without_delimiter, + byte=byte, + integer=integer, + int32=int32, + int64=int64, + var_float=var_float, + string=string, + binary=binary, + byte_with_max_length=byte_with_max_length, + var_date=var_date, + date_time=date_time, + password=password, + param_callback=param_callback, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_endpoint_parameters_without_preload_content( + self, + number: Annotated[float, Field(le=543.2, ge=32.1, description="None")], + double: Annotated[float, Field(le=123.4, ge=67.8, description="None")], + pattern_without_delimiter: Annotated[str, Field(strict=True, description="None")], + byte: Annotated[Union[StrictBytes, StrictStr], Field(description="None")], + integer: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=10)]], Field(description="None")] = None, + int32: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=20)]], Field(description="None")] = None, + int64: Annotated[Optional[StrictInt], Field(description="None")] = None, + var_float: Annotated[Optional[Annotated[float, Field(le=987.6)]], Field(description="None")] = None, + string: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="None")] = None, + binary: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="None")] = None, + byte_with_max_length: Annotated[Optional[Union[Annotated[bytes, Field(strict=True, max_length=64)], Annotated[str, Field(strict=True, max_length=64)]]], Field(description="None")] = None, + var_date: Annotated[Optional[date], Field(description="None")] = None, + date_time: Annotated[Optional[datetime], Field(description="None")] = None, + password: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=64)]], Field(description="None")] = None, + param_callback: Annotated[Optional[StrictStr], Field(description="None")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + :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: bytearray + :param integer: None + :type integer: int + :param int32: None + :type int32: int + :param int64: None + :type int64: int + :param var_float: None + :type var_float: float + :param string: None + :type string: str + :param binary: None + :type binary: bytearray + :param byte_with_max_length: None + :type byte_with_max_length: bytearray + :param var_date: None + :type var_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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_endpoint_parameters_serialize( + number=number, + double=double, + pattern_without_delimiter=pattern_without_delimiter, + byte=byte, + integer=integer, + int32=int32, + int64=int64, + var_float=var_float, + string=string, + binary=binary, + byte_with_max_length=byte_with_max_length, + var_date=var_date, + date_time=date_time, + password=password, + param_callback=param_callback, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_endpoint_parameters_serialize( + self, + number, + double, + pattern_without_delimiter, + byte, + integer, + int32, + int64, + var_float, + string, + binary, + byte_with_max_length, + var_date, + date_time, + password, + param_callback, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if integer is not None: + _form_params.append(('integer', integer)) + if int32 is not None: + _form_params.append(('int32', int32)) + if int64 is not None: + _form_params.append(('int64', int64)) + if number is not None: + _form_params.append(('number', number)) + if var_float is not None: + _form_params.append(('float', var_float)) + if double is not None: + _form_params.append(('double', double)) + if string is not None: + _form_params.append(('string', string)) + if pattern_without_delimiter is not None: + _form_params.append(('pattern_without_delimiter', pattern_without_delimiter)) + if byte is not None: + _form_params.append(('byte', byte)) + if binary is not None: + _files['binary'] = binary + if byte_with_max_length is not None: + _form_params.append(('byte_with_max_length', byte_with_max_length)) + if var_date is not None: + _form_params.append(('date', var_date)) + if date_time is not None: + _form_params.append(('dateTime', date_time)) + if password is not None: + _form_params.append(('password', password)) + if param_callback is not None: + _form_params.append(('callback', param_callback)) + # process the body parameter + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'http_basic_test' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_error_responses_with_model( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test error responses with model + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_error_responses_with_model_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "TestErrorResponsesWithModel400Response", + '404': "TestErrorResponsesWithModel404Response", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_error_responses_with_model_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test error responses with model + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_error_responses_with_model_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "TestErrorResponsesWithModel400Response", + '404': "TestErrorResponsesWithModel404Response", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_error_responses_with_model_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test error responses with model + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_error_responses_with_model_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "TestErrorResponsesWithModel400Response", + '404': "TestErrorResponsesWithModel404Response", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_error_responses_with_model_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/error_responses_with_model', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_group_parameters( + self, + required_string_group: Annotated[StrictInt, Field(description="Required String in group parameters")], + required_boolean_group: Annotated[StrictBool, Field(description="Required Boolean in group parameters")], + required_int64_group: Annotated[StrictInt, Field(description="Required Integer in group parameters")], + string_group: Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, + boolean_group: Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, + int64_group: Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Fake endpoint to test group parameters (optional) + + Fake endpoint to test group parameters (optional) + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_group_parameters_serialize( + 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, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_group_parameters_with_http_info( + self, + required_string_group: Annotated[StrictInt, Field(description="Required String in group parameters")], + required_boolean_group: Annotated[StrictBool, Field(description="Required Boolean in group parameters")], + required_int64_group: Annotated[StrictInt, Field(description="Required Integer in group parameters")], + string_group: Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, + boolean_group: Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, + int64_group: Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Fake endpoint to test group parameters (optional) + + Fake endpoint to test group parameters (optional) + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_group_parameters_serialize( + 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, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_group_parameters_without_preload_content( + self, + required_string_group: Annotated[StrictInt, Field(description="Required String in group parameters")], + required_boolean_group: Annotated[StrictBool, Field(description="Required Boolean in group parameters")], + required_int64_group: Annotated[StrictInt, Field(description="Required Integer in group parameters")], + string_group: Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None, + boolean_group: Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None, + int64_group: Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fake endpoint to test group parameters (optional) + + Fake endpoint to test group parameters (optional) + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_group_parameters_serialize( + 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, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_group_parameters_serialize( + self, + required_string_group, + required_boolean_group, + required_int64_group, + string_group, + boolean_group, + int64_group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if required_string_group is not None: + + _query_params.append(('required_string_group', required_string_group)) + + if required_int64_group is not None: + + _query_params.append(('required_int64_group', required_int64_group)) + + if string_group is not None: + + _query_params.append(('string_group', string_group)) + + if int64_group is not None: + + _query_params.append(('int64_group', int64_group)) + + # process the header parameters + if required_boolean_group is not None: + _header_params['required_boolean_group'] = required_boolean_group + if boolean_group is not None: + _header_params['boolean_group'] = boolean_group + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer_test' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/fake', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_inline_additional_properties( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test inline additionalProperties + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_inline_additional_properties_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_inline_additional_properties_with_http_info( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test inline additionalProperties + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_inline_additional_properties_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_inline_additional_properties_without_preload_content( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test inline additionalProperties + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_inline_additional_properties_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_inline_additional_properties_serialize( + self, + request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request_body is not None: + _body_params = request_body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/inline-additionalProperties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_inline_freeform_additional_properties( + self, + test_inline_freeform_additional_properties_request: Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test inline free-form additionalProperties + + + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_inline_freeform_additional_properties_serialize( + test_inline_freeform_additional_properties_request=test_inline_freeform_additional_properties_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_inline_freeform_additional_properties_with_http_info( + self, + test_inline_freeform_additional_properties_request: Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test inline free-form additionalProperties + + + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_inline_freeform_additional_properties_serialize( + test_inline_freeform_additional_properties_request=test_inline_freeform_additional_properties_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_inline_freeform_additional_properties_without_preload_content( + self, + test_inline_freeform_additional_properties_request: Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test inline free-form additionalProperties + + + + :param test_inline_freeform_additional_properties_request: request body (required) + :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_inline_freeform_additional_properties_serialize( + test_inline_freeform_additional_properties_request=test_inline_freeform_additional_properties_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_inline_freeform_additional_properties_serialize( + self, + test_inline_freeform_additional_properties_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if test_inline_freeform_additional_properties_request is not None: + _body_params = test_inline_freeform_additional_properties_request + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/inline-freeform-additionalProperties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_json_form_data( + self, + param: Annotated[StrictStr, Field(description="field1")], + param2: Annotated[StrictStr, Field(description="field2")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test json serialization of form data + + + + :param param: field1 (required) + :type param: str + :param param2: field2 (required) + :type param2: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_json_form_data_serialize( + param=param, + param2=param2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_json_form_data_with_http_info( + self, + param: Annotated[StrictStr, Field(description="field1")], + param2: Annotated[StrictStr, Field(description="field2")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test json serialization of form data + + + + :param param: field1 (required) + :type param: str + :param param2: field2 (required) + :type param2: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_json_form_data_serialize( + param=param, + param2=param2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_json_form_data_without_preload_content( + self, + param: Annotated[StrictStr, Field(description="field1")], + param2: Annotated[StrictStr, Field(description="field2")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test json serialization of form data + + + + :param param: field1 (required) + :type param: str + :param param2: field2 (required) + :type param2: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_json_form_data_serialize( + param=param, + param2=param2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_json_form_data_serialize( + self, + param, + param2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if param is not None: + _form_params.append(('param', param)) + if param2 is not None: + _form_params.append(('param2', param2)) + # process the body parameter + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fake/jsonFormData', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_object_for_multipart_requests( + self, + marker: TestObjectForMultipartRequestsRequestMarker, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test_object_for_multipart_requests + + + :param marker: (required) + :type marker: TestObjectForMultipartRequestsRequestMarker + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_object_for_multipart_requests_serialize( + marker=marker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_object_for_multipart_requests_with_http_info( + self, + marker: TestObjectForMultipartRequestsRequestMarker, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test_object_for_multipart_requests + + + :param marker: (required) + :type marker: TestObjectForMultipartRequestsRequestMarker + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_object_for_multipart_requests_serialize( + marker=marker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_object_for_multipart_requests_without_preload_content( + self, + marker: TestObjectForMultipartRequestsRequestMarker, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test_object_for_multipart_requests + + + :param marker: (required) + :type marker: TestObjectForMultipartRequestsRequestMarker + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_object_for_multipart_requests_serialize( + marker=marker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_object_for_multipart_requests_serialize( + self, + marker, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if marker is not None: + _form_params.append(('marker', marker)) + # process the body parameter + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/object_for_multipart_requests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_query_parameter_collection_format( + self, + pipe: List[StrictStr], + ioutil: List[StrictStr], + http: List[StrictStr], + url: List[StrictStr], + context: List[StrictStr], + allow_empty: StrictStr, + language: Optional[Dict[str, StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test_query_parameter_collection_format + + To test the collection format in query parameters + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_query_parameter_collection_format_serialize( + pipe=pipe, + ioutil=ioutil, + http=http, + url=url, + context=context, + allow_empty=allow_empty, + language=language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_query_parameter_collection_format_with_http_info( + self, + pipe: List[StrictStr], + ioutil: List[StrictStr], + http: List[StrictStr], + url: List[StrictStr], + context: List[StrictStr], + allow_empty: StrictStr, + language: Optional[Dict[str, StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test_query_parameter_collection_format + + To test the collection format in query parameters + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_query_parameter_collection_format_serialize( + pipe=pipe, + ioutil=ioutil, + http=http, + url=url, + context=context, + allow_empty=allow_empty, + language=language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_query_parameter_collection_format_without_preload_content( + self, + pipe: List[StrictStr], + ioutil: List[StrictStr], + http: List[StrictStr], + url: List[StrictStr], + context: List[StrictStr], + allow_empty: StrictStr, + language: Optional[Dict[str, StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test_query_parameter_collection_format + + To test the collection format in query parameters + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_query_parameter_collection_format_serialize( + pipe=pipe, + ioutil=ioutil, + http=http, + url=url, + context=context, + allow_empty=allow_empty, + language=language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_query_parameter_collection_format_serialize( + self, + pipe, + ioutil, + http, + url, + context, + allow_empty, + language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'pipe': 'pipes', + 'ioutil': 'csv', + 'http': 'ssv', + 'url': 'csv', + 'context': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pipe is not None: + + _query_params.append(('pipe', pipe)) + + if ioutil is not None: + + _query_params.append(('ioutil', ioutil)) + + if http is not None: + + _query_params.append(('http', http)) + + if url is not None: + + _query_params.append(('url', url)) + + if context is not None: + + _query_params.append(('context', context)) + + if language is not None: + + _query_params.append(('language', language)) + + if allow_empty is not None: + + _query_params.append(('allowEmpty', allow_empty)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fake/test-query-parameters', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def test_string_map_reference( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_string_map_reference_with_http_info( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_string_map_reference_without_preload_content( + self, + request_body: Annotated[Dict[str, StrictStr], Field(description="request body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test referenced string map + + + + :param request_body: request body (required) + :type request_body: Dict[str, str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_string_map_reference_serialize( + request_body=request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_string_map_reference_serialize( + self, + request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request_body is not None: + _body_params = request_body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/stringMap-reference', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def upload_file_with_additional_properties( + self, + file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")], + object: Optional[UploadFileWithAdditionalPropertiesRequestObject] = None, + count: Annotated[Optional[StrictInt], Field(description="Integer count")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelApiResponse: + """uploads a file and additional properties using multipart/form-data + + + + :param file: file to upload (required) + :type file: bytearray + :param object: + :type object: UploadFileWithAdditionalPropertiesRequestObject + :param count: Integer count + :type count: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_with_additional_properties_serialize( + file=file, + object=object, + count=count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def upload_file_with_additional_properties_with_http_info( + self, + file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")], + object: Optional[UploadFileWithAdditionalPropertiesRequestObject] = None, + count: Annotated[Optional[StrictInt], Field(description="Integer count")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelApiResponse]: + """uploads a file and additional properties using multipart/form-data + + + + :param file: file to upload (required) + :type file: bytearray + :param object: + :type object: UploadFileWithAdditionalPropertiesRequestObject + :param count: Integer count + :type count: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_with_additional_properties_serialize( + file=file, + object=object, + count=count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def upload_file_with_additional_properties_without_preload_content( + self, + file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")], + object: Optional[UploadFileWithAdditionalPropertiesRequestObject] = None, + count: Annotated[Optional[StrictInt], Field(description="Integer count")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """uploads a file and additional properties using multipart/form-data + + + + :param file: file to upload (required) + :type file: bytearray + :param object: + :type object: UploadFileWithAdditionalPropertiesRequestObject + :param count: Integer count + :type count: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_with_additional_properties_serialize( + file=file, + object=object, + count=count, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upload_file_with_additional_properties_serialize( + self, + file, + object, + count, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if file is not None: + _files['file'] = file + if object is not None: + _form_params.append(('object', object)) + if count is not None: + _form_params.append(('count', count)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/upload_file_with_additional_properties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_classname_tags123_api.py new file mode 100644 index 00000000000..58c76f1daaf --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/fake_classname_tags123_api.py @@ -0,0 +1,312 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from petstore_api.models.client import Client + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class FakeClassnameTags123Api: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def test_classname( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Client: + """To test class name in snake case + + To test class name in snake case + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_classname_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def test_classname_with_http_info( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Client]: + """To test class name in snake case + + To test class name in snake case + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_classname_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def test_classname_without_preload_content( + self, + client: Annotated[Client, Field(description="client model")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """To test class name in snake case + + To test class name in snake case + + :param client: client model (required) + :type client: Client + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_classname_serialize( + client=client, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Client", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_classname_serialize( + self, + client, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if client is not None: + _body_params = client + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_query' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/fake_classname_test', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/import_test_datetime_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/import_test_datetime_api.py new file mode 100644 index 00000000000..bb82beefad7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/import_test_datetime_api.py @@ -0,0 +1,278 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import datetime + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class ImportTestDatetimeApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def import_test_return_datetime( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> datetime: + """test date time + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_test_return_datetime_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "datetime", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def import_test_return_datetime_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[datetime]: + """test date time + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_test_return_datetime_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "datetime", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def import_test_return_datetime_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """test date time + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_test_return_datetime_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "datetime", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _import_test_return_datetime_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/import_test/return_datetime', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/pet_api.py new file mode 100644 index 00000000000..6f4f8092ea5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/pet_api.py @@ -0,0 +1,2579 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from petstore_api.models.model_api_response import ModelApiResponse +from petstore_api.models.pet import Pet + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class PetApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def add_pet( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Add a new pet to the store + + + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_pet_serialize( + pet=pet, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_pet_with_http_info( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Add a new pet to the store + + + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_pet_serialize( + pet=pet, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_pet_without_preload_content( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a new pet to the store + + + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_pet_serialize( + pet=pet, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_pet_serialize( + self, + pet, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pet is not None: + _body_params = pet + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/xml' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth', + 'http_signature_test' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pet', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_pet( + self, + pet_id: Annotated[StrictInt, Field(description="Pet id to delete")], + api_key: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Deletes a pet + + + + :param pet_id: Pet id to delete (required) + :type pet_id: int + :param api_key: + :type api_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_pet_serialize( + pet_id=pet_id, + api_key=api_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_pet_with_http_info( + self, + pet_id: Annotated[StrictInt, Field(description="Pet id to delete")], + api_key: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Deletes a pet + + + + :param pet_id: Pet id to delete (required) + :type pet_id: int + :param api_key: + :type api_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_pet_serialize( + pet_id=pet_id, + api_key=api_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_pet_without_preload_content( + self, + pet_id: Annotated[StrictInt, Field(description="Pet id to delete")], + api_key: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Deletes a pet + + + + :param pet_id: Pet id to delete (required) + :type pet_id: int + :param api_key: + :type api_key: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_pet_serialize( + pet_id=pet_id, + api_key=api_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_pet_serialize( + self, + pet_id, + api_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pet_id is not None: + _path_params['petId'] = pet_id + # process the query parameters + # process the header parameters + if api_key is not None: + _header_params['api_key'] = api_key + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pet/{petId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def find_pets_by_status( + self, + status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Pet]: + """Finds Pets by status + + Multiple status values can be provided with comma separated strings + + :param status: Status values that need to be considered for filter (required) + :type status: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_pets_by_status_serialize( + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Pet]", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def find_pets_by_status_with_http_info( + self, + status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Pet]]: + """Finds Pets by status + + Multiple status values can be provided with comma separated strings + + :param status: Status values that need to be considered for filter (required) + :type status: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_pets_by_status_serialize( + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Pet]", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def find_pets_by_status_without_preload_content( + self, + status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Finds Pets by status + + Multiple status values can be provided with comma separated strings + + :param status: Status values that need to be considered for filter (required) + :type status: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_pets_by_status_serialize( + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Pet]", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_pets_by_status_serialize( + self, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'status': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if status is not None: + + _query_params.append(('status', status)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth', + 'http_signature_test' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pet/findByStatus', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def find_pets_by_tags( + self, + tags: Annotated[List[StrictStr], Field(description="Tags to filter by")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Pet]: + """(Deprecated) Finds Pets by tags + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + :param tags: Tags to filter by (required) + :type tags: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning) + + _param = self._find_pets_by_tags_serialize( + tags=tags, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Pet]", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def find_pets_by_tags_with_http_info( + self, + tags: Annotated[List[StrictStr], Field(description="Tags to filter by")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Pet]]: + """(Deprecated) Finds Pets by tags + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + :param tags: Tags to filter by (required) + :type tags: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning) + + _param = self._find_pets_by_tags_serialize( + tags=tags, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Pet]", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def find_pets_by_tags_without_preload_content( + self, + tags: Annotated[List[StrictStr], Field(description="Tags to filter by")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Finds Pets by tags + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + :param tags: Tags to filter by (required) + :type tags: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning) + + _param = self._find_pets_by_tags_serialize( + tags=tags, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Pet]", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_pets_by_tags_serialize( + self, + tags, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'tags': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if tags is not None: + + _query_params.append(('tags', tags)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth', + 'http_signature_test' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pet/findByTags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_pet_by_id( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to return")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Pet: + """Find pet by ID + + Returns a single pet + + :param pet_id: ID of pet to return (required) + :type pet_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pet_by_id_serialize( + pet_id=pet_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Pet", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_pet_by_id_with_http_info( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to return")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Pet]: + """Find pet by ID + + Returns a single pet + + :param pet_id: ID of pet to return (required) + :type pet_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pet_by_id_serialize( + pet_id=pet_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Pet", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_pet_by_id_without_preload_content( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to return")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Find pet by ID + + Returns a single pet + + :param pet_id: ID of pet to return (required) + :type pet_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pet_by_id_serialize( + pet_id=pet_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Pet", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_pet_by_id_serialize( + self, + pet_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pet_id is not None: + _path_params['petId'] = pet_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pet/{petId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_pet( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update an existing pet + + + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_pet_serialize( + pet=pet, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + '404': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_pet_with_http_info( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update an existing pet + + + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_pet_serialize( + pet=pet, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + '404': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_pet_without_preload_content( + self, + pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an existing pet + + + + :param pet: Pet object that needs to be added to the store (required) + :type pet: Pet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_pet_serialize( + pet=pet, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + '404': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_pet_serialize( + self, + pet, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pet is not None: + _body_params = pet + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/xml' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth', + 'http_signature_test' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/pet', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_pet_with_form( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet that needs to be updated")], + name: Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, + status: Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Updates a pet in the store with form data + + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_pet_with_form_serialize( + pet_id=pet_id, + name=name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_pet_with_form_with_http_info( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet that needs to be updated")], + name: Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, + status: Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Updates a pet in the store with form data + + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_pet_with_form_serialize( + pet_id=pet_id, + name=name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_pet_with_form_without_preload_content( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet that needs to be updated")], + name: Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None, + status: Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updates a pet in the store with form data + + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_pet_with_form_serialize( + pet_id=pet_id, + name=name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '405': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_pet_with_form_serialize( + self, + pet_id, + name, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pet_id is not None: + _path_params['petId'] = pet_id + # process the query parameters + # process the header parameters + # process the form parameters + if name is not None: + _form_params.append(('name', name)) + if status is not None: + _form_params.append(('status', status)) + # process the body parameter + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pet/{petId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def upload_file( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to update")], + additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, + file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelApiResponse: + """uploads an image + + + + :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: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_serialize( + pet_id=pet_id, + additional_metadata=additional_metadata, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def upload_file_with_http_info( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to update")], + additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, + file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelApiResponse]: + """uploads an image + + + + :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: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_serialize( + pet_id=pet_id, + additional_metadata=additional_metadata, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def upload_file_without_preload_content( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to update")], + additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, + file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """uploads an image + + + + :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: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_serialize( + pet_id=pet_id, + additional_metadata=additional_metadata, + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upload_file_serialize( + self, + pet_id, + additional_metadata, + file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pet_id is not None: + _path_params['petId'] = pet_id + # process the query parameters + # process the header parameters + # process the form parameters + if additional_metadata is not None: + _form_params.append(('additionalMetadata', additional_metadata)) + if file is not None: + _files['file'] = file + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pet/{petId}/uploadImage', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def upload_file_with_required_file( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to update")], + required_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")], + additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelApiResponse: + """uploads an image (required) + + + + :param pet_id: ID of pet to update (required) + :type pet_id: int + :param required_file: file to upload (required) + :type required_file: bytearray + :param additional_metadata: Additional data to pass to server + :type additional_metadata: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_with_required_file_serialize( + pet_id=pet_id, + required_file=required_file, + additional_metadata=additional_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def upload_file_with_required_file_with_http_info( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to update")], + required_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")], + additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelApiResponse]: + """uploads an image (required) + + + + :param pet_id: ID of pet to update (required) + :type pet_id: int + :param required_file: file to upload (required) + :type required_file: bytearray + :param additional_metadata: Additional data to pass to server + :type additional_metadata: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_with_required_file_serialize( + pet_id=pet_id, + required_file=required_file, + additional_metadata=additional_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def upload_file_with_required_file_without_preload_content( + self, + pet_id: Annotated[StrictInt, Field(description="ID of pet to update")], + required_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")], + additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """uploads an image (required) + + + + :param pet_id: ID of pet to update (required) + :type pet_id: int + :param required_file: file to upload (required) + :type required_file: bytearray + :param additional_metadata: Additional data to pass to server + :type additional_metadata: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_file_with_required_file_serialize( + pet_id=pet_id, + required_file=required_file, + additional_metadata=additional_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ModelApiResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upload_file_with_required_file_serialize( + self, + pet_id, + required_file, + additional_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pet_id is not None: + _path_params['petId'] = pet_id + # process the query parameters + # process the header parameters + # process the form parameters + if additional_metadata is not None: + _form_params.append(('additionalMetadata', additional_metadata)) + if required_file is not None: + _files['requiredFile'] = required_file + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'petstore_auth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fake/{petId}/uploadImageWithRequiredFile', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/store_api.py new file mode 100644 index 00000000000..dc8d8de5c64 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/store_api.py @@ -0,0 +1,1085 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Dict +from typing_extensions import Annotated +from petstore_api.models.order import Order + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class StoreApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def delete_order( + self, + order_id: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete purchase order by ID + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + :param order_id: ID of the order that needs to be deleted (required) + :type order_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_order_serialize( + order_id=order_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_order_with_http_info( + self, + order_id: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete purchase order by ID + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + :param order_id: ID of the order that needs to be deleted (required) + :type order_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_order_serialize( + order_id=order_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_order_without_preload_content( + self, + order_id: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete purchase order by ID + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + :param order_id: ID of the order that needs to be deleted (required) + :type order_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_order_serialize( + order_id=order_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_order_serialize( + self, + order_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if order_id is not None: + _path_params['order_id'] = order_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/store/order/{order_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_inventory( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, int]: + """Returns pet inventories by status + + Returns a map of status codes to quantities + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_inventory_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, int]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_inventory_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, int]]: + """Returns pet inventories by status + + Returns a map of status codes to quantities + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_inventory_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, int]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_inventory_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Returns pet inventories by status + + Returns a map of status codes to quantities + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_inventory_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, int]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_inventory_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/store/inventory', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_order_by_id( + self, + order_id: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Order: + """Find purchase order by ID + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + :param order_id: ID of pet that needs to be fetched (required) + :type order_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_order_by_id_serialize( + order_id=order_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Order", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_order_by_id_with_http_info( + self, + order_id: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Order]: + """Find purchase order by ID + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + :param order_id: ID of pet that needs to be fetched (required) + :type order_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_order_by_id_serialize( + order_id=order_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Order", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_order_by_id_without_preload_content( + self, + order_id: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Find purchase order by ID + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + :param order_id: ID of pet that needs to be fetched (required) + :type order_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_order_by_id_serialize( + order_id=order_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Order", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_order_by_id_serialize( + self, + order_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if order_id is not None: + _path_params['order_id'] = order_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/store/order/{order_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def place_order( + self, + order: Annotated[Order, Field(description="order placed for purchasing the pet")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Order: + """Place an order for a pet + + + + :param order: order placed for purchasing the pet (required) + :type order: Order + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._place_order_serialize( + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Order", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def place_order_with_http_info( + self, + order: Annotated[Order, Field(description="order placed for purchasing the pet")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Order]: + """Place an order for a pet + + + + :param order: order placed for purchasing the pet (required) + :type order: Order + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._place_order_serialize( + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Order", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def place_order_without_preload_content( + self, + order: Annotated[Order, Field(description="order placed for purchasing the pet")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Place an order for a pet + + + + :param order: order placed for purchasing the pet (required) + :type order: Order + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._place_order_serialize( + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Order", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _place_order_serialize( + self, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if order is not None: + _body_params = order + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/store/order', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/user_api.py new file mode 100644 index 00000000000..4e6d222045b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api/user_api.py @@ -0,0 +1,2161 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from petstore_api.models.user import User + +from petstore_api.api_client import ApiClient, RequestSerialized +from petstore_api.api_response import ApiResponse +from petstore_api.rest import RESTResponseType + + +class UserApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def create_user( + self, + user: Annotated[User, Field(description="Created user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=4)] = 0, + ) -> None: + """Create user + + This can only be done by the logged in user. + + :param user: Created user object (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_user_with_http_info( + self, + user: Annotated[User, Field(description="Created user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=4)] = 0, + ) -> ApiResponse[None]: + """Create user + + This can only be done by the logged in user. + + :param user: Created user object (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_user_without_preload_content( + self, + user: Annotated[User, Field(description="Created user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=4)] = 0, + ) -> RESTResponseType: + """Create user + + This can only be done by the logged in user. + + :param user: Created user object (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_user_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'http://localhost/v2', + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2', + 'http://{server}.swagger.io:{port}/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_users_with_array_input( + self, + user: Annotated[List[User], Field(description="List of user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Creates list of users with given input array + + + + :param user: List of user object (required) + :type user: List[User] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_users_with_array_input_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_users_with_array_input_with_http_info( + self, + user: Annotated[List[User], Field(description="List of user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Creates list of users with given input array + + + + :param user: List of user object (required) + :type user: List[User] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_users_with_array_input_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_users_with_array_input_without_preload_content( + self, + user: Annotated[List[User], Field(description="List of user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates list of users with given input array + + + + :param user: List of user object (required) + :type user: List[User] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_users_with_array_input_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_users_with_array_input_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'User': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/createWithArray', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_users_with_list_input( + self, + user: Annotated[List[User], Field(description="List of user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Creates list of users with given input array + + + + :param user: List of user object (required) + :type user: List[User] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_users_with_list_input_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_users_with_list_input_with_http_info( + self, + user: Annotated[List[User], Field(description="List of user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Creates list of users with given input array + + + + :param user: List of user object (required) + :type user: List[User] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_users_with_list_input_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_users_with_list_input_without_preload_content( + self, + user: Annotated[List[User], Field(description="List of user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates list of users with given input array + + + + :param user: List of user object (required) + :type user: List[User] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_users_with_list_input_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_users_with_list_input_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'User': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/createWithList', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_user( + self, + username: Annotated[StrictStr, Field(description="The name that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete user + + This can only be done by the logged in user. + + :param username: The name that needs to be deleted (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_user_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The name that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete user + + This can only be done by the logged in user. + + :param username: The name that needs to be deleted (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_user_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The name that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete user + + This can only be done by the logged in user. + + :param username: The name that needs to be deleted (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_user_serialize( + self, + username, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if username is not None: + _path_params['username'] = username + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/user/{username}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_user_by_name( + self, + username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Get user by user name + + + + :param username: The name that needs to be fetched. Use user1 for testing. (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_by_name_serialize( + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_user_by_name_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Get user by user name + + + + :param username: The name that needs to be fetched. Use user1 for testing. (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_by_name_serialize( + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_user_by_name_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get user by user name + + + + :param username: The name that needs to be fetched. Use user1 for testing. (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_by_name_serialize( + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_by_name_serialize( + self, + username, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if username is not None: + _path_params['username'] = username + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user/{username}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def login_user( + self, + username: Annotated[StrictStr, Field(description="The user name for login")], + password: Annotated[StrictStr, Field(description="The password for login in clear text")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Logs user into the system + + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_user_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def login_user_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The user name for login")], + password: Annotated[StrictStr, Field(description="The password for login in clear text")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Logs user into the system + + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_user_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def login_user_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The user name for login")], + password: Annotated[StrictStr, Field(description="The password for login in clear text")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Logs user into the system + + + + :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 _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_user_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '400': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _login_user_serialize( + self, + username, + password, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def logout_user( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Logs out current logged in user session + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def logout_user_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Logs out current logged in user session + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def logout_user_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Logs out current logged in user session + + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _logout_user_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user/logout', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_user( + self, + username: Annotated[StrictStr, Field(description="name that need to be deleted")], + user: Annotated[User, Field(description="Updated user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Updated user + + This can only be done by the logged in user. + + :param username: name that need to be deleted (required) + :type username: str + :param user: Updated user object (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + username=username, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_user_with_http_info( + self, + username: Annotated[StrictStr, Field(description="name that need to be deleted")], + user: Annotated[User, Field(description="Updated user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Updated user + + This can only be done by the logged in user. + + :param username: name that need to be deleted (required) + :type username: str + :param user: Updated user object (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + username=username, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_user_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="name that need to be deleted")], + user: Annotated[User, Field(description="Updated user object")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updated user + + This can only be done by the logged in user. + + :param username: name that need to be deleted (required) + :type username: str + :param user: Updated user object (required) + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :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 + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + username=username, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': None, + '404': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_user_serialize( + self, + username, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if username is not None: + _path_params['username'] = username + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/user/{username}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py new file mode 100644 index 00000000000..46555cbb119 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py @@ -0,0 +1,814 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile +import uuid + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from petstore_api.configuration import Configuration +from petstore_api.api_response import ApiResponse, T as ApiResponseT +import petstore_api.models +from petstore_api import rest +from petstore_api.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """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. + + :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 + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + 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() + + @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 + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :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 files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + 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) + ) + + # 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 + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + async def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :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 _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = await self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + 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_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + 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 decimal.Decimal return string representation. + 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, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, uuid.UUID): + return str(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() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif 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. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """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. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + 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 isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # 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 is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + 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: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + 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 parameters_to_url_query(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: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(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(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + 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: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> 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. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :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, + resource_path, + method, + body, + request_auth + ) + else: + 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 + ) -> None: + """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. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = 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`' + ) + + 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. + + handle file downloading + save response body into a tmp file and return the instance + + :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: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.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 str(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_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_response.py new file mode 100644 index 00000000000..9bc7c11f6b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py new file mode 100644 index 00000000000..5738e19cf7b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py @@ -0,0 +1,746 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import http.client as httplib +import logging +from logging import FileHandler +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + +import urllib3 + +from petstore_api.signing import HttpSigningConfiguration + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "petstore_auth": OAuth2AuthSetting, + "api_key": APIKeyAuthSetting, + "api_key_query": APIKeyAuthSetting, + "http_basic_test": BasicAuthSetting, + "bearer_test": BearerFormatAuthSetting, + "http_signature_test": HTTPSignatureAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :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 access_token: Access token. + :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. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) 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: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + signing_info: Optional[HttpSigningConfiguration]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, + ) -> 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.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + 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.access_token = access_token + """Access token + """ + 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: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + 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.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + 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: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """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 + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + 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: str, value: Any) -> None: + object.__setattr__(self, name, value) + 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: Optional[Self]) -> None: + """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 = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """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: Optional[str]) -> None: + """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) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """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 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 self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """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: str) -> None: + """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: str, alias: Optional[str]=None) -> Optional[str]: + """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 + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """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)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + 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) -> str: + """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) -> List[HostSetting]: + """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: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """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) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py new file mode 100644 index 00000000000..195e150623d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +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) -> 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) -> 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) -> 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) -> 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, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + 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.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +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-httpx/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/__init__.py new file mode 100644 index 00000000000..f34d053a1b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/__init__.py @@ -0,0 +1,128 @@ +# 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: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.additional_properties_object import AdditionalPropertiesObject +from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly +from petstore_api.models.all_of_super_model import AllOfSuperModel +from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef +from petstore_api.models.animal import Animal +from petstore_api.models.any_of_color import AnyOfColor +from petstore_api.models.any_of_pig import AnyOfPig +from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel +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.base_discriminator import BaseDiscriminator +from petstore_api.models.basque_pig import BasquePig +from petstore_api.models.bathing import Bathing +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.category import Category +from petstore_api.models.circular_all_of_ref import CircularAllOfRef +from petstore_api.models.circular_reference_model import CircularReferenceModel +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.color import Color +from petstore_api.models.creature import Creature +from petstore_api.models.creature_info import CreatureInfo +from petstore_api.models.danish_pig import DanishPig +from petstore_api.models.data_output_format import DataOutputFormat +from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper +from petstore_api.models.dog import Dog +from petstore_api.models.dummy_model import DummyModel +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt +from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue +from petstore_api.models.enum_string1 import EnumString1 +from petstore_api.models.enum_string2 import EnumString2 +from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.feeding import Feeding +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.first_ref import FirstRef +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.hunting_dog import HuntingDog +from petstore_api.models.info import Info +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty +from petstore_api.models.input_all_of import InputAllOf +from petstore_api.models.int_or_string import IntOrString +from petstore_api.models.list_class import ListClass +from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel +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_api_response import ModelApiResponse +from petstore_api.models.model_field import ModelField +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.multi_arrays import MultiArrays +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.nullable_property import NullableProperty +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties +from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields +from petstore_api.models.one_of_enum_string import OneOfEnumString +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.parent import Parent +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict +from petstore_api.models.pet import Pet +from petstore_api.models.pig import Pig +from petstore_api.models.pony_sizes import PonySizes +from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString +from petstore_api.models.property_map import PropertyMap +from petstore_api.models.property_name_collision import PropertyNameCollision +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef +from petstore_api.models.second_ref import SecondRef +from petstore_api.models.self_reference_model import SelfReferenceModel +from petstore_api.models.single_ref_type import SingleRefType +from petstore_api.models.special_character_enum import SpecialCharacterEnum +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.special_name import SpecialName +from petstore_api.models.tag import Tag +from petstore_api.models.task import Task +from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault +from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response +from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault +from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker +from petstore_api.models.tiger import Tiger +from petstore_api.models.type import Type +from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties +from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties +from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject +from petstore_api.models.user import User +from petstore_api.models.with_nested_one_of import WithNestedOneOf + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py new file mode 100644 index 00000000000..291b5e55e35 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AdditionalPropertiesAnyType(BaseModel): + """ + AdditionalPropertiesAnyType + """ # noqa: E501 + name: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdditionalPropertiesAnyType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdditionalPropertiesAnyType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py new file mode 100644 index 00000000000..4b2cc457e49 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AdditionalPropertiesClass(BaseModel): + """ + AdditionalPropertiesClass + """ # noqa: E501 + map_property: Optional[Dict[str, StrictStr]] = None + map_of_map_property: Optional[Dict[str, Dict[str, StrictStr]]] = None + __properties: ClassVar[List[str]] = ["map_property", "map_of_map_property"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdditionalPropertiesClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdditionalPropertiesClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "map_property": obj.get("map_property"), + "map_of_map_property": obj.get("map_of_map_property") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py new file mode 100644 index 00000000000..00707c3c481 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AdditionalPropertiesObject(BaseModel): + """ + AdditionalPropertiesObject + """ # noqa: E501 + name: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdditionalPropertiesObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdditionalPropertiesObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py new file mode 100644 index 00000000000..d8049b519ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AdditionalPropertiesWithDescriptionOnly(BaseModel): + """ + AdditionalPropertiesWithDescriptionOnly + """ # noqa: E501 + name: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdditionalPropertiesWithDescriptionOnly from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py new file mode 100644 index 00000000000..03f55459293 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AllOfSuperModel(BaseModel): + """ + AllOfSuperModel + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, alias="_name") + __properties: ClassVar[List[str]] = ["_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AllOfSuperModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AllOfSuperModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_name": obj.get("_name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py new file mode 100644 index 00000000000..44c7da9114a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.single_ref_type import SingleRefType +from typing import Optional, Set +from typing_extensions import Self + +class AllOfWithSingleRef(BaseModel): + """ + AllOfWithSingleRef + """ # noqa: E501 + username: Optional[StrictStr] = None + single_ref_type: Optional[SingleRefType] = Field(default=None, alias="SingleRefType") + __properties: ClassVar[List[str]] = ["username", "SingleRefType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AllOfWithSingleRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AllOfWithSingleRef from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "SingleRefType": obj.get("SingleRefType") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py new file mode 100644 index 00000000000..56bec73a9cc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + +class Animal(BaseModel): + """ + Animal + """ # noqa: E501 + class_name: StrictStr = Field(alias="className") + color: Optional[StrictStr] = 'red' + __properties: ClassVar[List[str]] = ["className", "color"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'className' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'Cat': 'Cat','Dog': 'Dog' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[Cat, Dog]]: + """Create an instance of Animal from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Cat, Dog]]: + """Create an instance of Animal from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'Cat': + return import_module("petstore_api.models.cat").Cat.from_dict(obj) + if object_type == 'Dog': + return import_module("petstore_api.models.dog").Dog.from_dict(obj) + + raise ValueError("Animal failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py new file mode 100644 index 00000000000..f6d277e7949 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] + +class AnyOfColor(BaseModel): + """ + Any of RGB array, RGBA array, or hex string. + """ + + # data type: List[int] + anyof_schema_1_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=3, max_length=3)]] = Field(default=None, description="RGB three element array with values 0-255.") + # data type: List[int] + anyof_schema_2_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=4, max_length=4)]] = Field(default=None, description="RGBA four element array with values 0-255.") + # data type: str + anyof_schema_3_validator: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default=None, description="Hex color string, such as #00FF00.") + if TYPE_CHECKING: + actual_instance: Optional[Union[List[int], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[int]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AnyOfColor.model_construct() + error_messages = [] + # validate data type: List[int] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[int] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AnyOfColor with anyOf schemas: List[int], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into List[int] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[int] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AnyOfColor with anyOf schemas: List[int], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[int], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py new file mode 100644 index 00000000000..c949e136f41 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from petstore_api.models.basque_pig import BasquePig +from petstore_api.models.danish_pig import DanishPig +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] + +class AnyOfPig(BaseModel): + """ + AnyOfPig + """ + + # data type: BasquePig + anyof_schema_1_validator: Optional[BasquePig] = None + # data type: DanishPig + anyof_schema_2_validator: Optional[DanishPig] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[BasquePig, DanishPig]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "BasquePig", "DanishPig" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AnyOfPig.model_construct() + error_messages = [] + # validate data type: BasquePig + if not isinstance(v, BasquePig): + error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`") + else: + return v + + # validate data type: DanishPig + if not isinstance(v, DanishPig): + error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[BasquePig] = None + try: + instance.actual_instance = BasquePig.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[DanishPig] = None + try: + instance.actual_instance = DanishPig.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], BasquePig, DanishPig]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py new file mode 100644 index 00000000000..4f8eeda66c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.tag import Tag +from typing import Optional, Set +from typing_extensions import Self + +class ArrayOfArrayOfModel(BaseModel): + """ + ArrayOfArrayOfModel + """ # noqa: E501 + another_property: Optional[List[List[Tag]]] = None + __properties: ClassVar[List[str]] = ["another_property"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArrayOfArrayOfModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in another_property (list of list) + _items = [] + if self.another_property: + for _item_another_property in self.another_property: + if _item_another_property: + _items.append( + [_inner_item.to_dict() for _inner_item in _item_another_property if _inner_item is not None] + ) + _dict['another_property'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArrayOfArrayOfModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "another_property": [ + [Tag.from_dict(_inner_item) for _inner_item in _item] + for _item in obj["another_property"] + ] if obj.get("another_property") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 00000000000..02b0f6d657f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ArrayOfArrayOfNumberOnly(BaseModel): + """ + ArrayOfArrayOfNumberOnly + """ # noqa: E501 + array_array_number: Optional[List[List[float]]] = Field(default=None, alias="ArrayArrayNumber") + __properties: ClassVar[List[str]] = ["ArrayArrayNumber"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArrayOfArrayOfNumberOnly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArrayOfArrayOfNumberOnly from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ArrayArrayNumber": obj.get("ArrayArrayNumber") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py new file mode 100644 index 00000000000..b22632b0ce4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ArrayOfNumberOnly(BaseModel): + """ + ArrayOfNumberOnly + """ # noqa: E501 + array_number: Optional[List[float]] = Field(default=None, alias="ArrayNumber") + __properties: ClassVar[List[str]] = ["ArrayNumber"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArrayOfNumberOnly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArrayOfNumberOnly from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ArrayNumber": obj.get("ArrayNumber") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py new file mode 100644 index 00000000000..e8f8acf67cc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from petstore_api.models.read_only_first import ReadOnlyFirst +from typing import Optional, Set +from typing_extensions import Self + +class ArrayTest(BaseModel): + """ + ArrayTest + """ # noqa: E501 + array_of_string: Optional[Annotated[List[StrictStr], Field(min_length=0, max_length=3)]] = None + array_of_nullable_float: Optional[List[Optional[float]]] = None + array_array_of_integer: Optional[List[List[StrictInt]]] = None + array_array_of_model: Optional[List[List[ReadOnlyFirst]]] = None + __properties: ClassVar[List[str]] = ["array_of_string", "array_of_nullable_float", "array_array_of_integer", "array_array_of_model"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArrayTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in array_array_of_model (list of list) + _items = [] + if self.array_array_of_model: + for _item_array_array_of_model in self.array_array_of_model: + if _item_array_array_of_model: + _items.append( + [_inner_item.to_dict() for _inner_item in _item_array_array_of_model if _inner_item is not None] + ) + _dict['array_array_of_model'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArrayTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "array_of_string": obj.get("array_of_string"), + "array_of_nullable_float": obj.get("array_of_nullable_float"), + "array_array_of_integer": obj.get("array_array_of_integer"), + "array_array_of_model": [ + [ReadOnlyFirst.from_dict(_inner_item) for _inner_item in _item] + for _item in obj["array_array_of_model"] + ] if obj.get("array_array_of_model") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py new file mode 100644 index 00000000000..f13c270b56b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.primitive_string import PrimitiveString + from petstore_api.models.info import Info + +class BaseDiscriminator(BaseModel): + """ + BaseDiscriminator + """ # noqa: E501 + type_name: Optional[StrictStr] = Field(default=None, alias="_typeName") + __properties: ClassVar[List[str]] = ["_typeName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '_typeName' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'string': 'PrimitiveString','Info': 'Info' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[PrimitiveString, Info]]: + """Create an instance of BaseDiscriminator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[PrimitiveString, Info]]: + """Create an instance of BaseDiscriminator from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'PrimitiveString': + return import_module("petstore_api.models.primitive_string").PrimitiveString.from_dict(obj) + if object_type == 'Info': + return import_module("petstore_api.models.info").Info.from_dict(obj) + + raise ValueError("BaseDiscriminator failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py new file mode 100644 index 00000000000..a1f32a6edcf --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class BasquePig(BaseModel): + """ + BasquePig + """ # noqa: E501 + class_name: StrictStr = Field(alias="className") + color: StrictStr + __properties: ClassVar[List[str]] = ["className", "color"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BasquePig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BasquePig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "className": obj.get("className"), + "color": obj.get("color") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py new file mode 100644 index 00000000000..088e6ad3b87 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Bathing(BaseModel): + """ + Bathing + """ # noqa: E501 + task_name: StrictStr + function_name: StrictStr + content: StrictStr + __properties: ClassVar[List[str]] = ["task_name", "function_name", "content"] + + @field_validator('task_name') + def task_name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['cleaning_deep']): + raise ValueError("must be one of enum values ('cleaning_deep')") + return value + + @field_validator('function_name') + def function_name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['care_nourish']): + raise ValueError("must be one of enum values ('care_nourish')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Bathing from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Bathing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "task_name": obj.get("task_name"), + "function_name": obj.get("function_name"), + "content": obj.get("content") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py new file mode 100644 index 00000000000..b3c20af5444 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Capitalization(BaseModel): + """ + Capitalization + """ # noqa: E501 + small_camel: Optional[StrictStr] = Field(default=None, alias="smallCamel") + capital_camel: Optional[StrictStr] = Field(default=None, alias="CapitalCamel") + small_snake: Optional[StrictStr] = Field(default=None, alias="small_Snake") + capital_snake: Optional[StrictStr] = Field(default=None, alias="Capital_Snake") + sca_eth_flow_points: Optional[StrictStr] = Field(default=None, alias="SCA_ETH_Flow_Points") + att_name: Optional[StrictStr] = Field(default=None, description="Name of the pet ", alias="ATT_NAME") + __properties: ClassVar[List[str]] = ["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Capitalization from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Capitalization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "smallCamel": obj.get("smallCamel"), + "CapitalCamel": obj.get("CapitalCamel"), + "small_Snake": obj.get("small_Snake"), + "Capital_Snake": obj.get("Capital_Snake"), + "SCA_ETH_Flow_Points": obj.get("SCA_ETH_Flow_Points"), + "ATT_NAME": obj.get("ATT_NAME") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py new file mode 100644 index 00000000000..0c2c9788dca --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.animal import Animal +from typing import Optional, Set +from typing_extensions import Self + +class Cat(Animal): + """ + Cat + """ # noqa: E501 + declawed: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["className", "color", "declawed"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Cat from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Cat from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "className": obj.get("className"), + "color": obj.get("color") if obj.get("color") is not None else 'red', + "declawed": obj.get("declawed") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py new file mode 100644 index 00000000000..dcc6247b5ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Category(BaseModel): + """ + Category + """ # noqa: E501 + id: Optional[StrictInt] = None + name: StrictStr + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Category from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Category from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") if obj.get("name") is not None else 'default-name' + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py new file mode 100644 index 00000000000..f98247ae0fb --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CircularAllOfRef(BaseModel): + """ + CircularAllOfRef + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, alias="_name") + second_circular_all_of_ref: Optional[List[SecondCircularAllOfRef]] = Field(default=None, alias="secondCircularAllOfRef") + __properties: ClassVar[List[str]] = ["_name", "secondCircularAllOfRef"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CircularAllOfRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in second_circular_all_of_ref (list) + _items = [] + if self.second_circular_all_of_ref: + for _item_second_circular_all_of_ref in self.second_circular_all_of_ref: + if _item_second_circular_all_of_ref: + _items.append(_item_second_circular_all_of_ref.to_dict()) + _dict['secondCircularAllOfRef'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CircularAllOfRef from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_name": obj.get("_name"), + "secondCircularAllOfRef": [SecondCircularAllOfRef.from_dict(_item) for _item in obj["secondCircularAllOfRef"]] if obj.get("secondCircularAllOfRef") is not None else None + }) + return _obj + +from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef +# TODO: Rewrite to not use raise_errors +CircularAllOfRef.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py new file mode 100644 index 00000000000..3b2854caaac --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CircularReferenceModel(BaseModel): + """ + CircularReferenceModel + """ # noqa: E501 + size: Optional[StrictInt] = None + nested: Optional[FirstRef] = None + __properties: ClassVar[List[str]] = ["size", "nested"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CircularReferenceModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of nested + if self.nested: + _dict['nested'] = self.nested.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CircularReferenceModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "size": obj.get("size"), + "nested": FirstRef.from_dict(obj["nested"]) if obj.get("nested") is not None else None + }) + return _obj + +from petstore_api.models.first_ref import FirstRef +# TODO: Rewrite to not use raise_errors +CircularReferenceModel.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py new file mode 100644 index 00000000000..6def0e52d14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ClassModel(BaseModel): + """ + Model for testing model with \"_class\" property + """ # noqa: E501 + var_class: Optional[StrictStr] = Field(default=None, alias="_class") + __properties: ClassVar[List[str]] = ["_class"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_class": obj.get("_class") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py new file mode 100644 index 00000000000..1c12c9a145c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Client(BaseModel): + """ + Client + """ # noqa: E501 + client: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["client"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Client from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Client from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client": obj.get("client") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py new file mode 100644 index 00000000000..bb740fb597d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from typing_extensions import Annotated +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] + +class Color(BaseModel): + """ + RGB array, RGBA array, or hex string. + """ + # data type: List[int] + oneof_schema_1_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=3, max_length=3)]] = Field(default=None, description="RGB three element array with values 0-255.") + # data type: List[int] + oneof_schema_2_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=4, max_length=4)]] = Field(default=None, description="RGBA four element array with values 0-255.") + # data type: str + oneof_schema_3_validator: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default=None, description="Hex color string, such as #00FF00.") + actual_instance: Optional[Union[List[int], str]] = None + one_of_schemas: Set[str] = { "List[int]", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + if v is None: + return v + + instance = Color.model_construct() + error_messages = [] + match = 0 + # validate data type: List[int] + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[int] + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.oneof_schema_3_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: Optional[str]) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + match = 0 + + # deserialize data into List[int] + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[int] + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_3_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[int], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py new file mode 100644 index 00000000000..2ed3aa42bf9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from petstore_api.models.creature_info import CreatureInfo +from typing import Optional, Set +from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.hunting_dog import HuntingDog + +class Creature(BaseModel): + """ + Creature + """ # noqa: E501 + info: CreatureInfo + type: StrictStr + __properties: ClassVar[List[str]] = ["info", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'Hunting__Dog': 'HuntingDog' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[HuntingDog]]: + """Create an instance of Creature from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of info + if self.info: + _dict['info'] = self.info.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[HuntingDog]]: + """Create an instance of Creature from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'HuntingDog': + return import_module("petstore_api.models.hunting_dog").HuntingDog.from_dict(obj) + + raise ValueError("Creature failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py new file mode 100644 index 00000000000..e7927446c23 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreatureInfo(BaseModel): + """ + CreatureInfo + """ # noqa: E501 + name: StrictStr + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreatureInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreatureInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py new file mode 100644 index 00000000000..061e16a486a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class DanishPig(BaseModel): + """ + DanishPig + """ # noqa: E501 + class_name: StrictStr = Field(alias="className") + size: StrictInt + __properties: ClassVar[List[str]] = ["className", "size"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DanishPig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DanishPig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "className": obj.get("className"), + "size": obj.get("size") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py new file mode 100644 index 00000000000..ee3df76c516 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class DataOutputFormat(str, Enum): + """ + DataOutputFormat + """ + + """ + allowed enum values + """ + JSON = 'JSON' + CSV = 'CSV' + XML = 'XML' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DataOutputFormat from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py new file mode 100644 index 00000000000..bb4747a1e18 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DeprecatedObject(BaseModel): + """ + DeprecatedObject + """ # noqa: E501 + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeprecatedObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeprecatedObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py new file mode 100644 index 00000000000..2e8d4a6d763 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict +from typing import Any, ClassVar, Dict, List +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper +from typing import Optional, Set +from typing_extensions import Self + +class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): + """ + DiscriminatorAllOfSub + """ # noqa: E501 + __properties: ClassVar[List[str]] = ["elementType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscriminatorAllOfSub from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscriminatorAllOfSub from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "elementType": obj.get("elementType") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py new file mode 100644 index 00000000000..ee910f90ea6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +class DiscriminatorAllOfSuper(BaseModel): + """ + DiscriminatorAllOfSuper + """ # noqa: E501 + element_type: StrictStr = Field(alias="elementType") + __properties: ClassVar[List[str]] = ["elementType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'elementType' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'DiscriminatorAllOfSub': 'DiscriminatorAllOfSub' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[DiscriminatorAllOfSub]]: + """Create an instance of DiscriminatorAllOfSuper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DiscriminatorAllOfSub]]: + """Create an instance of DiscriminatorAllOfSuper from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'DiscriminatorAllOfSub': + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) + + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py new file mode 100644 index 00000000000..a0f4ed786b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.animal import Animal +from typing import Optional, Set +from typing_extensions import Self + +class Dog(Animal): + """ + Dog + """ # noqa: E501 + breed: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["className", "color", "breed"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Dog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Dog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "className": obj.get("className"), + "color": obj.get("color") if obj.get("color") is not None else 'red', + "breed": obj.get("breed") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py new file mode 100644 index 00000000000..3050cbf66dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DummyModel(BaseModel): + """ + DummyModel + """ # noqa: E501 + category: Optional[StrictStr] = None + self_ref: Optional[SelfReferenceModel] = None + __properties: ClassVar[List[str]] = ["category", "self_ref"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DummyModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of self_ref + if self.self_ref: + _dict['self_ref'] = self.self_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DummyModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "self_ref": SelfReferenceModel.from_dict(obj["self_ref"]) if obj.get("self_ref") is not None else None + }) + return _obj + +from petstore_api.models.self_reference_model import SelfReferenceModel +# TODO: Rewrite to not use raise_errors +DummyModel.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py new file mode 100644 index 00000000000..68ceb962b03 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EnumArrays(BaseModel): + """ + EnumArrays + """ # noqa: E501 + just_symbol: Optional[StrictStr] = None + array_enum: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["just_symbol", "array_enum"] + + @field_validator('just_symbol') + def just_symbol_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['>=', '$']): + raise ValueError("must be one of enum values ('>=', '$')") + return value + + @field_validator('array_enum') + def array_enum_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['fish', 'crab']): + raise ValueError("each list item must be one of ('fish', 'crab')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EnumArrays from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EnumArrays from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "just_symbol": obj.get("just_symbol"), + "array_enum": obj.get("array_enum") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py new file mode 100644 index 00000000000..1ba5af8036d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EnumClass(str, Enum): + """ + EnumClass + """ + + """ + allowed enum values + """ + ABC = '_abc' + MINUS_EFG = '-efg' + LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS = '(xyz)' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EnumClass from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py new file mode 100644 index 00000000000..5588de5c704 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EnumNumberVendorExt(int, Enum): + """ + EnumNumberVendorExt + """ + + """ + allowed enum values + """ + FortyTwo = 42 + Eigtheen = 18 + FiftySix = 56 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EnumNumberVendorExt from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py new file mode 100644 index 00000000000..9d97e3fd16d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.data_output_format import DataOutputFormat +from typing import Optional, Set +from typing_extensions import Self + +class EnumRefWithDefaultValue(BaseModel): + """ + EnumRefWithDefaultValue + """ # noqa: E501 + report_format: Optional[DataOutputFormat] = DataOutputFormat.JSON + __properties: ClassVar[List[str]] = ["report_format"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EnumRefWithDefaultValue from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EnumRefWithDefaultValue from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "report_format": obj.get("report_format") if obj.get("report_format") is not None else DataOutputFormat.JSON + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py new file mode 100644 index 00000000000..678b4e12661 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EnumString1(str, Enum): + """ + EnumString1 + """ + + """ + allowed enum values + """ + A = 'a' + B = 'b' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EnumString1 from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py new file mode 100644 index 00000000000..a959f554e0a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EnumString2(str, Enum): + """ + EnumString2 + """ + + """ + allowed enum values + """ + C = 'c' + D = 'd' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EnumString2 from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py new file mode 100644 index 00000000000..821812e9b08 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EnumStringVendorExt(str, Enum): + """ + EnumStringVendorExt + """ + + """ + allowed enum values + """ + FOO_XEnumVarname = 'FOO' + BarVar_XEnumVarname = 'Bar' + bazVar_XEnumVarname = 'baz' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EnumStringVendorExt from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py new file mode 100644 index 00000000000..b7e6ec36230 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt +from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt +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 typing import Optional, Set +from typing_extensions import Self + +class EnumTest(BaseModel): + """ + EnumTest + """ # noqa: E501 + enum_string: Optional[StrictStr] = None + enum_string_required: StrictStr + enum_integer_default: Optional[StrictInt] = 5 + enum_integer: Optional[StrictInt] = None + enum_number: Optional[float] = None + enum_string_single_member: Optional[StrictStr] = None + enum_integer_single_member: Optional[StrictInt] = None + outer_enum: Optional[OuterEnum] = Field(default=None, alias="outerEnum") + outer_enum_integer: Optional[OuterEnumInteger] = Field(default=None, alias="outerEnumInteger") + outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=OuterEnumDefaultValue.PLACED, alias="outerEnumDefaultValue") + outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=OuterEnumIntegerDefaultValue.NUMBER_0, alias="outerEnumIntegerDefaultValue") + enum_number_vendor_ext: Optional[EnumNumberVendorExt] = Field(default=None, alias="enumNumberVendorExt") + enum_string_vendor_ext: Optional[EnumStringVendorExt] = Field(default=None, alias="enumStringVendorExt") + __properties: ClassVar[List[str]] = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "enum_string_single_member", "enum_integer_single_member", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue", "enumNumberVendorExt", "enumStringVendorExt"] + + @field_validator('enum_string') + def enum_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['UPPER', 'lower', '']): + raise ValueError("must be one of enum values ('UPPER', 'lower', '')") + return value + + @field_validator('enum_string_required') + def enum_string_required_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['UPPER', 'lower', '']): + raise ValueError("must be one of enum values ('UPPER', 'lower', '')") + return value + + @field_validator('enum_integer_default') + def enum_integer_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([1, 5, 14]): + raise ValueError("must be one of enum values (1, 5, 14)") + return value + + @field_validator('enum_integer') + def enum_integer_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([1, -1]): + raise ValueError("must be one of enum values (1, -1)") + return value + + @field_validator('enum_number') + def enum_number_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([1.1, -1.2]): + raise ValueError("must be one of enum values (1.1, -1.2)") + return value + + @field_validator('enum_string_single_member') + def enum_string_single_member_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['abc']): + raise ValueError("must be one of enum values ('abc')") + return value + + @field_validator('enum_integer_single_member') + def enum_integer_single_member_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([100]): + raise ValueError("must be one of enum values (100)") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EnumTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if outer_enum (nullable) is None + # and model_fields_set contains the field + if self.outer_enum is None and "outer_enum" in self.model_fields_set: + _dict['outerEnum'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EnumTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enum_string": obj.get("enum_string"), + "enum_string_required": obj.get("enum_string_required"), + "enum_integer_default": obj.get("enum_integer_default") if obj.get("enum_integer_default") is not None else 5, + "enum_integer": obj.get("enum_integer"), + "enum_number": obj.get("enum_number"), + "enum_string_single_member": obj.get("enum_string_single_member"), + "enum_integer_single_member": obj.get("enum_integer_single_member"), + "outerEnum": obj.get("outerEnum"), + "outerEnumInteger": obj.get("outerEnumInteger"), + "outerEnumDefaultValue": obj.get("outerEnumDefaultValue") if obj.get("outerEnumDefaultValue") is not None else OuterEnumDefaultValue.PLACED, + "outerEnumIntegerDefaultValue": obj.get("outerEnumIntegerDefaultValue") if obj.get("outerEnumIntegerDefaultValue") is not None else OuterEnumIntegerDefaultValue.NUMBER_0, + "enumNumberVendorExt": obj.get("enumNumberVendorExt"), + "enumStringVendorExt": obj.get("enumStringVendorExt") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py new file mode 100644 index 00000000000..1183b314fdd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Feeding(BaseModel): + """ + Feeding + """ # noqa: E501 + task_name: StrictStr + function_name: StrictStr + content: StrictStr + __properties: ClassVar[List[str]] = ["task_name", "function_name", "content"] + + @field_validator('task_name') + def task_name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['cleaning']): + raise ValueError("must be one of enum values ('cleaning')") + return value + + @field_validator('function_name') + def function_name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['care_nourish']): + raise ValueError("must be one of enum values ('care_nourish')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Feeding from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Feeding from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "task_name": obj.get("task_name"), + "function_name": obj.get("function_name"), + "content": obj.get("content") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py new file mode 100644 index 00000000000..0ecacf44bb8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class File(BaseModel): + """ + Must be named `File` for test. + """ # noqa: E501 + source_uri: Optional[StrictStr] = Field(default=None, description="Test capitalization", alias="sourceURI") + __properties: ClassVar[List[str]] = ["sourceURI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of File from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of File from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sourceURI": obj.get("sourceURI") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py new file mode 100644 index 00000000000..c533c0777b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.file import File +from typing import Optional, Set +from typing_extensions import Self + +class FileSchemaTestClass(BaseModel): + """ + FileSchemaTestClass + """ # noqa: E501 + file: Optional[File] = None + files: Optional[List[File]] = None + __properties: ClassVar[List[str]] = ["file", "files"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileSchemaTestClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of file + if self.file: + _dict['file'] = self.file.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in files (list) + _items = [] + if self.files: + for _item_files in self.files: + if _item_files: + _items.append(_item_files.to_dict()) + _dict['files'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileSchemaTestClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file": File.from_dict(obj["file"]) if obj.get("file") is not None else None, + "files": [File.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py new file mode 100644 index 00000000000..6aa0f722d87 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FirstRef(BaseModel): + """ + FirstRef + """ # noqa: E501 + category: Optional[StrictStr] = None + self_ref: Optional[SecondRef] = None + __properties: ClassVar[List[str]] = ["category", "self_ref"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FirstRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of self_ref + if self.self_ref: + _dict['self_ref'] = self.self_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FirstRef from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "self_ref": SecondRef.from_dict(obj["self_ref"]) if obj.get("self_ref") is not None else None + }) + return _obj + +from petstore_api.models.second_ref import SecondRef +# TODO: Rewrite to not use raise_errors +FirstRef.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py new file mode 100644 index 00000000000..67b29f1ab87 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Foo(BaseModel): + """ + Foo + """ # noqa: E501 + bar: Optional[StrictStr] = 'bar' + __properties: ClassVar[List[str]] = ["bar"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Foo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Foo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bar": obj.get("bar") if obj.get("bar") is not None else 'bar' + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py new file mode 100644 index 00000000000..ae191aad80a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.foo import Foo +from typing import Optional, Set +from typing_extensions import Self + +class FooGetDefaultResponse(BaseModel): + """ + FooGetDefaultResponse + """ # noqa: E501 + string: Optional[Foo] = None + __properties: ClassVar[List[str]] = ["string"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FooGetDefaultResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of string + if self.string: + _dict['string'] = self.string.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FooGetDefaultResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "string": Foo.from_dict(obj["string"]) if obj.get("string") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py new file mode 100644 index 00000000000..8d70a96f3a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from decimal import Decimal +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self + +class FormatTest(BaseModel): + """ + FormatTest + """ # noqa: E501 + integer: Optional[Annotated[int, Field(le=100, strict=True, ge=10)]] = None + int32: Optional[Annotated[int, Field(le=200, strict=True, ge=20)]] = None + int64: Optional[StrictInt] = None + number: Annotated[float, Field(le=543.2, ge=32.1)] + var_float: Optional[Annotated[float, Field(le=987.6, ge=54.3)]] = Field(default=None, alias="float") + double: Optional[Annotated[float, Field(le=123.4, ge=67.8)]] = None + decimal: Optional[Decimal] = None + string: Optional[Annotated[str, Field(strict=True)]] = None + string_with_double_quote_pattern: Optional[Annotated[str, Field(strict=True)]] = None + byte: Optional[Union[StrictBytes, StrictStr]] = None + binary: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None + var_date: date = Field(alias="date") + date_time: Optional[datetime] = Field(default=None, alias="dateTime") + uuid: Optional[UUID] = None + password: Annotated[str, Field(min_length=10, strict=True, max_length=64)] + pattern_with_digits: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A string that is a 10 digit number. Can have leading zeros.") + pattern_with_digits_and_delimiter: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + __properties: ClassVar[List[str]] = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "string_with_double_quote_pattern", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] + + @field_validator('string') + def string_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"[a-z]", value ,re.IGNORECASE): + raise ValueError(r"must validate the regular expression /[a-z]/i") + return value + + @field_validator('string_with_double_quote_pattern') + def string_with_double_quote_pattern_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"this is \"something\"", value): + raise ValueError(r"must validate the regular expression /this is \"something\"/") + return value + + @field_validator('pattern_with_digits') + def pattern_with_digits_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^\d{10}$", value): + raise ValueError(r"must validate the regular expression /^\d{10}$/") + return value + + @field_validator('pattern_with_digits_and_delimiter') + def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE): + raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FormatTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FormatTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "integer": obj.get("integer"), + "int32": obj.get("int32"), + "int64": obj.get("int64"), + "number": obj.get("number"), + "float": obj.get("float"), + "double": obj.get("double"), + "decimal": obj.get("decimal"), + "string": obj.get("string"), + "string_with_double_quote_pattern": obj.get("string_with_double_quote_pattern"), + "byte": obj.get("byte"), + "binary": obj.get("binary"), + "date": obj.get("date"), + "dateTime": obj.get("dateTime"), + "uuid": obj.get("uuid"), + "password": obj.get("password"), + "pattern_with_digits": obj.get("pattern_with_digits"), + "pattern_with_digits_and_delimiter": obj.get("pattern_with_digits_and_delimiter") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py new file mode 100644 index 00000000000..2137bc88048 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HasOnlyReadOnly(BaseModel): + """ + HasOnlyReadOnly + """ # noqa: E501 + bar: Optional[StrictStr] = None + foo: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bar", "foo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HasOnlyReadOnly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "bar", + "foo", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HasOnlyReadOnly from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bar": obj.get("bar"), + "foo": obj.get("foo") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py new file mode 100644 index 00000000000..4dbdd852097 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HealthCheckResult(BaseModel): + """ + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + """ # noqa: E501 + nullable_message: Optional[StrictStr] = Field(default=None, alias="NullableMessage") + __properties: ClassVar[List[str]] = ["NullableMessage"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HealthCheckResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if nullable_message (nullable) is None + # and model_fields_set contains the field + if self.nullable_message is None and "nullable_message" in self.model_fields_set: + _dict['NullableMessage'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HealthCheckResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "NullableMessage": obj.get("NullableMessage") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py new file mode 100644 index 00000000000..cd678616f62 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.creature import Creature +from petstore_api.models.creature_info import CreatureInfo +from typing import Optional, Set +from typing_extensions import Self + +class HuntingDog(Creature): + """ + HuntingDog + """ # noqa: E501 + is_trained: Optional[StrictBool] = Field(default=None, alias="isTrained") + __properties: ClassVar[List[str]] = ["info", "type", "isTrained"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HuntingDog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of info + if self.info: + _dict['info'] = self.info.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HuntingDog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "info": CreatureInfo.from_dict(obj["info"]) if obj.get("info") is not None else None, + "type": obj.get("type"), + "isTrained": obj.get("isTrained") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py new file mode 100644 index 00000000000..5a15b5f9f52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.base_discriminator import BaseDiscriminator +from typing import Optional, Set +from typing_extensions import Self + +class Info(BaseDiscriminator): + """ + Info + """ # noqa: E501 + val: Optional[BaseDiscriminator] = None + __properties: ClassVar[List[str]] = ["_typeName", "val"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Info from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of val + if self.val: + _dict['val'] = self.val.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Info from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_typeName": obj.get("_typeName"), + "val": BaseDiscriminator.from_dict(obj["val"]) if obj.get("val") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py new file mode 100644 index 00000000000..27816b995f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class InnerDictWithProperty(BaseModel): + """ + InnerDictWithProperty + """ # noqa: E501 + a_property: Optional[Dict[str, Any]] = Field(default=None, alias="aProperty") + __properties: ClassVar[List[str]] = ["aProperty"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InnerDictWithProperty from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InnerDictWithProperty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aProperty": obj.get("aProperty") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py new file mode 100644 index 00000000000..63870cca83e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.tag import Tag +from typing import Optional, Set +from typing_extensions import Self + +class InputAllOf(BaseModel): + """ + InputAllOf + """ # noqa: E501 + some_data: Optional[Dict[str, Tag]] = None + __properties: ClassVar[List[str]] = ["some_data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InputAllOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in some_data (dict) + _field_dict = {} + if self.some_data: + for _key_some_data in self.some_data: + if self.some_data[_key_some_data]: + _field_dict[_key_some_data] = self.some_data[_key_some_data].to_dict() + _dict['some_data'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InputAllOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "some_data": dict( + (_k, Tag.from_dict(_v)) + for _k, _v in obj["some_data"].items() + ) + if obj.get("some_data") is not None + else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py new file mode 100644 index 00000000000..f2a5a0a2d4a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from typing_extensions import Annotated +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] + +class IntOrString(BaseModel): + """ + IntOrString + """ + # data type: int + oneof_schema_1_validator: Optional[Annotated[int, Field(strict=True, ge=10)]] = None + # data type: str + oneof_schema_2_validator: Optional[StrictStr] = None + actual_instance: Optional[Union[int, str]] = None + one_of_schemas: Set[str] = { "int", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = IntOrString.model_construct() + error_messages = [] + match = 0 + # validate data type: int + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into int + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py new file mode 100644 index 00000000000..ab12a7fac52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ListClass(BaseModel): + """ + ListClass + """ # noqa: E501 + var_123_list: Optional[StrictStr] = Field(default=None, alias="123-list") + __properties: ClassVar[List[str]] = ["123-list"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "123-list": obj.get("123-list") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py new file mode 100644 index 00000000000..a9bd000ad9b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.tag import Tag +from typing import Optional, Set +from typing_extensions import Self + +class MapOfArrayOfModel(BaseModel): + """ + MapOfArrayOfModel + """ # noqa: E501 + shop_id_to_org_online_lip_map: Optional[Dict[str, List[Tag]]] = Field(default=None, alias="shopIdToOrgOnlineLipMap") + __properties: ClassVar[List[str]] = ["shopIdToOrgOnlineLipMap"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MapOfArrayOfModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in shop_id_to_org_online_lip_map (dict of array) + _field_dict_of_array = {} + if self.shop_id_to_org_online_lip_map: + for _key_shop_id_to_org_online_lip_map in self.shop_id_to_org_online_lip_map: + if self.shop_id_to_org_online_lip_map[_key_shop_id_to_org_online_lip_map] is not None: + _field_dict_of_array[_key_shop_id_to_org_online_lip_map] = [ + _item.to_dict() for _item in self.shop_id_to_org_online_lip_map[_key_shop_id_to_org_online_lip_map] + ] + _dict['shopIdToOrgOnlineLipMap'] = _field_dict_of_array + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MapOfArrayOfModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shopIdToOrgOnlineLipMap": dict( + (_k, + [Tag.from_dict(_item) for _item in _v] + if _v is not None + else None + ) + for _k, _v in obj.get("shopIdToOrgOnlineLipMap", {}).items() + ) + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py new file mode 100644 index 00000000000..2a056ab5532 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class MapTest(BaseModel): + """ + MapTest + """ # noqa: E501 + map_map_of_string: Optional[Dict[str, Dict[str, StrictStr]]] = None + map_of_enum_string: Optional[Dict[str, StrictStr]] = None + direct_map: Optional[Dict[str, StrictBool]] = None + indirect_map: Optional[Dict[str, StrictBool]] = None + __properties: ClassVar[List[str]] = ["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map"] + + @field_validator('map_of_enum_string') + def map_of_enum_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value.values(): + if i not in set(['UPPER', 'lower']): + raise ValueError("dict values must be one of enum values ('UPPER', 'lower')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MapTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MapTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "map_map_of_string": obj.get("map_map_of_string"), + "map_of_enum_string": obj.get("map_of_enum_string"), + "direct_map": obj.get("direct_map"), + "indirect_map": obj.get("indirect_map") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..46998dfb5c6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from petstore_api.models.animal import Animal +from typing import Optional, Set +from typing_extensions import Self + +class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): + """ + MixedPropertiesAndAdditionalPropertiesClass + """ # noqa: E501 + uuid: Optional[UUID] = None + date_time: Optional[datetime] = Field(default=None, alias="dateTime") + map: Optional[Dict[str, Animal]] = None + __properties: ClassVar[List[str]] = ["uuid", "dateTime", "map"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in map (dict) + _field_dict = {} + if self.map: + for _key_map in self.map: + if self.map[_key_map]: + _field_dict[_key_map] = self.map[_key_map].to_dict() + _dict['map'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "uuid": obj.get("uuid"), + "dateTime": obj.get("dateTime"), + "map": dict( + (_k, Animal.from_dict(_v)) + for _k, _v in obj["map"].items() + ) + if obj.get("map") is not None + else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py new file mode 100644 index 00000000000..d6012c57fbd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Model200Response(BaseModel): + """ + Model for testing model name starting with number + """ # noqa: E501 + name: Optional[StrictInt] = None + var_class: Optional[StrictStr] = Field(default=None, alias="class") + __properties: ClassVar[List[str]] = ["name", "class"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Model200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Model200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "class": obj.get("class") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py new file mode 100644 index 00000000000..005c77823be --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ModelApiResponse(BaseModel): + """ + ModelApiResponse + """ # noqa: E501 + code: Optional[StrictInt] = None + type: Optional[StrictStr] = None + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "type", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ModelApiResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ModelApiResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "type": obj.get("type"), + "message": obj.get("message") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py new file mode 100644 index 00000000000..9e36a6ac7e4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ModelField(BaseModel): + """ + ModelField + """ # noqa: E501 + var_field: Optional[StrictStr] = Field(default=None, alias="field") + __properties: ClassVar[List[str]] = ["field"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ModelField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ModelField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "field": obj.get("field") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py new file mode 100644 index 00000000000..a8c0f53f6c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ModelReturn(BaseModel): + """ + Model for testing reserved words + """ # noqa: E501 + var_return: Optional[StrictInt] = Field(default=None, alias="return") + __properties: ClassVar[List[str]] = ["return"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ModelReturn from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ModelReturn from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "return": obj.get("return") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py new file mode 100644 index 00000000000..177a8359468 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.file import File +from petstore_api.models.tag import Tag +from typing import Optional, Set +from typing_extensions import Self + +class MultiArrays(BaseModel): + """ + MultiArrays + """ # noqa: E501 + tags: Optional[List[Tag]] = None + files: Optional[List[File]] = Field(default=None, description="Another array of objects in addition to tags (mypy check to not to reuse the same iterator)") + __properties: ClassVar[List[str]] = ["tags", "files"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MultiArrays from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tags (list) + _items = [] + if self.tags: + for _item_tags in self.tags: + if _item_tags: + _items.append(_item_tags.to_dict()) + _dict['tags'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in files (list) + _items = [] + if self.files: + for _item_files in self.files: + if _item_files: + _items.append(_item_files.to_dict()) + _dict['files'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiArrays from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tags": [Tag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, + "files": [File.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py new file mode 100644 index 00000000000..f33b2ecb18b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Name(BaseModel): + """ + Model for testing model name same as property name + """ # noqa: E501 + name: StrictInt + snake_case: Optional[StrictInt] = None + var_property: Optional[StrictStr] = Field(default=None, alias="property") + var_123_number: Optional[StrictInt] = Field(default=None, alias="123Number") + __properties: ClassVar[List[str]] = ["name", "snake_case", "property", "123Number"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Name from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "snake_case", + "var_123_number", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Name from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "snake_case": obj.get("snake_case"), + "property": obj.get("property"), + "123Number": obj.get("123Number") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py new file mode 100644 index 00000000000..9d141495483 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NullableClass(BaseModel): + """ + NullableClass + """ # noqa: E501 + required_integer_prop: Optional[StrictInt] + integer_prop: Optional[StrictInt] = None + number_prop: Optional[float] = None + boolean_prop: Optional[StrictBool] = None + string_prop: Optional[StrictStr] = None + date_prop: Optional[date] = None + datetime_prop: Optional[datetime] = None + array_nullable_prop: Optional[List[Dict[str, Any]]] = None + array_and_items_nullable_prop: Optional[List[Optional[Dict[str, Any]]]] = None + array_items_nullable: Optional[List[Optional[Dict[str, Any]]]] = None + object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None + object_and_items_nullable_prop: Optional[Dict[str, Optional[Dict[str, Any]]]] = None + object_items_nullable: Optional[Dict[str, Optional[Dict[str, Any]]]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NullableClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if required_integer_prop (nullable) is None + # and model_fields_set contains the field + if self.required_integer_prop is None and "required_integer_prop" in self.model_fields_set: + _dict['required_integer_prop'] = None + + # set to None if integer_prop (nullable) is None + # and model_fields_set contains the field + if self.integer_prop is None and "integer_prop" in self.model_fields_set: + _dict['integer_prop'] = None + + # set to None if number_prop (nullable) is None + # and model_fields_set contains the field + if self.number_prop is None and "number_prop" in self.model_fields_set: + _dict['number_prop'] = None + + # set to None if boolean_prop (nullable) is None + # and model_fields_set contains the field + if self.boolean_prop is None and "boolean_prop" in self.model_fields_set: + _dict['boolean_prop'] = None + + # set to None if string_prop (nullable) is None + # and model_fields_set contains the field + if self.string_prop is None and "string_prop" in self.model_fields_set: + _dict['string_prop'] = None + + # set to None if date_prop (nullable) is None + # and model_fields_set contains the field + if self.date_prop is None and "date_prop" in self.model_fields_set: + _dict['date_prop'] = None + + # set to None if datetime_prop (nullable) is None + # and model_fields_set contains the field + if self.datetime_prop is None and "datetime_prop" in self.model_fields_set: + _dict['datetime_prop'] = None + + # set to None if array_nullable_prop (nullable) is None + # and model_fields_set contains the field + if self.array_nullable_prop is None and "array_nullable_prop" in self.model_fields_set: + _dict['array_nullable_prop'] = None + + # set to None if array_and_items_nullable_prop (nullable) is None + # and model_fields_set contains the field + if self.array_and_items_nullable_prop is None and "array_and_items_nullable_prop" in self.model_fields_set: + _dict['array_and_items_nullable_prop'] = None + + # set to None if object_nullable_prop (nullable) is None + # and model_fields_set contains the field + if self.object_nullable_prop is None and "object_nullable_prop" in self.model_fields_set: + _dict['object_nullable_prop'] = None + + # set to None if object_and_items_nullable_prop (nullable) is None + # and model_fields_set contains the field + if self.object_and_items_nullable_prop is None and "object_and_items_nullable_prop" in self.model_fields_set: + _dict['object_and_items_nullable_prop'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NullableClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "required_integer_prop": obj.get("required_integer_prop"), + "integer_prop": obj.get("integer_prop"), + "number_prop": obj.get("number_prop"), + "boolean_prop": obj.get("boolean_prop"), + "string_prop": obj.get("string_prop"), + "date_prop": obj.get("date_prop"), + "datetime_prop": obj.get("datetime_prop"), + "array_nullable_prop": obj.get("array_nullable_prop"), + "array_and_items_nullable_prop": obj.get("array_and_items_nullable_prop"), + "array_items_nullable": obj.get("array_items_nullable"), + "object_nullable_prop": obj.get("object_nullable_prop"), + "object_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"), + "object_items_nullable": obj.get("object_items_nullable") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py new file mode 100644 index 00000000000..2324745d7dd --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class NullableProperty(BaseModel): + """ + NullableProperty + """ # noqa: E501 + id: StrictInt + name: Optional[Annotated[str, Field(strict=True)]] + __properties: ClassVar[List[str]] = ["id", "name"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[A-Z].*", value): + raise ValueError(r"must validate the regular expression /^[A-Z].*/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NullableProperty from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NullableProperty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py new file mode 100644 index 00000000000..18c3ec95308 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NumberOnly(BaseModel): + """ + NumberOnly + """ # noqa: E501 + just_number: Optional[float] = Field(default=None, alias="JustNumber") + __properties: ClassVar[List[str]] = ["JustNumber"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NumberOnly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NumberOnly from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "JustNumber": obj.get("JustNumber") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py new file mode 100644 index 00000000000..22b8bd401a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ObjectToTestAdditionalProperties(BaseModel): + """ + Minimal object + """ # noqa: E501 + var_property: Optional[StrictBool] = Field(default=False, description="Property", alias="property") + __properties: ClassVar[List[str]] = ["property"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ObjectToTestAdditionalProperties from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ObjectToTestAdditionalProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "property": obj.get("property") if obj.get("property") is not None else False + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py new file mode 100644 index 00000000000..4d76d9f5fc7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.deprecated_object import DeprecatedObject +from typing import Optional, Set +from typing_extensions import Self + +class ObjectWithDeprecatedFields(BaseModel): + """ + ObjectWithDeprecatedFields + """ # noqa: E501 + uuid: Optional[StrictStr] = None + id: Optional[float] = None + deprecated_ref: Optional[DeprecatedObject] = Field(default=None, alias="deprecatedRef") + bars: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["uuid", "id", "deprecatedRef", "bars"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ObjectWithDeprecatedFields from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of deprecated_ref + if self.deprecated_ref: + _dict['deprecatedRef'] = self.deprecated_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ObjectWithDeprecatedFields from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "uuid": obj.get("uuid"), + "id": obj.get("id"), + "deprecatedRef": DeprecatedObject.from_dict(obj["deprecatedRef"]) if obj.get("deprecatedRef") is not None else None, + "bars": obj.get("bars") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py new file mode 100644 index 00000000000..53101c37cc8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OneOfEnumString(str, Enum): + """ + oneOf enum strings + """ + + """ + allowed enum values + """ + A = 'a' + B = 'b' + C = 'c' + D = 'd' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OneOfEnumString from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py new file mode 100644 index 00000000000..f742027e088 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Order(BaseModel): + """ + Order + """ # noqa: E501 + id: Optional[StrictInt] = None + pet_id: Optional[StrictInt] = Field(default=None, alias="petId") + quantity: Optional[StrictInt] = None + ship_date: Optional[datetime] = Field(default=None, alias="shipDate") + status: Optional[StrictStr] = Field(default=None, description="Order Status") + complete: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["id", "petId", "quantity", "shipDate", "status", "complete"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['placed', 'approved', 'delivered']): + raise ValueError("must be one of enum values ('placed', 'approved', 'delivered')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Order from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Order from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "petId": obj.get("petId"), + "quantity": obj.get("quantity"), + "shipDate": obj.get("shipDate"), + "status": obj.get("status"), + "complete": obj.get("complete") if obj.get("complete") is not None else False + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py new file mode 100644 index 00000000000..6a82d49970c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class OuterComposite(BaseModel): + """ + OuterComposite + """ # noqa: E501 + my_number: Optional[float] = None + my_string: Optional[StrictStr] = None + my_boolean: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["my_number", "my_string", "my_boolean"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OuterComposite from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OuterComposite from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "my_number": obj.get("my_number"), + "my_string": obj.get("my_string"), + "my_boolean": obj.get("my_boolean") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py new file mode 100644 index 00000000000..ac48cc0dc4d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OuterEnum(str, Enum): + """ + OuterEnum + """ + + """ + allowed enum values + """ + PLACED = 'placed' + APPROVED = 'approved' + DELIVERED = 'delivered' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OuterEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py new file mode 100644 index 00000000000..99d6fd5fc04 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OuterEnumDefaultValue(str, Enum): + """ + OuterEnumDefaultValue + """ + + """ + allowed enum values + """ + PLACED = 'placed' + APPROVED = 'approved' + DELIVERED = 'delivered' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OuterEnumDefaultValue from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py new file mode 100644 index 00000000000..b771b7a61f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OuterEnumInteger(int, Enum): + """ + OuterEnumInteger + """ + + """ + allowed enum values + """ + NUMBER_0 = 0 + NUMBER_1 = 1 + NUMBER_2 = 2 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OuterEnumInteger from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py new file mode 100644 index 00000000000..8df41b2bd32 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OuterEnumIntegerDefaultValue(int, Enum): + """ + OuterEnumIntegerDefaultValue + """ + + """ + allowed enum values + """ + NUMBER_MINUS_1 = -1 + NUMBER_0 = 0 + NUMBER_1 = 1 + NUMBER_2 = 2 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OuterEnumIntegerDefaultValue from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py new file mode 100644 index 00000000000..4f453c2a8d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from typing import Optional, Set +from typing_extensions import Self + +class OuterObjectWithEnumProperty(BaseModel): + """ + OuterObjectWithEnumProperty + """ # noqa: E501 + str_value: Optional[OuterEnum] = None + value: OuterEnumInteger + __properties: ClassVar[List[str]] = ["str_value", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OuterObjectWithEnumProperty from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if str_value (nullable) is None + # and model_fields_set contains the field + if self.str_value is None and "str_value" in self.model_fields_set: + _dict['str_value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OuterObjectWithEnumProperty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "str_value": obj.get("str_value"), + "value": obj.get("value") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py new file mode 100644 index 00000000000..5986da45ab0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty +from typing import Optional, Set +from typing_extensions import Self + +class Parent(BaseModel): + """ + Parent + """ # noqa: E501 + optional_dict: Optional[Dict[str, InnerDictWithProperty]] = Field(default=None, alias="optionalDict") + __properties: ClassVar[List[str]] = ["optionalDict"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Parent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in optional_dict (dict) + _field_dict = {} + if self.optional_dict: + for _key_optional_dict in self.optional_dict: + if self.optional_dict[_key_optional_dict]: + _field_dict[_key_optional_dict] = self.optional_dict[_key_optional_dict].to_dict() + _dict['optionalDict'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Parent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "optionalDict": dict( + (_k, InnerDictWithProperty.from_dict(_v)) + for _k, _v in obj["optionalDict"].items() + ) + if obj.get("optionalDict") is not None + else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py new file mode 100644 index 00000000000..84445b64043 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty +from typing import Optional, Set +from typing_extensions import Self + +class ParentWithOptionalDict(BaseModel): + """ + ParentWithOptionalDict + """ # noqa: E501 + optional_dict: Optional[Dict[str, InnerDictWithProperty]] = Field(default=None, alias="optionalDict") + __properties: ClassVar[List[str]] = ["optionalDict"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParentWithOptionalDict from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in optional_dict (dict) + _field_dict = {} + if self.optional_dict: + for _key_optional_dict in self.optional_dict: + if self.optional_dict[_key_optional_dict]: + _field_dict[_key_optional_dict] = self.optional_dict[_key_optional_dict].to_dict() + _dict['optionalDict'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParentWithOptionalDict from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "optionalDict": dict( + (_k, InnerDictWithProperty.from_dict(_v)) + for _k, _v in obj["optionalDict"].items() + ) + if obj.get("optionalDict") is not None + else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py new file mode 100644 index 00000000000..be47c3b1a89 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from petstore_api.models.category import Category +from petstore_api.models.tag import Tag +from typing import Optional, Set +from typing_extensions import Self + +class Pet(BaseModel): + """ + Pet + """ # noqa: E501 + id: Optional[StrictInt] = None + category: Optional[Category] = None + name: StrictStr + photo_urls: Annotated[List[StrictStr], Field(min_length=0)] = Field(alias="photoUrls") + tags: Optional[List[Tag]] = None + status: Optional[StrictStr] = Field(default=None, description="pet status in the store") + __properties: ClassVar[List[str]] = ["id", "category", "name", "photoUrls", "tags", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['available', 'pending', 'sold']): + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Pet from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of category + if self.category: + _dict['category'] = self.category.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in tags (list) + _items = [] + if self.tags: + for _item_tags in self.tags: + if _item_tags: + _items.append(_item_tags.to_dict()) + _dict['tags'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Pet from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "category": Category.from_dict(obj["category"]) if obj.get("category") is not None else None, + "name": obj.get("name"), + "photoUrls": obj.get("photoUrls"), + "tags": [Tag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, + "status": obj.get("status") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py new file mode 100644 index 00000000000..b3a759e89b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from petstore_api.models.basque_pig import BasquePig +from petstore_api.models.danish_pig import DanishPig +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] + +class Pig(BaseModel): + """ + Pig + """ + # data type: BasquePig + oneof_schema_1_validator: Optional[BasquePig] = None + # data type: DanishPig + oneof_schema_2_validator: Optional[DanishPig] = None + actual_instance: Optional[Union[BasquePig, DanishPig]] = None + one_of_schemas: Set[str] = { "BasquePig", "DanishPig" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = Pig.model_construct() + error_messages = [] + match = 0 + # validate data type: BasquePig + if not isinstance(v, BasquePig): + error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`") + else: + match += 1 + # validate data type: DanishPig + if not isinstance(v, DanishPig): + error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into BasquePig + try: + instance.actual_instance = BasquePig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DanishPig + try: + instance.actual_instance = DanishPig.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], BasquePig, DanishPig]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py new file mode 100644 index 00000000000..00bd3865957 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.type import Type +from typing import Optional, Set +from typing_extensions import Self + +class PonySizes(BaseModel): + """ + PonySizes + """ # noqa: E501 + type: Optional[Type] = None + __properties: ClassVar[List[str]] = ["type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PonySizes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PonySizes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py new file mode 100644 index 00000000000..047cf0d481a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class PoopCleaning(BaseModel): + """ + PoopCleaning + """ # noqa: E501 + task_name: StrictStr + function_name: StrictStr + content: StrictStr + __properties: ClassVar[List[str]] = ["task_name", "function_name", "content"] + + @field_validator('task_name') + def task_name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['cleaning']): + raise ValueError("must be one of enum values ('cleaning')") + return value + + @field_validator('function_name') + def function_name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['care']): + raise ValueError("must be one of enum values ('care')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PoopCleaning from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PoopCleaning from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "task_name": obj.get("task_name"), + "function_name": obj.get("function_name"), + "content": obj.get("content") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py new file mode 100644 index 00000000000..5a706559786 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.base_discriminator import BaseDiscriminator +from typing import Optional, Set +from typing_extensions import Self + +class PrimitiveString(BaseDiscriminator): + """ + PrimitiveString + """ # noqa: E501 + value: Optional[StrictStr] = Field(default=None, alias="_value") + __properties: ClassVar[List[str]] = ["_typeName", "_value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PrimitiveString from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrimitiveString from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_typeName": obj.get("_typeName"), + "_value": obj.get("_value") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py new file mode 100644 index 00000000000..940016a86a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.tag import Tag +from typing import Optional, Set +from typing_extensions import Self + +class PropertyMap(BaseModel): + """ + PropertyMap + """ # noqa: E501 + some_data: Optional[Dict[str, Tag]] = None + __properties: ClassVar[List[str]] = ["some_data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PropertyMap from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in some_data (dict) + _field_dict = {} + if self.some_data: + for _key_some_data in self.some_data: + if self.some_data[_key_some_data]: + _field_dict[_key_some_data] = self.some_data[_key_some_data].to_dict() + _dict['some_data'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PropertyMap from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "some_data": dict( + (_k, Tag.from_dict(_v)) + for _k, _v in obj["some_data"].items() + ) + if obj.get("some_data") is not None + else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py new file mode 100644 index 00000000000..0eb56422b64 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PropertyNameCollision(BaseModel): + """ + PropertyNameCollision + """ # noqa: E501 + underscore_type: Optional[StrictStr] = Field(default=None, alias="_type") + type: Optional[StrictStr] = None + type_with_underscore: Optional[StrictStr] = Field(default=None, alias="type_") + __properties: ClassVar[List[str]] = ["_type", "type", "type_"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PropertyNameCollision from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PropertyNameCollision from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_type": obj.get("_type"), + "type": obj.get("type"), + "type_": obj.get("type_") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py new file mode 100644 index 00000000000..c9f4fc6c0df --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReadOnlyFirst(BaseModel): + """ + ReadOnlyFirst + """ # noqa: E501 + bar: Optional[StrictStr] = None + baz: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bar", "baz"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReadOnlyFirst from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "bar", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReadOnlyFirst from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bar": obj.get("bar"), + "baz": obj.get("baz") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py new file mode 100644 index 00000000000..854749b4fb1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SecondCircularAllOfRef(BaseModel): + """ + SecondCircularAllOfRef + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, alias="_name") + circular_all_of_ref: Optional[List[CircularAllOfRef]] = Field(default=None, alias="circularAllOfRef") + __properties: ClassVar[List[str]] = ["_name", "circularAllOfRef"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SecondCircularAllOfRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in circular_all_of_ref (list) + _items = [] + if self.circular_all_of_ref: + for _item_circular_all_of_ref in self.circular_all_of_ref: + if _item_circular_all_of_ref: + _items.append(_item_circular_all_of_ref.to_dict()) + _dict['circularAllOfRef'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SecondCircularAllOfRef from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_name": obj.get("_name"), + "circularAllOfRef": [CircularAllOfRef.from_dict(_item) for _item in obj["circularAllOfRef"]] if obj.get("circularAllOfRef") is not None else None + }) + return _obj + +from petstore_api.models.circular_all_of_ref import CircularAllOfRef +# TODO: Rewrite to not use raise_errors +SecondCircularAllOfRef.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py new file mode 100644 index 00000000000..c6627cf0ba6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SecondRef(BaseModel): + """ + SecondRef + """ # noqa: E501 + category: Optional[StrictStr] = None + circular_ref: Optional[CircularReferenceModel] = None + __properties: ClassVar[List[str]] = ["category", "circular_ref"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SecondRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of circular_ref + if self.circular_ref: + _dict['circular_ref'] = self.circular_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SecondRef from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "circular_ref": CircularReferenceModel.from_dict(obj["circular_ref"]) if obj.get("circular_ref") is not None else None + }) + return _obj + +from petstore_api.models.circular_reference_model import CircularReferenceModel +# TODO: Rewrite to not use raise_errors +SecondRef.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py new file mode 100644 index 00000000000..7c145db0d3a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SelfReferenceModel(BaseModel): + """ + SelfReferenceModel + """ # noqa: E501 + size: Optional[StrictInt] = None + nested: Optional[DummyModel] = None + __properties: ClassVar[List[str]] = ["size", "nested"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SelfReferenceModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of nested + if self.nested: + _dict['nested'] = self.nested.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfReferenceModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "size": obj.get("size"), + "nested": DummyModel.from_dict(obj["nested"]) if obj.get("nested") is not None else None + }) + return _obj + +from petstore_api.models.dummy_model import DummyModel +# TODO: Rewrite to not use raise_errors +SelfReferenceModel.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py new file mode 100644 index 00000000000..91ab07e2535 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SingleRefType(str, Enum): + """ + SingleRefType + """ + + """ + allowed enum values + """ + ADMIN = 'admin' + USER = 'user' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SingleRefType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py new file mode 100644 index 00000000000..1d85fd148d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SpecialCharacterEnum(str, Enum): + """ + SpecialCharacterEnum + """ + + """ + allowed enum values + """ + ENUM_456 = '456' + ENUM_123ABC = '123abc' + UNDERSCORE = '_' + SPACE = ' ' + AMPERSAND = '&' + DOLLAR = '$' + GREATER_THAN_EQUAL = '>=' + THIS_IS_EXCLAMATION = 'this_is_!' + IMPORT = 'import' + HELLO_WORLD = ' hello world ' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpecialCharacterEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py new file mode 100644 index 00000000000..0336e24d17d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SpecialModelName(BaseModel): + """ + SpecialModelName + """ # noqa: E501 + special_property_name: Optional[StrictInt] = Field(default=None, alias="$special[property.name]") + __properties: ClassVar[List[str]] = ["$special[property.name]"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpecialModelName from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpecialModelName from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$special[property.name]": obj.get("$special[property.name]") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py new file mode 100644 index 00000000000..d3c8f618568 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.category import Category +from typing import Optional, Set +from typing_extensions import Self + +class SpecialName(BaseModel): + """ + SpecialName + """ # noqa: E501 + var_property: Optional[StrictInt] = Field(default=None, alias="property") + var_async: Optional[Category] = Field(default=None, alias="async") + var_schema: Optional[StrictStr] = Field(default=None, description="pet status in the store", alias="schema") + __properties: ClassVar[List[str]] = ["property", "async", "schema"] + + @field_validator('var_schema') + def var_schema_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['available', 'pending', 'sold']): + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpecialName from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_async + if self.var_async: + _dict['async'] = self.var_async.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpecialName from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "property": obj.get("property"), + "async": Category.from_dict(obj["async"]) if obj.get("async") is not None else None, + "schema": obj.get("schema") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py new file mode 100644 index 00000000000..e5ddcbcd4a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Tag(BaseModel): + """ + Tag + """ # noqa: E501 + id: Optional[StrictInt] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Tag from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Tag from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py new file mode 100644 index 00000000000..312b2c8ee47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from uuid import UUID +from petstore_api.models.task_activity import TaskActivity +from typing import Optional, Set +from typing_extensions import Self + +class Task(BaseModel): + """ + Used to test oneOf enums with only one string value. + """ # noqa: E501 + id: UUID + activity: TaskActivity + __properties: ClassVar[List[str]] = ["id", "activity"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Task from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of activity + if self.activity: + _dict['activity'] = self.activity.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Task from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "activity": TaskActivity.from_dict(obj["activity"]) if obj.get("activity") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py new file mode 100644 index 00000000000..cc1e1fc5a60 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from petstore_api.models.bathing import Bathing +from petstore_api.models.feeding import Feeding +from petstore_api.models.poop_cleaning import PoopCleaning +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +TASKACTIVITY_ONE_OF_SCHEMAS = ["Bathing", "Feeding", "PoopCleaning"] + +class TaskActivity(BaseModel): + """ + TaskActivity + """ + # data type: PoopCleaning + oneof_schema_1_validator: Optional[PoopCleaning] = None + # data type: Feeding + oneof_schema_2_validator: Optional[Feeding] = None + # data type: Bathing + oneof_schema_3_validator: Optional[Bathing] = None + actual_instance: Optional[Union[Bathing, Feeding, PoopCleaning]] = None + one_of_schemas: Set[str] = { "Bathing", "Feeding", "PoopCleaning" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = TaskActivity.model_construct() + error_messages = [] + match = 0 + # validate data type: PoopCleaning + if not isinstance(v, PoopCleaning): + error_messages.append(f"Error! Input type `{type(v)}` is not `PoopCleaning`") + else: + match += 1 + # validate data type: Feeding + if not isinstance(v, Feeding): + error_messages.append(f"Error! Input type `{type(v)}` is not `Feeding`") + else: + match += 1 + # validate data type: Bathing + if not isinstance(v, Bathing): + error_messages.append(f"Error! Input type `{type(v)}` is not `Bathing`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into PoopCleaning + try: + instance.actual_instance = PoopCleaning.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Feeding + try: + instance.actual_instance = Feeding.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Bathing + try: + instance.actual_instance = Bathing.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Bathing, Feeding, PoopCleaning]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py new file mode 100644 index 00000000000..8eae227a84e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TestEnum(str, Enum): + """ + TestEnum + """ + + """ + allowed enum values + """ + ONE = 'ONE' + TWO = 'TWO' + THREE = 'THREE' + FOUR = 'foUr' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py new file mode 100644 index 00000000000..9304d3ab849 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TestEnumWithDefault(str, Enum): + """ + TestEnumWithDefault + """ + + """ + allowed enum values + """ + EIN = 'EIN' + ZWEI = 'ZWEI' + DREI = 'DREI' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestEnumWithDefault from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py new file mode 100644 index 00000000000..cba4ab845e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestErrorResponsesWithModel400Response(BaseModel): + """ + TestErrorResponsesWithModel400Response + """ # noqa: E501 + reason400: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["reason400"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestErrorResponsesWithModel400Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestErrorResponsesWithModel400Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "reason400": obj.get("reason400") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py new file mode 100644 index 00000000000..787ca11942a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestErrorResponsesWithModel404Response(BaseModel): + """ + TestErrorResponsesWithModel404Response + """ # noqa: E501 + reason404: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["reason404"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestErrorResponsesWithModel404Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestErrorResponsesWithModel404Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "reason404": obj.get("reason404") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py new file mode 100644 index 00000000000..7b93d84864f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): + """ + TestInlineFreeformAdditionalPropertiesRequest + """ # noqa: E501 + some_property: Optional[StrictStr] = Field(default=None, alias="someProperty") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["someProperty"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "someProperty": obj.get("someProperty") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py new file mode 100644 index 00000000000..218fa8f16d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault +from typing import Optional, Set +from typing_extensions import Self + +class TestModelWithEnumDefault(BaseModel): + """ + TestModelWithEnumDefault + """ # noqa: E501 + test_enum: TestEnum + test_string: Optional[StrictStr] = None + test_enum_with_default: Optional[TestEnumWithDefault] = TestEnumWithDefault.ZWEI + test_string_with_default: Optional[StrictStr] = 'ahoy matey' + test_inline_defined_enum_with_default: Optional[StrictStr] = 'B' + __properties: ClassVar[List[str]] = ["test_enum", "test_string", "test_enum_with_default", "test_string_with_default", "test_inline_defined_enum_with_default"] + + @field_validator('test_inline_defined_enum_with_default') + def test_inline_defined_enum_with_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['A', 'B', 'C']): + raise ValueError("must be one of enum values ('A', 'B', 'C')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestModelWithEnumDefault from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestModelWithEnumDefault from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_enum": obj.get("test_enum"), + "test_string": obj.get("test_string"), + "test_enum_with_default": obj.get("test_enum_with_default") if obj.get("test_enum_with_default") is not None else TestEnumWithDefault.ZWEI, + "test_string_with_default": obj.get("test_string_with_default") if obj.get("test_string_with_default") is not None else 'ahoy matey', + "test_inline_defined_enum_with_default": obj.get("test_inline_defined_enum_with_default") if obj.get("test_inline_defined_enum_with_default") is not None else 'B' + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py new file mode 100644 index 00000000000..a5c3bfdbb1b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestObjectForMultipartRequestsRequestMarker(BaseModel): + """ + TestObjectForMultipartRequestsRequestMarker + """ # noqa: E501 + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestObjectForMultipartRequestsRequestMarker from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestObjectForMultipartRequestsRequestMarker from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py new file mode 100644 index 00000000000..bf8cbf0596a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Tiger(BaseModel): + """ + Tiger + """ # noqa: E501 + skill: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["skill"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Tiger from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Tiger from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "skill": obj.get("skill") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py new file mode 100644 index 00000000000..35a847de894 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class Type(int, Enum): + """ + Type + """ + + """ + allowed enum values + """ + NUMBER_2_DOT_0 = 2.0 + NUMBER_1_DOT_0 = 1.0 + NUMBER_0_DOT_5 = 0.5 + NUMBER_0_DOT_25 = 0.25 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Type from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py new file mode 100644 index 00000000000..e50edf2efa8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.creature_info import CreatureInfo +from typing import Optional, Set +from typing_extensions import Self + +class UnnamedDictWithAdditionalModelListProperties(BaseModel): + """ + UnnamedDictWithAdditionalModelListProperties + """ # noqa: E501 + dict_property: Optional[Dict[str, List[CreatureInfo]]] = Field(default=None, alias="dictProperty") + __properties: ClassVar[List[str]] = ["dictProperty"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnnamedDictWithAdditionalModelListProperties from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in dict_property (dict of array) + _field_dict_of_array = {} + if self.dict_property: + for _key_dict_property in self.dict_property: + if self.dict_property[_key_dict_property] is not None: + _field_dict_of_array[_key_dict_property] = [ + _item.to_dict() for _item in self.dict_property[_key_dict_property] + ] + _dict['dictProperty'] = _field_dict_of_array + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnnamedDictWithAdditionalModelListProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dictProperty": dict( + (_k, + [CreatureInfo.from_dict(_item) for _item in _v] + if _v is not None + else None + ) + for _k, _v in obj.get("dictProperty", {}).items() + ) + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py new file mode 100644 index 00000000000..477dcae27c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UnnamedDictWithAdditionalStringListProperties(BaseModel): + """ + UnnamedDictWithAdditionalStringListProperties + """ # noqa: E501 + dict_property: Optional[Dict[str, List[StrictStr]]] = Field(default=None, alias="dictProperty") + __properties: ClassVar[List[str]] = ["dictProperty"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnnamedDictWithAdditionalStringListProperties from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnnamedDictWithAdditionalStringListProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dictProperty": obj.get("dictProperty") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py new file mode 100644 index 00000000000..9040618ac0d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UploadFileWithAdditionalPropertiesRequestObject(BaseModel): + """ + Additional object + """ # noqa: E501 + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UploadFileWithAdditionalPropertiesRequestObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UploadFileWithAdditionalPropertiesRequestObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py new file mode 100644 index 00000000000..45e0a66f89d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class User(BaseModel): + """ + User + """ # noqa: E501 + id: Optional[StrictInt] = None + username: Optional[StrictStr] = None + first_name: Optional[StrictStr] = Field(default=None, alias="firstName") + last_name: Optional[StrictStr] = Field(default=None, alias="lastName") + email: Optional[StrictStr] = None + password: Optional[StrictStr] = None + phone: Optional[StrictStr] = None + user_status: Optional[StrictInt] = Field(default=None, description="User Status", alias="userStatus") + __properties: ClassVar[List[str]] = ["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of User from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of User from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "username": obj.get("username"), + "firstName": obj.get("firstName"), + "lastName": obj.get("lastName"), + "email": obj.get("email"), + "password": obj.get("password"), + "phone": obj.get("phone"), + "userStatus": obj.get("userStatus") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py new file mode 100644 index 00000000000..f2cd8b7a3a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.one_of_enum_string import OneOfEnumString +from petstore_api.models.pig import Pig +from typing import Optional, Set +from typing_extensions import Self + +class WithNestedOneOf(BaseModel): + """ + WithNestedOneOf + """ # noqa: E501 + size: Optional[StrictInt] = None + nested_pig: Optional[Pig] = None + nested_oneof_enum_string: Optional[OneOfEnumString] = None + __properties: ClassVar[List[str]] = ["size", "nested_pig", "nested_oneof_enum_string"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WithNestedOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of nested_pig + if self.nested_pig: + _dict['nested_pig'] = self.nested_pig.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WithNestedOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "size": obj.get("size"), + "nested_pig": Pig.from_dict(obj["nested_pig"]) if obj.get("nested_pig") is not None else None, + "nested_oneof_enum_string": obj.get("nested_oneof_enum_string") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/py.typed b/samples/openapi3/client/petstore/python-httpx/petstore_api/py.typed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py new file mode 100644 index 00000000000..0736ab3d155 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py @@ -0,0 +1,194 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl +from typing import Optional, Union + +import httpx + +from petstore_api.exceptions import ApiException, ApiValueError + +RESTResponseType = httpx.Response + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status_code + self.reason = resp.reason_phrase + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.aread() + return self.data + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + self.maxsize = configuration.connection_pool_maxsize + + self.ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + if configuration.cert_file: + self.ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + self.ssl_context.check_hostname = False + self.ssl_context.verify_mode = ssl.CERT_NONE + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + self.pool_manager: Optional[httpx.AsyncClient] = None + + async def close(self): + if self.pool_manager is not None: + await self.pool_manager.aclose() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None): + """Execute request + + :param method: http request method + :param url: http request 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 _request_timeout: timeout setting 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 + } + + # 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: + args["json"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + args["data"] = dict(post_params) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by httpx + del headers['Content-Type'] + + files = [] + data = {} + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + files.append((k, v)) + else: + # Ensures that dict objects are serialized + if isinstance(v, dict): + v = json.dumps(v) + elif isinstance(v, int): + v = str(v) + data[k] = v + + if files: + args["files"] = files + if data: + 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, str) or 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) + + if self.pool_manager is None: + self.pool_manager = self._create_pool_manager() + + r = await self.pool_manager.request(**args) + return RESTResponse(r) + + def _create_pool_manager(self) -> httpx.AsyncClient: + limits = httpx.Limits(max_connections=self.maxsize) + + proxy = None + if self.proxy: + proxy = httpx.Proxy( + url=self.proxy, + headers=self.proxy_headers + ) + + return httpx.AsyncClient( + limits=limits, + proxy=proxy, + verify=self.ssl_context, + trust_env=True + ) diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/signing.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/signing.py new file mode 100644 index 00000000000..e0ef058f467 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/signing.py @@ -0,0 +1,432 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.Hash.SHA512 import SHA512Hash +from Crypto.Hash.SHA256 import SHA256Hash +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from datetime import timedelta +from email.utils import formatdate +import os +import re +from time import time +from typing import List, Optional, Union +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: + """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. + + :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: str, + signing_scheme: str, + private_key_path: str, + private_key_passphrase: Union[None, str]=None, + signed_headers: Optional[List[str]]=None, + signing_algorithm: Optional[str]=None, + hash_algorithm: Optional[str]=None, + signature_max_validity: Optional[timedelta]=None, + ) -> 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: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host: Optional[str] = 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: Optional[Union[ECC.EccKey, RSA.RsaKey]] = 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. + if self.private_key_passphrase is not None: + passphrase = self.private_key_passphrase.encode("utf-8") + else: + passphrase = None + (key_binary, pem_header, is_encrypted) = PEM.decode(pem_data, 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 = body.to_json() + + # 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(): + if isinstance(target_host, bytes): + value = target_host.decode('ascii') + else: + value = target_host + request_headers_dict[HEADER_HOST] = value + 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. + """ + + digest: Union[SHA256Hash, SHA512Hash] + + 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-httpx/pyproject.toml b/samples/openapi3/client/petstore/python-httpx/pyproject.toml new file mode 100644 index 00000000000..be0496a9589 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/pyproject.toml @@ -0,0 +1,91 @@ +[tool.poetry] +name = "petstore_api" +version = "1.0.0" +description = "OpenAPI Petstore" +authors = ["OpenAPI Generator Community "] +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] +include = ["petstore_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.9" +urllib3 = ">= 2.1.0, < 3.0.0" +python-dateutil = ">= 2.8.2" +httpx = ">= 0.28.1" +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "petstore_api", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "petstore_api.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/samples/openapi3/client/petstore/python-httpx/requirements.txt b/samples/openapi3/client/petstore/python-httpx/requirements.txt new file mode 100644 index 00000000000..373d131abd0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/requirements.txt @@ -0,0 +1,7 @@ +urllib3 >= 2.1.0, < 3.0.0 +python_dateutil >= 2.8.2 +httpx = ">= 0.28.1" +pem >= 19.3.0 +pycryptodome >= 3.9.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/samples/openapi3/client/petstore/python-httpx/setup.cfg b/samples/openapi3/client/petstore/python-httpx/setup.cfg new file mode 100644 index 00000000000..11433ee875a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/openapi3/client/petstore/python-httpx/setup.py b/samples/openapi3/client/petstore/python-httpx/setup.py new file mode 100644 index 00000000000..36a30666aaa --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/setup.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "petstore-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">= 3.9" +REQUIRES = [ + "urllib3 >= 2.1.0, < 3.0.0", + "python-dateutil >= 2.8.2", + "httpx >= 0.28.1", + "pem >= 19.3.0", + "pycryptodome >= 3.9.0", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +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 + package_data={"petstore_api": ["py.typed"]}, +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-httpx/test-requirements.txt b/samples/openapi3/client/petstore/python-httpx/test-requirements.txt new file mode 100644 index 00000000000..e98555c11c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/samples/openapi3/client/petstore/python-httpx/test/__init__.py b/samples/openapi3/client/petstore/python-httpx/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_any_type.py b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_any_type.py new file mode 100644 index 00000000000..48603ddb403 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_any_type.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType + +class TestAdditionalPropertiesAnyType(unittest.TestCase): + """AdditionalPropertiesAnyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdditionalPropertiesAnyType: + """Test AdditionalPropertiesAnyType + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AdditionalPropertiesAnyType` + """ + model = AdditionalPropertiesAnyType() + if include_optional: + return AdditionalPropertiesAnyType( + name = '' + ) + else: + return AdditionalPropertiesAnyType( + ) + """ + + def testAdditionalPropertiesAnyType(self): + """Test AdditionalPropertiesAnyType""" + # 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-httpx/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_class.py new file mode 100644 index 00000000000..0261c8f4a00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_class.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdditionalPropertiesClass: + """Test AdditionalPropertiesClass + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AdditionalPropertiesClass` + """ + model = AdditionalPropertiesClass() + 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-httpx/test/test_additional_properties_object.py b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_object.py new file mode 100644 index 00000000000..8b0dccef564 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_object.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.additional_properties_object import AdditionalPropertiesObject + +class TestAdditionalPropertiesObject(unittest.TestCase): + """AdditionalPropertiesObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdditionalPropertiesObject: + """Test AdditionalPropertiesObject + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AdditionalPropertiesObject` + """ + model = AdditionalPropertiesObject() + if include_optional: + return AdditionalPropertiesObject( + name = '' + ) + else: + return AdditionalPropertiesObject( + ) + """ + + def testAdditionalPropertiesObject(self): + """Test AdditionalPropertiesObject""" + # 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-httpx/test/test_additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_with_description_only.py new file mode 100644 index 00000000000..698f5f8d899 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_additional_properties_with_description_only.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly + +class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase): + """AdditionalPropertiesWithDescriptionOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdditionalPropertiesWithDescriptionOnly: + """Test AdditionalPropertiesWithDescriptionOnly + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly` + """ + model = AdditionalPropertiesWithDescriptionOnly() + if include_optional: + return AdditionalPropertiesWithDescriptionOnly( + name = '' + ) + else: + return AdditionalPropertiesWithDescriptionOnly( + ) + """ + + def testAdditionalPropertiesWithDescriptionOnly(self): + """Test AdditionalPropertiesWithDescriptionOnly""" + # 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-httpx/test/test_all_of_super_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_all_of_super_model.py new file mode 100644 index 00000000000..0b37180a54c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_all_of_super_model.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.all_of_super_model import AllOfSuperModel + +class TestAllOfSuperModel(unittest.TestCase): + """AllOfSuperModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AllOfSuperModel: + """Test AllOfSuperModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AllOfSuperModel` + """ + model = AllOfSuperModel() + if include_optional: + return AllOfSuperModel( + name = '' + ) + else: + return AllOfSuperModel( + ) + """ + + def testAllOfSuperModel(self): + """Test AllOfSuperModel""" + # 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-httpx/test/test_all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-httpx/test/test_all_of_with_single_ref.py new file mode 100644 index 00000000000..ff147a1bc4e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_all_of_with_single_ref.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef + +class TestAllOfWithSingleRef(unittest.TestCase): + """AllOfWithSingleRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AllOfWithSingleRef: + """Test AllOfWithSingleRef + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AllOfWithSingleRef` + """ + model = AllOfWithSingleRef() + if include_optional: + return AllOfWithSingleRef( + username = '', + single_ref_type = 'admin' + ) + 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-httpx/test/test_animal.py b/samples/openapi3/client/petstore/python-httpx/test/test_animal.py new file mode 100644 index 00000000000..4ea318679b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_animal.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.animal import Animal + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Animal: + """Test Animal + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Animal` + """ + model = Animal() + 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-httpx/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_another_fake_api.py new file mode 100644 index 00000000000..d1b73d979ff --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_another_fake_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.another_fake_api import AnotherFakeApi + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self) -> None: + self.api = AnotherFakeApi() + + def tearDown(self) -> None: + pass + + def test_call_123_test_special_tags(self) -> None: + """Test case for call_123_test_special_tags + + To test special tags + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_any_of_color.py b/samples/openapi3/client/petstore/python-httpx/test/test_any_of_color.py new file mode 100644 index 00000000000..f6092af623a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_any_of_color.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.any_of_color import AnyOfColor + +class TestAnyOfColor(unittest.TestCase): + """AnyOfColor unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnyOfColor: + """Test AnyOfColor + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AnyOfColor` + """ + model = AnyOfColor() + if include_optional: + return AnyOfColor( + ) + else: + return AnyOfColor( + ) + """ + + def testAnyOfColor(self): + """Test AnyOfColor""" + # 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-httpx/test/test_any_of_pig.py b/samples/openapi3/client/petstore/python-httpx/test/test_any_of_pig.py new file mode 100644 index 00000000000..e69d8f25900 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_any_of_pig.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.any_of_pig import AnyOfPig + +class TestAnyOfPig(unittest.TestCase): + """AnyOfPig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnyOfPig: + """Test AnyOfPig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AnyOfPig` + """ + model = AnyOfPig() + if include_optional: + return AnyOfPig( + class_name = '', + color = '', + size = 56 + ) + else: + return AnyOfPig( + class_name = '', + color = '', + size = 56, + ) + """ + + def testAnyOfPig(self): + """Test AnyOfPig""" + # 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-httpx/test/test_array_of_array_of_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_array_of_array_of_model.py new file mode 100644 index 00000000000..a96ea540171 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_array_of_array_of_model.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel + +class TestArrayOfArrayOfModel(unittest.TestCase): + """ArrayOfArrayOfModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ArrayOfArrayOfModel: + """Test ArrayOfArrayOfModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ArrayOfArrayOfModel` + """ + model = ArrayOfArrayOfModel() + if include_optional: + return ArrayOfArrayOfModel( + another_property = [ + [ + petstore_api.models.tag.Tag( + id = 56, + name = '', ) + ] + ] + ) + else: + return ArrayOfArrayOfModel( + ) + """ + + def testArrayOfArrayOfModel(self): + """Test ArrayOfArrayOfModel""" + # 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-httpx/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-httpx/test/test_array_of_array_of_number_only.py new file mode 100644 index 00000000000..bd89ba2188d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_array_of_array_of_number_only.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.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 make_instance(self, include_optional) -> ArrayOfArrayOfNumberOnly: + """Test ArrayOfArrayOfNumberOnly + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ArrayOfArrayOfNumberOnly` + """ + model = ArrayOfArrayOfNumberOnly() + 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-httpx/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-httpx/test/test_array_of_number_only.py new file mode 100644 index 00000000000..f67af039fce --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_array_of_number_only.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ArrayOfNumberOnly: + """Test ArrayOfNumberOnly + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ArrayOfNumberOnly` + """ + model = ArrayOfNumberOnly() + 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-httpx/test/test_array_test.py b/samples/openapi3/client/petstore/python-httpx/test/test_array_test.py new file mode 100644 index 00000000000..21ce90c4c2c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_array_test.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.array_test import ArrayTest + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ArrayTest: + """Test ArrayTest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ArrayTest` + """ + model = ArrayTest() + if include_optional: + return ArrayTest( + array_of_string = [ + '' + ], + array_of_nullable_float = [ + 1.337 + ], + 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-httpx/test/test_base_discriminator.py b/samples/openapi3/client/petstore/python-httpx/test/test_base_discriminator.py new file mode 100644 index 00000000000..05ed4b3d4da --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_base_discriminator.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.base_discriminator import BaseDiscriminator + +class TestBaseDiscriminator(unittest.TestCase): + """BaseDiscriminator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseDiscriminator: + """Test BaseDiscriminator + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseDiscriminator` + """ + model = BaseDiscriminator() + if include_optional: + return BaseDiscriminator( + type_name = '' + ) + else: + return BaseDiscriminator( + ) + """ + + def testBaseDiscriminator(self): + """Test BaseDiscriminator""" + # 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-httpx/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-httpx/test/test_basque_pig.py new file mode 100644 index 00000000000..f79d16cd858 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_basque_pig.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.basque_pig import BasquePig + +class TestBasquePig(unittest.TestCase): + """BasquePig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BasquePig: + """Test BasquePig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BasquePig` + """ + model = BasquePig() + if include_optional: + return BasquePig( + class_name = '', + color = '' + ) + else: + return BasquePig( + class_name = '', + color = '', + ) + """ + + def testBasquePig(self): + """Test BasquePig""" + # 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-httpx/test/test_bathing.py b/samples/openapi3/client/petstore/python-httpx/test/test_bathing.py new file mode 100644 index 00000000000..f2b6a75a95a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_bathing.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.bathing import Bathing + +class TestBathing(unittest.TestCase): + """Bathing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Bathing: + """Test Bathing + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Bathing` + """ + model = Bathing() + if include_optional: + return Bathing( + task_name = 'cleaning_deep', + function_name = 'care_nourish', + content = '' + ) + else: + return Bathing( + task_name = 'cleaning_deep', + function_name = 'care_nourish', + content = '', + ) + """ + + def testBathing(self): + """Test Bathing""" + # 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-httpx/test/test_capitalization.py b/samples/openapi3/client/petstore/python-httpx/test/test_capitalization.py new file mode 100644 index 00000000000..6e8f95b7acf --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_capitalization.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.capitalization import Capitalization + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Capitalization: + """Test Capitalization + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Capitalization` + """ + model = Capitalization() + 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-httpx/test/test_cat.py b/samples/openapi3/client/petstore/python-httpx/test/test_cat.py new file mode 100644 index 00000000000..15034d82ed3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_cat.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.cat import Cat + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Cat: + """Test Cat + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Cat` + """ + model = Cat() + 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/openapi3/client/petstore/python-httpx/test/test_category.py b/samples/openapi3/client/petstore/python-httpx/test/test_category.py new file mode 100644 index 00000000000..014917bf17f --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_category.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.category import Category + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Category: + """Test Category + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Category` + """ + model = Category() + 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-httpx/test/test_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-httpx/test/test_circular_all_of_ref.py new file mode 100644 index 00000000000..9d81ff91b15 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_circular_all_of_ref.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.circular_all_of_ref import CircularAllOfRef + +class TestCircularAllOfRef(unittest.TestCase): + """CircularAllOfRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CircularAllOfRef: + """Test CircularAllOfRef + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CircularAllOfRef` + """ + model = CircularAllOfRef() + if include_optional: + return CircularAllOfRef( + name = '', + second_circular_all_of_ref = [ + petstore_api.models.second_circular_all_of_ref.SecondCircularAllOfRef() + ] + ) + else: + return CircularAllOfRef( + ) + """ + + def testCircularAllOfRef(self): + """Test CircularAllOfRef""" + # 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-httpx/test/test_circular_reference_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_circular_reference_model.py new file mode 100644 index 00000000000..18148b2b7d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_circular_reference_model.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.circular_reference_model import CircularReferenceModel + +class TestCircularReferenceModel(unittest.TestCase): + """CircularReferenceModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CircularReferenceModel: + """Test CircularReferenceModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CircularReferenceModel` + """ + model = CircularReferenceModel() + if include_optional: + return CircularReferenceModel( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', ), ), ), ) + ) + else: + return CircularReferenceModel( + ) + """ + + def testCircularReferenceModel(self): + """Test CircularReferenceModel""" + # 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-httpx/test/test_class_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_class_model.py new file mode 100644 index 00000000000..1826cbf5398 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_class_model.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.class_model import ClassModel + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ClassModel: + """Test ClassModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ClassModel` + """ + model = ClassModel() + if include_optional: + return ClassModel( + var_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-httpx/test/test_client.py b/samples/openapi3/client/petstore/python-httpx/test/test_client.py new file mode 100644 index 00000000000..1586543c171 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_client.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.client import Client + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Client: + """Test Client + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Client` + """ + model = Client() + 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-httpx/test/test_color.py b/samples/openapi3/client/petstore/python-httpx/test/test_color.py new file mode 100644 index 00000000000..2ebb0ec04de --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_color.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.color import Color + +class TestColor(unittest.TestCase): + """Color unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Color: + """Test Color + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Color` + """ + model = Color() + if include_optional: + return Color( + ) + else: + return Color( + ) + """ + + def testColor(self): + """Test Color""" + # 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-httpx/test/test_creature.py b/samples/openapi3/client/petstore/python-httpx/test/test_creature.py new file mode 100644 index 00000000000..eab8f68f3a5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_creature.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.creature import Creature + +class TestCreature(unittest.TestCase): + """Creature unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Creature: + """Test Creature + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Creature` + """ + model = Creature() + if include_optional: + return Creature( + info = petstore_api.models.creature_info.CreatureInfo( + name = '', ), + type = '' + ) + else: + return Creature( + info = petstore_api.models.creature_info.CreatureInfo( + name = '', ), + type = '', + ) + """ + + def testCreature(self): + """Test Creature""" + # 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-httpx/test/test_creature_info.py b/samples/openapi3/client/petstore/python-httpx/test/test_creature_info.py new file mode 100644 index 00000000000..d645563a479 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_creature_info.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.creature_info import CreatureInfo + +class TestCreatureInfo(unittest.TestCase): + """CreatureInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreatureInfo: + """Test CreatureInfo + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreatureInfo` + """ + model = CreatureInfo() + if include_optional: + return CreatureInfo( + name = '' + ) + else: + return CreatureInfo( + name = '', + ) + """ + + def testCreatureInfo(self): + """Test CreatureInfo""" + # 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-httpx/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-httpx/test/test_danish_pig.py new file mode 100644 index 00000000000..1dc992542c4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_danish_pig.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.danish_pig import DanishPig + +class TestDanishPig(unittest.TestCase): + """DanishPig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DanishPig: + """Test DanishPig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DanishPig` + """ + model = DanishPig() + if include_optional: + return DanishPig( + class_name = '', + size = 56 + ) + else: + return DanishPig( + class_name = '', + size = 56, + ) + """ + + def testDanishPig(self): + """Test DanishPig""" + # 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-httpx/test/test_data_output_format.py b/samples/openapi3/client/petstore/python-httpx/test/test_data_output_format.py new file mode 100644 index 00000000000..99ff7317920 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_data_output_format.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.data_output_format import DataOutputFormat + +class TestDataOutputFormat(unittest.TestCase): + """DataOutputFormat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDataOutputFormat(self): + """Test DataOutputFormat""" + # inst = DataOutputFormat() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_default_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_default_api.py new file mode 100644 index 00000000000..eb421a8edc1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_default_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.default_api import DefaultApi + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self) -> None: + self.api = DefaultApi() + + def tearDown(self) -> None: + pass + + def test_foo_get(self) -> None: + """Test case for foo_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_deprecated_object.py b/samples/openapi3/client/petstore/python-httpx/test/test_deprecated_object.py new file mode 100644 index 00000000000..e63842997ae --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_deprecated_object.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.deprecated_object import DeprecatedObject + +class TestDeprecatedObject(unittest.TestCase): + """DeprecatedObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeprecatedObject: + """Test DeprecatedObject + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DeprecatedObject` + """ + model = DeprecatedObject() + 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-httpx/test/test_discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-httpx/test/test_discriminator_all_of_sub.py new file mode 100644 index 00000000000..f52f3d33f13 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_discriminator_all_of_sub.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +class TestDiscriminatorAllOfSub(unittest.TestCase): + """DiscriminatorAllOfSub unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSub: + """Test DiscriminatorAllOfSub + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSub` + """ + model = DiscriminatorAllOfSub() + if include_optional: + return DiscriminatorAllOfSub( + ) + else: + return DiscriminatorAllOfSub( + ) + """ + + def testDiscriminatorAllOfSub(self): + """Test DiscriminatorAllOfSub""" + # 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-httpx/test/test_discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-httpx/test/test_discriminator_all_of_super.py new file mode 100644 index 00000000000..830fa0a829a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_discriminator_all_of_super.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +class TestDiscriminatorAllOfSuper(unittest.TestCase): + """DiscriminatorAllOfSuper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSuper: + """Test DiscriminatorAllOfSuper + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSuper` + """ + model = DiscriminatorAllOfSuper() + if include_optional: + return DiscriminatorAllOfSuper( + element_type = '' + ) + else: + return DiscriminatorAllOfSuper( + element_type = '', + ) + """ + + def testDiscriminatorAllOfSuper(self): + """Test DiscriminatorAllOfSuper""" + # 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-httpx/test/test_dog.py b/samples/openapi3/client/petstore/python-httpx/test/test_dog.py new file mode 100644 index 00000000000..c11f61c99c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_dog.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.dog import Dog + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Dog: + """Test Dog + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Dog` + """ + model = Dog() + if include_optional: + return Dog( + breed = '' + ) + else: + return Dog( + ) + """ + + 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-httpx/test/test_dummy_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_dummy_model.py new file mode 100644 index 00000000000..8b276ec140b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_dummy_model.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.dummy_model import DummyModel + +class TestDummyModel(unittest.TestCase): + """DummyModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DummyModel: + """Test DummyModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DummyModel` + """ + model = DummyModel() + if include_optional: + return DummyModel( + category = '', + self_ref = petstore_api.models.self_reference_model.Self-Reference-Model( + size = 56, + nested = petstore_api.models.dummy_model.Dummy-Model( + category = '', ), ) + ) + else: + return DummyModel( + ) + """ + + def testDummyModel(self): + """Test DummyModel""" + # 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-httpx/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_arrays.py new file mode 100644 index 00000000000..f3d731b3f59 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_arrays.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_arrays import EnumArrays + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnumArrays: + """Test EnumArrays + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnumArrays` + """ + model = EnumArrays() + 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-httpx/test/test_enum_class.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_class.py new file mode 100644 index 00000000000..5730ded0ad3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_class.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.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""" + # inst = EnumClass() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_number_vendor_ext.py new file mode 100644 index 00000000000..62ff78318c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_number_vendor_ext.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt + +class TestEnumNumberVendorExt(unittest.TestCase): + """EnumNumberVendorExt unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumNumberVendorExt(self): + """Test EnumNumberVendorExt""" + # inst = EnumNumberVendorExt() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_ref_with_default_value.py new file mode 100644 index 00000000000..839d9583998 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_ref_with_default_value.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue + +class TestEnumRefWithDefaultValue(unittest.TestCase): + """EnumRefWithDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnumRefWithDefaultValue: + """Test EnumRefWithDefaultValue + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnumRefWithDefaultValue` + """ + model = EnumRefWithDefaultValue() + if include_optional: + return EnumRefWithDefaultValue( + report_format = 'JSON' + ) + else: + return EnumRefWithDefaultValue( + ) + """ + + def testEnumRefWithDefaultValue(self): + """Test EnumRefWithDefaultValue""" + # 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-httpx/test/test_enum_string1.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_string1.py new file mode 100644 index 00000000000..e6a85884120 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_string1.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_string1 import EnumString1 + +class TestEnumString1(unittest.TestCase): + """EnumString1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumString1(self): + """Test EnumString1""" + # inst = EnumString1() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_enum_string2.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_string2.py new file mode 100644 index 00000000000..6a52c081d3c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_string2.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_string2 import EnumString2 + +class TestEnumString2(unittest.TestCase): + """EnumString2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumString2(self): + """Test EnumString2""" + # inst = EnumString2() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_string_vendor_ext.py new file mode 100644 index 00000000000..e82d7957d34 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_string_vendor_ext.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt + +class TestEnumStringVendorExt(unittest.TestCase): + """EnumStringVendorExt unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumStringVendorExt(self): + """Test EnumStringVendorExt""" + # inst = EnumStringVendorExt() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_enum_test.py b/samples/openapi3/client/petstore/python-httpx/test/test_enum_test.py new file mode 100644 index 00000000000..d84613bc946 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_enum_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.enum_test import EnumTest + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnumTest: + """Test EnumTest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnumTest` + """ + model = EnumTest() + if include_optional: + return EnumTest( + enum_string = 'UPPER', + enum_string_required = 'UPPER', + enum_integer_default = 1, + enum_integer = 1, + enum_number = 1.1, + enum_string_single_member = 'abc', + enum_integer_single_member = 100, + outer_enum = 'placed', + outer_enum_integer = 2, + outer_enum_default_value = 'placed', + outer_enum_integer_default_value = -1, + enum_number_vendor_ext = 42, + enum_string_vendor_ext = 'FOO' + ) + 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-httpx/test/test_fake_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_fake_api.py new file mode 100644 index 00000000000..11920b00480 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_fake_api.py @@ -0,0 +1,279 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.fake_api import FakeApi + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self) -> None: + self.api = FakeApi() + + def tearDown(self) -> None: + pass + + def test_fake_any_type_request_body(self) -> None: + """Test case for fake_any_type_request_body + + test any type request body + """ + pass + + def test_fake_enum_ref_query_parameter(self) -> None: + """Test case for fake_enum_ref_query_parameter + + test enum reference query parameter + """ + pass + + def test_fake_health_get(self) -> None: + """Test case for fake_health_get + + Health check endpoint + """ + pass + + def test_fake_http_signature_test(self) -> None: + """Test case for fake_http_signature_test + + test http signature authentication + """ + pass + + def test_fake_outer_boolean_serialize(self) -> None: + """Test case for fake_outer_boolean_serialize + + """ + pass + + def test_fake_outer_composite_serialize(self) -> None: + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self) -> None: + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self) -> None: + """Test case for fake_outer_string_serialize + + """ + pass + + def test_fake_property_enum_integer_serialize(self) -> None: + """Test case for fake_property_enum_integer_serialize + + """ + pass + + def test_fake_ref_enum_string(self) -> None: + """Test case for fake_ref_enum_string + + test ref to enum string + """ + pass + + def test_fake_return_boolean(self) -> None: + """Test case for fake_return_boolean + + test returning boolean + """ + pass + + def test_fake_return_byte_like_json(self) -> None: + """Test case for fake_return_byte_like_json + + test byte like json + """ + pass + + def test_fake_return_enum(self) -> None: + """Test case for fake_return_enum + + test returning enum + """ + pass + + def test_fake_return_enum_like_json(self) -> None: + """Test case for fake_return_enum_like_json + + test enum like json + """ + pass + + def test_fake_return_float(self) -> None: + """Test case for fake_return_float + + test returning float + """ + pass + + def test_fake_return_int(self) -> None: + """Test case for fake_return_int + + test returning int + """ + pass + + def test_fake_return_list_of_objects(self) -> None: + """Test case for fake_return_list_of_objects + + test returning list of objects + """ + pass + + def test_fake_return_str_like_json(self) -> None: + """Test case for fake_return_str_like_json + + test str like json + """ + pass + + def test_fake_return_string(self) -> None: + """Test case for fake_return_string + + test returning string + """ + pass + + def test_fake_uuid_example(self) -> None: + """Test case for fake_uuid_example + + test uuid example + """ + pass + + def test_test_additional_properties_reference(self) -> None: + """Test case for test_additional_properties_reference + + test referenced additionalProperties + """ + pass + + def test_test_body_with_binary(self) -> None: + """Test case for test_body_with_binary + + """ + pass + + def test_test_body_with_file_schema(self) -> None: + """Test case for test_body_with_file_schema + + """ + pass + + def test_test_body_with_query_params(self) -> None: + """Test case for test_body_with_query_params + + """ + pass + + def test_test_client_model(self) -> None: + """Test case for test_client_model + + To test \"client\" model + """ + pass + + def test_test_date_time_query_parameter(self) -> None: + """Test case for test_date_time_query_parameter + + """ + pass + + def test_test_empty_and_non_empty_responses(self) -> None: + """Test case for test_empty_and_non_empty_responses + + test empty and non-empty responses + """ + pass + + def test_test_endpoint_parameters(self) -> None: + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + """ + pass + + def test_test_error_responses_with_model(self) -> None: + """Test case for test_error_responses_with_model + + test error responses with model + """ + pass + + def test_test_group_parameters(self) -> None: + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) + """ + pass + + def test_test_inline_additional_properties(self) -> None: + """Test case for test_inline_additional_properties + + test inline additionalProperties + """ + pass + + def test_test_inline_freeform_additional_properties(self) -> None: + """Test case for test_inline_freeform_additional_properties + + test inline free-form additionalProperties + """ + pass + + def test_test_json_form_data(self) -> None: + """Test case for test_json_form_data + + test json serialization of form data + """ + pass + + def test_test_object_for_multipart_requests(self) -> None: + """Test case for test_object_for_multipart_requests + + """ + pass + + def test_test_query_parameter_collection_format(self) -> None: + """Test case for test_query_parameter_collection_format + + """ + pass + + def test_test_string_map_reference(self) -> None: + """Test case for test_string_map_reference + + test referenced string map + """ + pass + + def test_upload_file_with_additional_properties(self) -> None: + """Test case for upload_file_with_additional_properties + + uploads a file and additional properties using multipart/form-data + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_fake_classname_tags123_api.py new file mode 100644 index 00000000000..9282bf7150c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_fake_classname_tags123_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self) -> None: + self.api = FakeClassnameTags123Api() + + def tearDown(self) -> None: + pass + + def test_test_classname(self) -> None: + """Test case for test_classname + + To test class name in snake case + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_feeding.py b/samples/openapi3/client/petstore/python-httpx/test/test_feeding.py new file mode 100644 index 00000000000..fc9d904716e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_feeding.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.feeding import Feeding + +class TestFeeding(unittest.TestCase): + """Feeding unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Feeding: + """Test Feeding + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Feeding` + """ + model = Feeding() + if include_optional: + return Feeding( + task_name = 'cleaning', + function_name = 'care_nourish', + content = '' + ) + else: + return Feeding( + task_name = 'cleaning', + function_name = 'care_nourish', + content = '', + ) + """ + + def testFeeding(self): + """Test Feeding""" + # 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-httpx/test/test_file.py b/samples/openapi3/client/petstore/python-httpx/test/test_file.py new file mode 100644 index 00000000000..d050f598246 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_file.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.file import File + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> File: + """Test File + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `File` + """ + model = File() + 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-httpx/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-httpx/test/test_file_schema_test_class.py new file mode 100644 index 00000000000..ebbf1f58705 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_file_schema_test_class.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.file_schema_test_class import FileSchemaTestClass + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FileSchemaTestClass: + """Test FileSchemaTestClass + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FileSchemaTestClass` + """ + model = FileSchemaTestClass() + 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-httpx/test/test_first_ref.py b/samples/openapi3/client/petstore/python-httpx/test/test_first_ref.py new file mode 100644 index 00000000000..38520ad2e63 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_first_ref.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.first_ref import FirstRef + +class TestFirstRef(unittest.TestCase): + """FirstRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FirstRef: + """Test FirstRef + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FirstRef` + """ + model = FirstRef() + if include_optional: + return FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', ), ), ) + ) + else: + return FirstRef( + ) + """ + + def testFirstRef(self): + """Test FirstRef""" + # 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-httpx/test/test_foo.py b/samples/openapi3/client/petstore/python-httpx/test/test_foo.py new file mode 100644 index 00000000000..430ee19bf69 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_foo.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.foo import Foo + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Foo: + """Test Foo + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Foo` + """ + model = Foo() + 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-httpx/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-httpx/test/test_foo_get_default_response.py new file mode 100644 index 00000000000..c5524b88d2b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_foo_get_default_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.foo_get_default_response import FooGetDefaultResponse + +class TestFooGetDefaultResponse(unittest.TestCase): + """FooGetDefaultResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FooGetDefaultResponse: + """Test FooGetDefaultResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FooGetDefaultResponse` + """ + model = FooGetDefaultResponse() + 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-httpx/test/test_format_test.py b/samples/openapi3/client/petstore/python-httpx/test/test_format_test.py new file mode 100644 index 00000000000..8cde3f67815 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_format_test.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.format_test import FormatTest + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FormatTest: + """Test FormatTest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FormatTest` + """ + model = FormatTest() + if include_optional: + return FormatTest( + integer = 10, + int32 = 20, + int64 = 56, + number = 32.1, + var_float = 54.3, + double = 67.8, + decimal = 1, + string = 'a', + string_with_double_quote_pattern = 'this is \"something\"', + byte = 'YQ==', + binary = bytes(b'blah'), + var_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, + var_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-httpx/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-httpx/test/test_has_only_read_only.py new file mode 100644 index 00000000000..59013015dc7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_has_only_read_only.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.has_only_read_only import HasOnlyReadOnly + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HasOnlyReadOnly: + """Test HasOnlyReadOnly + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HasOnlyReadOnly` + """ + model = HasOnlyReadOnly() + 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-httpx/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-httpx/test/test_health_check_result.py new file mode 100644 index 00000000000..a50444e6d87 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_health_check_result.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.health_check_result import HealthCheckResult + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HealthCheckResult: + """Test HealthCheckResult + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HealthCheckResult` + """ + model = HealthCheckResult() + 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-httpx/test/test_hunting_dog.py b/samples/openapi3/client/petstore/python-httpx/test/test_hunting_dog.py new file mode 100644 index 00000000000..8d9c106a872 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_hunting_dog.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.hunting_dog import HuntingDog + +class TestHuntingDog(unittest.TestCase): + """HuntingDog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HuntingDog: + """Test HuntingDog + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HuntingDog` + """ + model = HuntingDog() + if include_optional: + return HuntingDog( + is_trained = True + ) + else: + return HuntingDog( + ) + """ + + def testHuntingDog(self): + """Test HuntingDog""" + # 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-httpx/test/test_import_test_datetime_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_import_test_datetime_api.py new file mode 100644 index 00000000000..6cd4fb8cbaf --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_import_test_datetime_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi + + +class TestImportTestDatetimeApi(unittest.TestCase): + """ImportTestDatetimeApi unit test stubs""" + + def setUp(self) -> None: + self.api = ImportTestDatetimeApi() + + def tearDown(self) -> None: + pass + + def test_import_test_return_datetime(self) -> None: + """Test case for import_test_return_datetime + + test date time + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_info.py b/samples/openapi3/client/petstore/python-httpx/test/test_info.py new file mode 100644 index 00000000000..47075061d9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_info.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.info import Info + +class TestInfo(unittest.TestCase): + """Info unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Info: + """Test Info + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Info` + """ + model = Info() + if include_optional: + return Info( + val = petstore_api.models.base_discriminator.BaseDiscriminator() + ) + else: + return Info( + ) + """ + + def testInfo(self): + """Test Info""" + # 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-httpx/test/test_inner_dict_with_property.py b/samples/openapi3/client/petstore/python-httpx/test/test_inner_dict_with_property.py new file mode 100644 index 00000000000..1f80e90e29d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_inner_dict_with_property.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + +class TestInnerDictWithProperty(unittest.TestCase): + """InnerDictWithProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InnerDictWithProperty: + """Test InnerDictWithProperty + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InnerDictWithProperty` + """ + model = InnerDictWithProperty() + if include_optional: + return InnerDictWithProperty( + a_property = None + ) + else: + return InnerDictWithProperty( + ) + """ + + def testInnerDictWithProperty(self): + """Test InnerDictWithProperty""" + # 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-httpx/test/test_input_all_of.py b/samples/openapi3/client/petstore/python-httpx/test/test_input_all_of.py new file mode 100644 index 00000000000..212f59bea79 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_input_all_of.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.input_all_of import InputAllOf + +class TestInputAllOf(unittest.TestCase): + """InputAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InputAllOf: + """Test InputAllOf + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InputAllOf` + """ + model = InputAllOf() + if include_optional: + return InputAllOf( + some_data = { + 'key' : petstore_api.models.tag.Tag( + id = 56, + name = '', ) + } + ) + else: + return InputAllOf( + ) + """ + + def testInputAllOf(self): + """Test InputAllOf""" + # 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-httpx/test/test_int_or_string.py b/samples/openapi3/client/petstore/python-httpx/test/test_int_or_string.py new file mode 100644 index 00000000000..a649aac2469 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_int_or_string.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.int_or_string import IntOrString + +class TestIntOrString(unittest.TestCase): + """IntOrString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IntOrString: + """Test IntOrString + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IntOrString` + """ + model = IntOrString() + if include_optional: + return IntOrString( + ) + else: + return IntOrString( + ) + """ + + def testIntOrString(self): + """Test IntOrString""" + # 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-httpx/test/test_list_class.py b/samples/openapi3/client/petstore/python-httpx/test/test_list_class.py new file mode 100644 index 00000000000..7da7d021f77 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_list_class.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.list_class import ListClass + +class TestListClass(unittest.TestCase): + """ListClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListClass: + """Test ListClass + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListClass` + """ + model = ListClass() + if include_optional: + return ListClass( + var_123_list = '' + ) + else: + return ListClass( + ) + """ + + def testListClass(self): + """Test ListClass""" + # 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-httpx/test/test_map_of_array_of_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_map_of_array_of_model.py new file mode 100644 index 00000000000..2d5637f8f34 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_map_of_array_of_model.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel + +class TestMapOfArrayOfModel(unittest.TestCase): + """MapOfArrayOfModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MapOfArrayOfModel: + """Test MapOfArrayOfModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MapOfArrayOfModel` + """ + model = MapOfArrayOfModel() + if include_optional: + return MapOfArrayOfModel( + shop_id_to_org_online_lip_map = { + 'key' : [ + petstore_api.models.tag.Tag( + id = 56, + name = '', ) + ] + } + ) + else: + return MapOfArrayOfModel( + ) + """ + + def testMapOfArrayOfModel(self): + """Test MapOfArrayOfModel""" + # 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-httpx/test/test_map_test.py b/samples/openapi3/client/petstore/python-httpx/test/test_map_test.py new file mode 100644 index 00000000000..6d15e3d0b34 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_map_test.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.map_test import MapTest + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MapTest: + """Test MapTest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MapTest` + """ + model = MapTest() + 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-httpx/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-httpx/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..33d884c768b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.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 make_instance(self, include_optional) -> MixedPropertiesAndAdditionalPropertiesClass: + """Test MixedPropertiesAndAdditionalPropertiesClass + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MixedPropertiesAndAdditionalPropertiesClass` + """ + model = MixedPropertiesAndAdditionalPropertiesClass() + 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-httpx/test/test_model200_response.py b/samples/openapi3/client/petstore/python-httpx/test/test_model200_response.py new file mode 100644 index 00000000000..007f8a62395 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_model200_response.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.model200_response import Model200Response + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Model200Response: + """Test Model200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Model200Response` + """ + model = Model200Response() + if include_optional: + return Model200Response( + name = 56, + var_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-httpx/test/test_model_api_response.py b/samples/openapi3/client/petstore/python-httpx/test/test_model_api_response.py new file mode 100644 index 00000000000..beca8e34434 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_model_api_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.model_api_response import ModelApiResponse + +class TestModelApiResponse(unittest.TestCase): + """ModelApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelApiResponse: + """Test ModelApiResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ModelApiResponse` + """ + model = ModelApiResponse() + if include_optional: + return ModelApiResponse( + code = 56, + type = '', + message = '' + ) + else: + return ModelApiResponse( + ) + """ + + def testModelApiResponse(self): + """Test ModelApiResponse""" + # 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-httpx/test/test_model_field.py b/samples/openapi3/client/petstore/python-httpx/test/test_model_field.py new file mode 100644 index 00000000000..eb8dee7981c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_model_field.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.model_field import ModelField + +class TestModelField(unittest.TestCase): + """ModelField unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelField: + """Test ModelField + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ModelField` + """ + model = ModelField() + if include_optional: + return ModelField( + var_field = '' + ) + else: + return ModelField( + ) + """ + + def testModelField(self): + """Test ModelField""" + # 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-httpx/test/test_model_return.py b/samples/openapi3/client/petstore/python-httpx/test/test_model_return.py new file mode 100644 index 00000000000..2c2afa1d43b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_model_return.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.model_return import ModelReturn + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelReturn: + """Test ModelReturn + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ModelReturn` + """ + model = ModelReturn() + if include_optional: + return ModelReturn( + var_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-httpx/test/test_multi_arrays.py b/samples/openapi3/client/petstore/python-httpx/test/test_multi_arrays.py new file mode 100644 index 00000000000..bfd4f299881 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_multi_arrays.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.multi_arrays import MultiArrays + +class TestMultiArrays(unittest.TestCase): + """MultiArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiArrays: + """Test MultiArrays + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MultiArrays` + """ + model = MultiArrays() + if include_optional: + return MultiArrays( + tags = [ + petstore_api.models.tag.Tag( + id = 56, + name = '', ) + ], + files = [ + petstore_api.models.file.File( + source_uri = '', ) + ] + ) + else: + return MultiArrays( + ) + """ + + def testMultiArrays(self): + """Test MultiArrays""" + # 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-httpx/test/test_name.py b/samples/openapi3/client/petstore/python-httpx/test/test_name.py new file mode 100644 index 00000000000..db4e9cf37e9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_name.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.name import Name + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Name: + """Test Name + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Name` + """ + model = Name() + if include_optional: + return Name( + name = 56, + snake_case = 56, + var_property = '', + var_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-httpx/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-httpx/test/test_nullable_class.py new file mode 100644 index 00000000000..ecf5363b4ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_nullable_class.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.nullable_class import NullableClass + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NullableClass: + """Test NullableClass + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NullableClass` + """ + model = NullableClass() + if include_optional: + return NullableClass( + required_integer_prop = 56, + 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( + required_integer_prop = 56, + ) + """ + + 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-httpx/test/test_nullable_property.py b/samples/openapi3/client/petstore/python-httpx/test/test_nullable_property.py new file mode 100644 index 00000000000..52bdc7874ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_nullable_property.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.nullable_property import NullableProperty + +class TestNullableProperty(unittest.TestCase): + """NullableProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NullableProperty: + """Test NullableProperty + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NullableProperty` + """ + model = NullableProperty() + if include_optional: + return NullableProperty( + id = 56, + name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>' + ) + else: + return NullableProperty( + id = 56, + name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>', + ) + """ + + def testNullableProperty(self): + """Test NullableProperty""" + # 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-httpx/test/test_number_only.py b/samples/openapi3/client/petstore/python-httpx/test/test_number_only.py new file mode 100644 index 00000000000..78d7c5cff92 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_number_only.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.number_only import NumberOnly + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NumberOnly: + """Test NumberOnly + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NumberOnly` + """ + model = NumberOnly() + 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-httpx/test/test_object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-httpx/test/test_object_to_test_additional_properties.py new file mode 100644 index 00000000000..62c9c505865 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_object_to_test_additional_properties.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties + +class TestObjectToTestAdditionalProperties(unittest.TestCase): + """ObjectToTestAdditionalProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ObjectToTestAdditionalProperties: + """Test ObjectToTestAdditionalProperties + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ObjectToTestAdditionalProperties` + """ + model = ObjectToTestAdditionalProperties() + if include_optional: + return ObjectToTestAdditionalProperties( + var_property = True + ) + else: + return ObjectToTestAdditionalProperties( + ) + """ + + def testObjectToTestAdditionalProperties(self): + """Test ObjectToTestAdditionalProperties""" + # 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-httpx/test/test_object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-httpx/test/test_object_with_deprecated_fields.py new file mode 100644 index 00000000000..bf6bf779339 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_object_with_deprecated_fields.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields + +class TestObjectWithDeprecatedFields(unittest.TestCase): + """ObjectWithDeprecatedFields unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ObjectWithDeprecatedFields: + """Test ObjectWithDeprecatedFields + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ObjectWithDeprecatedFields` + """ + model = ObjectWithDeprecatedFields() + 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-httpx/test/test_one_of_enum_string.py b/samples/openapi3/client/petstore/python-httpx/test/test_one_of_enum_string.py new file mode 100644 index 00000000000..ca7314f13ef --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_one_of_enum_string.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.one_of_enum_string import OneOfEnumString + +class TestOneOfEnumString(unittest.TestCase): + """OneOfEnumString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOneOfEnumString(self): + """Test OneOfEnumString""" + # inst = OneOfEnumString() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_order.py b/samples/openapi3/client/petstore/python-httpx/test/test_order.py new file mode 100644 index 00000000000..a9b4980702d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_order.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.order import Order + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Order: + """Test Order + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Order` + """ + model = Order() + 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-httpx/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-httpx/test/test_outer_composite.py new file mode 100644 index 00000000000..5024f1c483a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_outer_composite.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.outer_composite import OuterComposite + +class TestOuterComposite(unittest.TestCase): + """OuterComposite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OuterComposite: + """Test OuterComposite + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OuterComposite` + """ + model = OuterComposite() + 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-httpx/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum.py new file mode 100644 index 00000000000..2f82ecc94ba --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.outer_enum import OuterEnum + +class TestOuterEnum(unittest.TestCase): + """OuterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """Test OuterEnum""" + # inst = OuterEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_default_value.py new file mode 100644 index 00000000000..2a7ff27a824 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_default_value.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue + +class TestOuterEnumDefaultValue(unittest.TestCase): + """OuterEnumDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumDefaultValue(self): + """Test OuterEnumDefaultValue""" + # inst = OuterEnumDefaultValue() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer.py new file mode 100644 index 00000000000..d74dcb0981a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.outer_enum_integer import OuterEnumInteger + +class TestOuterEnumInteger(unittest.TestCase): + """OuterEnumInteger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumInteger(self): + """Test OuterEnumInteger""" + # inst = OuterEnumInteger() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer_default_value.py new file mode 100644 index 00000000000..230db8cb817 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_outer_enum_integer_default_value.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue + +class TestOuterEnumIntegerDefaultValue(unittest.TestCase): + """OuterEnumIntegerDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumIntegerDefaultValue(self): + """Test OuterEnumIntegerDefaultValue""" + # inst = OuterEnumIntegerDefaultValue() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-httpx/test/test_outer_object_with_enum_property.py new file mode 100644 index 00000000000..a1c896ae661 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_outer_object_with_enum_property.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty + +class TestOuterObjectWithEnumProperty(unittest.TestCase): + """OuterObjectWithEnumProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OuterObjectWithEnumProperty: + """Test OuterObjectWithEnumProperty + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `OuterObjectWithEnumProperty` + """ + model = OuterObjectWithEnumProperty() + if include_optional: + return OuterObjectWithEnumProperty( + str_value = 'placed', + 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-httpx/test/test_parent.py b/samples/openapi3/client/petstore/python-httpx/test/test_parent.py new file mode 100644 index 00000000000..ea1242c24f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_parent.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.parent import Parent + +class TestParent(unittest.TestCase): + """Parent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Parent: + """Test Parent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Parent` + """ + model = Parent() + if include_optional: + return Parent( + optional_dict = { + 'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty( + a_property = petstore_api.models.a_property.aProperty(), ) + } + ) + else: + return Parent( + ) + """ + + def testParent(self): + """Test Parent""" + # 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-httpx/test/test_parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-httpx/test/test_parent_with_optional_dict.py new file mode 100644 index 00000000000..7cc74f9e98e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_parent_with_optional_dict.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict + +class TestParentWithOptionalDict(unittest.TestCase): + """ParentWithOptionalDict unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ParentWithOptionalDict: + """Test ParentWithOptionalDict + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ParentWithOptionalDict` + """ + model = ParentWithOptionalDict() + if include_optional: + return ParentWithOptionalDict( + optional_dict = { + 'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty( + a_property = petstore_api.models.a_property.aProperty(), ) + } + ) + else: + return ParentWithOptionalDict( + ) + """ + + def testParentWithOptionalDict(self): + """Test ParentWithOptionalDict""" + # 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-httpx/test/test_pet.py b/samples/openapi3/client/petstore/python-httpx/test/test_pet.py new file mode 100644 index 00000000000..3edc400fafc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_pet.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.pet import Pet + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Pet: + """Test Pet + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Pet` + """ + model = Pet() + 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-httpx/test/test_pet_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_pet_api.py new file mode 100644 index 00000000000..4cf869d36a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_pet_api.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.pet_api import PetApi + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self) -> None: + self.api = PetApi() + + def tearDown(self) -> None: + pass + + def test_add_pet(self) -> None: + """Test case for add_pet + + Add a new pet to the store + """ + pass + + def test_delete_pet(self) -> None: + """Test case for delete_pet + + Deletes a pet + """ + pass + + def test_find_pets_by_status(self) -> None: + """Test case for find_pets_by_status + + Finds Pets by status + """ + pass + + def test_find_pets_by_tags(self) -> None: + """Test case for find_pets_by_tags + + Finds Pets by tags + """ + pass + + def test_get_pet_by_id(self) -> None: + """Test case for get_pet_by_id + + Find pet by ID + """ + pass + + def test_update_pet(self) -> None: + """Test case for update_pet + + Update an existing pet + """ + pass + + def test_update_pet_with_form(self) -> None: + """Test case for update_pet_with_form + + Updates a pet in the store with form data + """ + pass + + def test_upload_file(self) -> None: + """Test case for upload_file + + uploads an image + """ + pass + + def test_upload_file_with_required_file(self) -> None: + """Test case for upload_file_with_required_file + + uploads an image (required) + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_pig.py b/samples/openapi3/client/petstore/python-httpx/test/test_pig.py new file mode 100644 index 00000000000..c336579232b --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_pig.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.pig import Pig + +class TestPig(unittest.TestCase): + """Pig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Pig: + """Test Pig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Pig` + """ + model = Pig() + if include_optional: + return Pig( + class_name = '', + color = '', + size = 56 + ) + else: + return Pig( + class_name = '', + color = '', + size = 56, + ) + """ + + def testPig(self): + """Test Pig""" + # 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-httpx/test/test_pony_sizes.py b/samples/openapi3/client/petstore/python-httpx/test/test_pony_sizes.py new file mode 100644 index 00000000000..8586169f798 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_pony_sizes.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.pony_sizes import PonySizes + +class TestPonySizes(unittest.TestCase): + """PonySizes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PonySizes: + """Test PonySizes + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PonySizes` + """ + model = PonySizes() + if include_optional: + return PonySizes( + type = 2.0 + ) + else: + return PonySizes( + ) + """ + + def testPonySizes(self): + """Test PonySizes""" + # 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-httpx/test/test_poop_cleaning.py b/samples/openapi3/client/petstore/python-httpx/test/test_poop_cleaning.py new file mode 100644 index 00000000000..5a12f965aef --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_poop_cleaning.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.poop_cleaning import PoopCleaning + +class TestPoopCleaning(unittest.TestCase): + """PoopCleaning unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PoopCleaning: + """Test PoopCleaning + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PoopCleaning` + """ + model = PoopCleaning() + if include_optional: + return PoopCleaning( + task_name = 'cleaning', + function_name = 'care', + content = '' + ) + else: + return PoopCleaning( + task_name = 'cleaning', + function_name = 'care', + content = '', + ) + """ + + def testPoopCleaning(self): + """Test PoopCleaning""" + # 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-httpx/test/test_primitive_string.py b/samples/openapi3/client/petstore/python-httpx/test/test_primitive_string.py new file mode 100644 index 00000000000..67ec90914d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_primitive_string.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.primitive_string import PrimitiveString + +class TestPrimitiveString(unittest.TestCase): + """PrimitiveString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PrimitiveString: + """Test PrimitiveString + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PrimitiveString` + """ + model = PrimitiveString() + if include_optional: + return PrimitiveString( + value = '' + ) + else: + return PrimitiveString( + ) + """ + + def testPrimitiveString(self): + """Test PrimitiveString""" + # 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-httpx/test/test_property_map.py b/samples/openapi3/client/petstore/python-httpx/test/test_property_map.py new file mode 100644 index 00000000000..2f2fed72a13 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_property_map.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.property_map import PropertyMap + +class TestPropertyMap(unittest.TestCase): + """PropertyMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PropertyMap: + """Test PropertyMap + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PropertyMap` + """ + model = PropertyMap() + if include_optional: + return PropertyMap( + some_data = { + 'key' : petstore_api.models.tag.Tag( + id = 56, + name = '', ) + } + ) + else: + return PropertyMap( + ) + """ + + def testPropertyMap(self): + """Test PropertyMap""" + # 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-httpx/test/test_property_name_collision.py b/samples/openapi3/client/petstore/python-httpx/test/test_property_name_collision.py new file mode 100644 index 00000000000..ab7919c7e6a --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_property_name_collision.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.property_name_collision import PropertyNameCollision + +class TestPropertyNameCollision(unittest.TestCase): + """PropertyNameCollision unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PropertyNameCollision: + """Test PropertyNameCollision + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PropertyNameCollision` + """ + model = PropertyNameCollision() + if include_optional: + return PropertyNameCollision( + underscore_type = '', + type = '', + type_with_underscore = '' + ) + else: + return PropertyNameCollision( + ) + """ + + def testPropertyNameCollision(self): + """Test PropertyNameCollision""" + # 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-httpx/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-httpx/test/test_read_only_first.py new file mode 100644 index 00000000000..ec7a1aa2414 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_read_only_first.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.read_only_first import ReadOnlyFirst + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ReadOnlyFirst: + """Test ReadOnlyFirst + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ReadOnlyFirst` + """ + model = ReadOnlyFirst() + 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-httpx/test/test_second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-httpx/test/test_second_circular_all_of_ref.py new file mode 100644 index 00000000000..21d9005a5e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_second_circular_all_of_ref.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef + +class TestSecondCircularAllOfRef(unittest.TestCase): + """SecondCircularAllOfRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SecondCircularAllOfRef: + """Test SecondCircularAllOfRef + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SecondCircularAllOfRef` + """ + model = SecondCircularAllOfRef() + if include_optional: + return SecondCircularAllOfRef( + name = '', + circular_all_of_ref = [ + petstore_api.models.circular_all_of_ref.CircularAllOfRef() + ] + ) + else: + return SecondCircularAllOfRef( + ) + """ + + def testSecondCircularAllOfRef(self): + """Test SecondCircularAllOfRef""" + # 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-httpx/test/test_second_ref.py b/samples/openapi3/client/petstore/python-httpx/test/test_second_ref.py new file mode 100644 index 00000000000..f6117988c19 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_second_ref.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.second_ref import SecondRef + +class TestSecondRef(unittest.TestCase): + """SecondRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SecondRef: + """Test SecondRef + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SecondRef` + """ + model = SecondRef() + if include_optional: + return SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', ), ), ) + ) + else: + return SecondRef( + ) + """ + + def testSecondRef(self): + """Test SecondRef""" + # 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-httpx/test/test_self_reference_model.py b/samples/openapi3/client/petstore/python-httpx/test/test_self_reference_model.py new file mode 100644 index 00000000000..018bcd195b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_self_reference_model.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.self_reference_model import SelfReferenceModel + +class TestSelfReferenceModel(unittest.TestCase): + """SelfReferenceModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfReferenceModel: + """Test SelfReferenceModel + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfReferenceModel` + """ + model = SelfReferenceModel() + if include_optional: + return SelfReferenceModel( + size = 56, + nested = petstore_api.models.dummy_model.Dummy-Model( + category = '', + self_ref = petstore_api.models.self_reference_model.Self-Reference-Model( + size = 56, + nested = petstore_api.models.dummy_model.Dummy-Model( + category = '', ), ), ) + ) + else: + return SelfReferenceModel( + ) + """ + + def testSelfReferenceModel(self): + """Test SelfReferenceModel""" + # 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-httpx/test/test_single_ref_type.py b/samples/openapi3/client/petstore/python-httpx/test/test_single_ref_type.py new file mode 100644 index 00000000000..630b1c13708 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_single_ref_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.single_ref_type import SingleRefType + +class TestSingleRefType(unittest.TestCase): + """SingleRefType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSingleRefType(self): + """Test SingleRefType""" + # inst = SingleRefType() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_special_character_enum.py b/samples/openapi3/client/petstore/python-httpx/test/test_special_character_enum.py new file mode 100644 index 00000000000..464808e61b0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_special_character_enum.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.special_character_enum import SpecialCharacterEnum + +class TestSpecialCharacterEnum(unittest.TestCase): + """SpecialCharacterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialCharacterEnum(self): + """Test SpecialCharacterEnum""" + # inst = SpecialCharacterEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-httpx/test/test_special_model_name.py new file mode 100644 index 00000000000..e913fa28f51 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_special_model_name.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.special_model_name import SpecialModelName + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpecialModelName: + """Test SpecialModelName + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpecialModelName` + """ + model = SpecialModelName() + 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-httpx/test/test_special_name.py b/samples/openapi3/client/petstore/python-httpx/test/test_special_name.py new file mode 100644 index 00000000000..153768c9898 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_special_name.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.special_name import SpecialName + +class TestSpecialName(unittest.TestCase): + """SpecialName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpecialName: + """Test SpecialName + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpecialName` + """ + model = SpecialName() + if include_optional: + return SpecialName( + var_property = 56, + var_async = petstore_api.models.category.Category( + id = 56, + name = 'default-name', ), + var_schema = 'available' + ) + else: + return SpecialName( + ) + """ + + def testSpecialName(self): + """Test SpecialName""" + # 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-httpx/test/test_store_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_store_api.py new file mode 100644 index 00000000000..603b0f7bc57 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_store_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.store_api import StoreApi + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self) -> None: + self.api = StoreApi() + + def tearDown(self) -> None: + pass + + def test_delete_order(self) -> None: + """Test case for delete_order + + Delete purchase order by ID + """ + pass + + def test_get_inventory(self) -> None: + """Test case for get_inventory + + Returns pet inventories by status + """ + pass + + def test_get_order_by_id(self) -> None: + """Test case for get_order_by_id + + Find purchase order by ID + """ + pass + + def test_place_order(self) -> None: + """Test case for place_order + + Place an order for a pet + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_tag.py b/samples/openapi3/client/petstore/python-httpx/test/test_tag.py new file mode 100644 index 00000000000..92061e615e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_tag.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.tag import Tag + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Tag: + """Test Tag + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tag` + """ + model = Tag() + 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-httpx/test/test_task.py b/samples/openapi3/client/petstore/python-httpx/test/test_task.py new file mode 100644 index 00000000000..0044da80776 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_task.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.task import Task + +class TestTask(unittest.TestCase): + """Task unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Task: + """Test Task + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Task` + """ + model = Task() + if include_optional: + return Task( + id = '', + activity = None + ) + else: + return Task( + id = '', + activity = None, + ) + """ + + def testTask(self): + """Test Task""" + # 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-httpx/test/test_task_activity.py b/samples/openapi3/client/petstore/python-httpx/test/test_task_activity.py new file mode 100644 index 00000000000..bd25e5887ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_task_activity.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.task_activity import TaskActivity + +class TestTaskActivity(unittest.TestCase): + """TaskActivity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TaskActivity: + """Test TaskActivity + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TaskActivity` + """ + model = TaskActivity() + if include_optional: + return TaskActivity( + task_name = 'cleaning_deep', + function_name = 'care_nourish', + content = '' + ) + else: + return TaskActivity( + task_name = 'cleaning_deep', + function_name = 'care_nourish', + content = '', + ) + """ + + def testTaskActivity(self): + """Test TaskActivity""" + # 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-httpx/test/test_test_enum.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_enum.py new file mode 100644 index 00000000000..aec65edf520 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_enum.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_enum import TestEnum + +class TestTestEnum(unittest.TestCase): + """TestEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnum(self): + """Test TestEnum""" + # inst = TestEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_test_enum_with_default.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_enum_with_default.py new file mode 100644 index 00000000000..b51e4281955 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_enum_with_default.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_enum_with_default import TestEnumWithDefault + +class TestTestEnumWithDefault(unittest.TestCase): + """TestEnumWithDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnumWithDefault(self): + """Test TestEnumWithDefault""" + # inst = TestEnumWithDefault() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model400_response.py new file mode 100644 index 00000000000..72d243b82fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model400_response.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response + +class TestTestErrorResponsesWithModel400Response(unittest.TestCase): + """TestErrorResponsesWithModel400Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestErrorResponsesWithModel400Response: + """Test TestErrorResponsesWithModel400Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestErrorResponsesWithModel400Response` + """ + model = TestErrorResponsesWithModel400Response() + if include_optional: + return TestErrorResponsesWithModel400Response( + reason400 = '' + ) + else: + return TestErrorResponsesWithModel400Response( + ) + """ + + def testTestErrorResponsesWithModel400Response(self): + """Test TestErrorResponsesWithModel400Response""" + # 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-httpx/test/test_test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model404_response.py new file mode 100644 index 00000000000..fff790172b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_error_responses_with_model404_response.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response + +class TestTestErrorResponsesWithModel404Response(unittest.TestCase): + """TestErrorResponsesWithModel404Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestErrorResponsesWithModel404Response: + """Test TestErrorResponsesWithModel404Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestErrorResponsesWithModel404Response` + """ + model = TestErrorResponsesWithModel404Response() + if include_optional: + return TestErrorResponsesWithModel404Response( + reason404 = '' + ) + else: + return TestErrorResponsesWithModel404Response( + ) + """ + + def testTestErrorResponsesWithModel404Response(self): + """Test TestErrorResponsesWithModel404Response""" + # 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-httpx/test/test_test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_inline_freeform_additional_properties_request.py new file mode 100644 index 00000000000..add42258580 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_inline_freeform_additional_properties_request.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest + +class TestTestInlineFreeformAdditionalPropertiesRequest(unittest.TestCase): + """TestInlineFreeformAdditionalPropertiesRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestInlineFreeformAdditionalPropertiesRequest: + """Test TestInlineFreeformAdditionalPropertiesRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestInlineFreeformAdditionalPropertiesRequest` + """ + model = TestInlineFreeformAdditionalPropertiesRequest() + if include_optional: + return TestInlineFreeformAdditionalPropertiesRequest( + some_property = '' + ) + else: + return TestInlineFreeformAdditionalPropertiesRequest( + ) + """ + + def testTestInlineFreeformAdditionalPropertiesRequest(self): + """Test TestInlineFreeformAdditionalPropertiesRequest""" + # 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-httpx/test/test_test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_model_with_enum_default.py new file mode 100644 index 00000000000..e58802b59de --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_model_with_enum_default.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault + +class TestTestModelWithEnumDefault(unittest.TestCase): + """TestModelWithEnumDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestModelWithEnumDefault: + """Test TestModelWithEnumDefault + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestModelWithEnumDefault` + """ + model = TestModelWithEnumDefault() + if include_optional: + return TestModelWithEnumDefault( + test_enum = 'ONE', + test_string = 'Just some string', + test_enum_with_default = 'ZWEI', + test_string_with_default = 'ahoy matey', + test_inline_defined_enum_with_default = 'B' + ) + else: + return TestModelWithEnumDefault( + test_enum = 'ONE', + ) + """ + + def testTestModelWithEnumDefault(self): + """Test TestModelWithEnumDefault""" + # 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-httpx/test/test_test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-httpx/test/test_test_object_for_multipart_requests_request_marker.py new file mode 100644 index 00000000000..585a39c8fe6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_test_object_for_multipart_requests_request_marker.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker + +class TestTestObjectForMultipartRequestsRequestMarker(unittest.TestCase): + """TestObjectForMultipartRequestsRequestMarker unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestObjectForMultipartRequestsRequestMarker: + """Test TestObjectForMultipartRequestsRequestMarker + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TestObjectForMultipartRequestsRequestMarker` + """ + model = TestObjectForMultipartRequestsRequestMarker() + if include_optional: + return TestObjectForMultipartRequestsRequestMarker( + name = '' + ) + else: + return TestObjectForMultipartRequestsRequestMarker( + ) + """ + + def testTestObjectForMultipartRequestsRequestMarker(self): + """Test TestObjectForMultipartRequestsRequestMarker""" + # 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-httpx/test/test_tiger.py b/samples/openapi3/client/petstore/python-httpx/test/test_tiger.py new file mode 100644 index 00000000000..2d153c1749c --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_tiger.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.tiger import Tiger + +class TestTiger(unittest.TestCase): + """Tiger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Tiger: + """Test Tiger + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tiger` + """ + model = Tiger() + if include_optional: + return Tiger( + skill = '' + ) + else: + return Tiger( + ) + """ + + def testTiger(self): + """Test Tiger""" + # 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-httpx/test/test_type.py b/samples/openapi3/client/petstore/python-httpx/test/test_type.py new file mode 100644 index 00000000000..ecafff8199d --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.type import Type + +class TestType(unittest.TestCase): + """Type unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testType(self): + """Test Type""" + # inst = Type() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_model_list_properties.py new file mode 100644 index 00000000000..874af4e78f8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_model_list_properties.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties + +class TestUnnamedDictWithAdditionalModelListProperties(unittest.TestCase): + """UnnamedDictWithAdditionalModelListProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnnamedDictWithAdditionalModelListProperties: + """Test UnnamedDictWithAdditionalModelListProperties + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnnamedDictWithAdditionalModelListProperties` + """ + model = UnnamedDictWithAdditionalModelListProperties() + if include_optional: + return UnnamedDictWithAdditionalModelListProperties( + dict_property = { + 'key' : [ + petstore_api.models.creature_info.CreatureInfo( + name = '', ) + ] + } + ) + else: + return UnnamedDictWithAdditionalModelListProperties( + ) + """ + + def testUnnamedDictWithAdditionalModelListProperties(self): + """Test UnnamedDictWithAdditionalModelListProperties""" + # 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-httpx/test/test_unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_string_list_properties.py new file mode 100644 index 00000000000..e0a94bc92dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_unnamed_dict_with_additional_string_list_properties.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties + +class TestUnnamedDictWithAdditionalStringListProperties(unittest.TestCase): + """UnnamedDictWithAdditionalStringListProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnnamedDictWithAdditionalStringListProperties: + """Test UnnamedDictWithAdditionalStringListProperties + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnnamedDictWithAdditionalStringListProperties` + """ + model = UnnamedDictWithAdditionalStringListProperties() + if include_optional: + return UnnamedDictWithAdditionalStringListProperties( + dict_property = { + 'key' : [ + '' + ] + } + ) + else: + return UnnamedDictWithAdditionalStringListProperties( + ) + """ + + def testUnnamedDictWithAdditionalStringListProperties(self): + """Test UnnamedDictWithAdditionalStringListProperties""" + # 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-httpx/test/test_upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-httpx/test/test_upload_file_with_additional_properties_request_object.py new file mode 100644 index 00000000000..8b3fa3b9084 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_upload_file_with_additional_properties_request_object.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject + +class TestUploadFileWithAdditionalPropertiesRequestObject(unittest.TestCase): + """UploadFileWithAdditionalPropertiesRequestObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UploadFileWithAdditionalPropertiesRequestObject: + """Test UploadFileWithAdditionalPropertiesRequestObject + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UploadFileWithAdditionalPropertiesRequestObject` + """ + model = UploadFileWithAdditionalPropertiesRequestObject() + if include_optional: + return UploadFileWithAdditionalPropertiesRequestObject( + name = '' + ) + else: + return UploadFileWithAdditionalPropertiesRequestObject( + ) + """ + + def testUploadFileWithAdditionalPropertiesRequestObject(self): + """Test UploadFileWithAdditionalPropertiesRequestObject""" + # 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-httpx/test/test_user.py b/samples/openapi3/client/petstore/python-httpx/test/test_user.py new file mode 100644 index 00000000000..19c32073322 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_user.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.user import User + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> User: + """Test User + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `User` + """ + model = User() + 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-httpx/test/test_user_api.py b/samples/openapi3/client/petstore/python-httpx/test/test_user_api.py new file mode 100644 index 00000000000..6b17c42093e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_user_api.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.api.user_api import UserApi + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self) -> None: + self.api = UserApi() + + def tearDown(self) -> None: + pass + + def test_create_user(self) -> None: + """Test case for create_user + + Create user + """ + pass + + def test_create_users_with_array_input(self) -> None: + """Test case for create_users_with_array_input + + Creates list of users with given input array + """ + pass + + def test_create_users_with_list_input(self) -> None: + """Test case for create_users_with_list_input + + Creates list of users with given input array + """ + pass + + def test_delete_user(self) -> None: + """Test case for delete_user + + Delete user + """ + pass + + def test_get_user_by_name(self) -> None: + """Test case for get_user_by_name + + Get user by user name + """ + pass + + def test_login_user(self) -> None: + """Test case for login_user + + Logs user into the system + """ + pass + + def test_logout_user(self) -> None: + """Test case for logout_user + + Logs out current logged in user session + """ + pass + + def test_update_user(self) -> None: + """Test case for update_user + + Updated user + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-httpx/test/test_with_nested_one_of.py b/samples/openapi3/client/petstore/python-httpx/test/test_with_nested_one_of.py new file mode 100644 index 00000000000..e73d0279b96 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/test/test_with_nested_one_of.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.with_nested_one_of import WithNestedOneOf + +class TestWithNestedOneOf(unittest.TestCase): + """WithNestedOneOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WithNestedOneOf: + """Test WithNestedOneOf + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WithNestedOneOf` + """ + model = WithNestedOneOf() + if include_optional: + return WithNestedOneOf( + size = 56, + nested_pig = None, + nested_oneof_enum_string = 'a' + ) + else: + return WithNestedOneOf( + ) + """ + + def testWithNestedOneOf(self): + """Test WithNestedOneOf""" + # 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-httpx/testfiles/foo.png b/samples/openapi3/client/petstore/python-httpx/testfiles/foo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9b12cf5927ac757b054dd875ee137c2581f69bb GIT binary patch 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@ literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/python-httpx/tests/__init__.py b/samples/openapi3/client/petstore/python-httpx/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python-httpx/tests/test_api_client.py b/samples/openapi3/client/petstore/python-httpx/tests/test_api_client.py new file mode 100644 index 00000000000..75a0d4bdbdc --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tests/test_api_client.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +# flake8: noqa + +import unittest +import weakref + +import petstore_api + +HOST = 'http://localhost/v2' + +class TestApiClient(unittest.IsolatedAsyncioTestCase): + async def test_ignore_operation_servers(self): + config = petstore_api.Configuration(host=HOST) + async with petstore_api.ApiClient(config) as client: + user_api_instance = petstore_api.UserApi(client) + + config_ignore = petstore_api.Configuration(host=HOST, ignore_operation_servers=True) + client_ignore = petstore_api.ApiClient(config_ignore) + user_api_instance_ignore = petstore_api.UserApi(client_ignore) + + params_to_serialize = { + 'user': petstore_api.User(id=1, username='test'), + '_request_auth': None, + '_content_type': 'application/json', + '_headers': None, + '_host_index': 0 + } + + # operation servers should be used + _, url, *_ = user_api_instance._create_user_serialize(**params_to_serialize) + self.assertEqual(client.configuration.host, HOST) + self.assertEqual(url, 'http://localhost/v2/user') + + # operation servers should be ignored + _, url_ignore, *_ = user_api_instance_ignore._create_user_serialize(**params_to_serialize) + self.assertEqual(client.configuration.host, HOST) + self.assertEqual(url_ignore, HOST + '/user') diff --git a/samples/openapi3/client/petstore/python-httpx/tests/test_model.py b/samples/openapi3/client/petstore/python-httpx/tests/test_model.py new file mode 100644 index 00000000000..c7dc4132135 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tests/test_model.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +# flake8: noqa + + +from datetime import date +import os +import time +import unittest + +from pydantic import ValidationError + +import petstore_api + + +class ModelTests(unittest.TestCase): + + def setUp(self): + self.pet = petstore_api.Pet(name="test name", photoUrls=["string"]) + self.pet.id = 1 + self.pet.status = "available" + cate = petstore_api.Category(name="dog") + cate.id = 1 + cate.name = "dog" + self.pet.category = cate + tag = petstore_api.Tag() + tag.id = 1 + self.pet.tags = [tag] + + def test_cat(self): + self.cat = petstore_api.Cat(className="cat") + self.assertEqual("cat", self.cat.class_name) + self.assertEqual("red", self.cat.color) + cat_str = "{'className': 'cat', 'color': 'red', 'declawed': None}" + self.assertEqual(cat_str, self.cat.to_str()) + + def test_to_str(self): + data = ("{'category': {'id': 1, 'name': 'dog'},\n" + " 'id': 1,\n" + " 'name': 'test name',\n" + " 'photoUrls': ['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", photoUrls=["string"]) + self.pet1.id = 1 + self.pet1.status = "available" + cate1 = petstore_api.Category(name="dog") + 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", photoUrls=["string"]) + self.pet2.id = 1 + self.pet2.status = "available" + cate2 = petstore_api.Category(name="dog") + 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) + + def test_oneOf(self): + # test new Pig + new_pig = petstore_api.Pig() + self.assertEqual("null", new_pig.to_json()) + self.assertEqual(None, new_pig.actual_instance) + + # test from_json + json_str = '{"className": "BasquePig", "color": "red"}' + p = petstore_api.Pig.from_json(json_str) + self.assertIsInstance(p.actual_instance, petstore_api.BasquePig) + + # test init + basque_pig = p.actual_instance + pig2 = petstore_api.Pig(actual_instance=basque_pig) + self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig) + + # test failed init + try: + pig3 = petstore_api.Pig(actual_instance="123") + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + self.assertIn("or instance of BasquePig", str(e)) + self.assertIn("or instance of DanishPig", str(e)) + + # failure + try: + p2 = petstore_api.Pig.from_json("1") + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + # No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: 1 validation error for BasquePig + # Input should be a valid dictionary or instance of BasquePig [type=model_type, input_value=1, input_type=int] + # For further information visit https://errors.pydantic.dev/2.3/v/model_type, 1 validation error for DanishPig + # Input should be a valid dictionary or instance of DanishPig [type=model_type, input_value=1, input_type=int] + # For further information visit https://errors.pydantic.dev/2.3/v/model_type + self.assertIn("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig.", str(e)) + self.assertIn("Input should be a valid dictionary or instance of BasquePig", str(e)) + self.assertIn("Input should be a valid dictionary or instance of DanishPig", str(e)) + + # test to_json + self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}') + + # test nested property + nested = petstore_api.WithNestedOneOf(size = 1, nested_pig = p) + self.assertEqual(nested.to_json(), '{"size": 1, "nested_pig": {"className": "BasquePig", "color": "red"}}') + + nested_json = nested.to_json() + nested2 = petstore_api.WithNestedOneOf.from_json(nested_json) + assert nested2 is not None + self.assertEqual(nested2.to_json(), nested_json) + + def test_anyOf(self): + # test new AnyOfPig + new_anypig = petstore_api.AnyOfPig() + self.assertEqual("null", new_anypig.to_json()) + self.assertEqual(None, new_anypig.actual_instance) + + # test from_json + json_str = '{"className": "BasquePig", "color": "red"}' + p = petstore_api.AnyOfPig.from_json(json_str) + self.assertIsInstance(p.actual_instance, petstore_api.BasquePig) + + # test init + basque_pig = p.actual_instance + pig2 = petstore_api.Pig(actual_instance=basque_pig) + self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig) + + # test failed init + try: + pig3 = petstore_api.AnyOfPig(actual_instance="123") + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + # pydantic_core._pydantic_core.ValidationError: 1 validation error for AnyOfPig + # actual_instance + # Value error, No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: Error! Input type `` is not `BasquePig`, Error! Input type `` is not `DanishPig` [type=value_error, input_value='123', input_type=str] + # For further information visit https://errors.pydantic.dev/2.4/v/value_error + self.assertIn("No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, DanishPig.", str(e)) + self.assertIn("Input type `` is not `BasquePig`", str(e)) + self.assertIn("Input type `` is not `DanishPig`", str(e)) + + # failure + try: + p2 = petstore_api.AnyOfPig.from_json("1") + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + # No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: 1 validation error for BasquePig + # Input should be a valid dictionary or instance of BasquePig [type=model_type, input_value=1, input_type=int] + # For further information visit https://errors.pydantic.dev/2.3/v/model_type, 1 validation error for DanishPig + # Input should be a valid dictionary or instance of DanishPig [type=model_type, input_value=1, input_type=int] + # For further information visit https://errors.pydantic.dev/2.3/v/model_type + self.assertIn( "No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig", str(e)) + self.assertIn("Input should be a valid dictionary or instance of BasquePig", str(e)) + self.assertIn("Input should be a valid dictionary or instance of DanishPig", str(e)) + + # test to_json + self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}') + + def test_inheritance(self): + dog = petstore_api.Dog(breed="bulldog", className="dog", color="white") + self.assertEqual(dog.to_json(), '{"className": "dog", "color": "white", "breed": "bulldog"}') + self.assertEqual(dog.to_dict(), {'breed': 'bulldog', 'className': + 'dog', 'color': 'white'}) + dog2 = petstore_api.Dog.from_json(dog.to_json()) + assert dog2 is not None + self.assertEqual(dog2.breed, 'bulldog') + self.assertEqual(dog2.class_name, "dog") + self.assertEqual(dog2.color, 'white') + + @unittest.skip("TODO: pydantic v2: Optional[StrictStr] is not strict like StrictStr") + def test_list(self): + # should throw exception as var_123_list should be string + try: + # Don't check the typing, because we are actually testing a typing error. + l3 = petstore_api.ListClass(**{"123-list": 123}) # type: ignore + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + #error_message = ( + # "1 validation error for List\n" + # "123-list\n" + # " str type expected (type=type_error.str)\n") + self.assertTrue("str type expected" in str(e)) + + l = petstore_api.ListClass(**{"123-list": "bulldog"}) + self.assertEqual(l.to_json(), '{"123-list":"bulldog"}') + self.assertEqual(l.to_dict(), {'123-list': 'bulldog'}) + + l2 = petstore_api.ListClass.from_json(l.to_json()) + assert l2 is not None + self.assertEqual(l2.var_123_list, 'bulldog') + self.assertTrue(isinstance(l2, petstore_api.ListClass)) + + def test_enum_ref_property(self): + # test enum ref property + # test to_json + d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1) + self.assertEqual(d.to_json(), '{"value": 1}') + d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED) + self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}') + + # test from_json (round trip) + d3 = petstore_api.OuterObjectWithEnumProperty.from_json(d2.to_json()) + assert d3 is not None + self.assertEqual(d3.str_value, petstore_api.OuterEnum.DELIVERED) + self.assertEqual(d3.value, petstore_api.OuterEnumInteger.NUMBER_1) + self.assertEqual(d3.to_json(), '{"str_value": "delivered", "value": 1}') + + def test_float_strict_type(self): + # assigning 123 to float shouldn't throw an exception + a = petstore_api.FormatTest(number=39.8, float=123, byte=bytes("string", 'utf-8'), date=date(2013, 9, 17), password="testing09876") + self.assertEqual(a.var_float, 123.0) + + json_str = "{\"number\": 34.5, \"float\": \"456\", \"date\": \"2013-12-08\", \"password\": \"empty1234567\", \"pattern_with_digits\": \"1234567890\", \"pattern_with_digits_and_delimiter\": \"image_123\", \"string_with_double_quote_pattern\": \"this is \\\"something\\\"\", \"string\": \"string\"}" + # no exception thrown when assigning 456 (integer) to float type since strict is set to false + f = petstore_api.FormatTest.from_json(json_str) + assert f is not None + self.assertEqual(f.var_float, 456.0) + + def test_valdiator(self): + # test regular expression + a = petstore_api.FormatTest(number=123.45, byte=bytes("string", 'utf-8'), date=date(2013, 9, 17), password="testing09876") + try: + a.pattern_with_digits_and_delimiter = "123" + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + self.assertTrue(r"must validate the regular expression /^image_\d{1,3}$/i" in str(e)) + + a.pattern_with_digits_and_delimiter = "IMAGE_123" + self.assertEqual(a.pattern_with_digits_and_delimiter, "IMAGE_123") + a.pattern_with_digits_and_delimiter = "image_123" + self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123") + + def test_inline_enum_validator(self): + self.pet = petstore_api.Pet(name="test name", photoUrls=["string"]) + self.pet.id = 1 + try: + self.pet.status = "error" + self.assertTrue(False) # this line shouldn't execute + except ValueError as e: + self.assertTrue("must be one of enum values ('available', 'pending', 'sold')" in str(e)) + + def test_constraints(self): + rgb = [128, 128, 128] + rgba = [128, 128, 128, 128] + hex_color = "#00FF00" + + # These should all pass + color = petstore_api.Color(oneof_schema_1_validator=rgb) + self.assertEqual(rgb, color.oneof_schema_1_validator) + + color = petstore_api.Color(oneof_schema_2_validator=rgba) + self.assertEqual(rgba, color.oneof_schema_2_validator) + + color = petstore_api.Color(oneof_schema_3_validator=hex_color) + self.assertEqual(hex_color, color.oneof_schema_3_validator) + + try: + petstore_api.Color(oneof_schema_1_validator=rgba) + self.fail("invalid validation") + except ValidationError as e: + self.assertIn("List should have at most 3 items after validation, not 4", str(e)) + + try: + petstore_api.Color(oneof_schema_2_validator=rgb) + self.fail("invalid validation") + except ValidationError as e: + self.assertIn("List should have at least 4 items after validation, not 3", str(e)) + + try: + petstore_api.Color(oneof_schema_3_validator="too long string") + self.fail("invalid validation") + except ValidationError as e: + self.assertIn("String should have at most 7 characters", str(e)) diff --git a/samples/openapi3/client/petstore/python-httpx/tests/test_pet_api.py b/samples/openapi3/client/petstore/python-httpx/tests/test_pet_api.py new file mode 100644 index 00000000000..d0864a65bba --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tests/test_pet_api.py @@ -0,0 +1,244 @@ +# 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 httpx + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ApiException + +from .util import id_gen + + +HOST = "http://localhost:80/v2" + + +class TestPetApiTests(unittest.IsolatedAsyncioTestCase): + async def asyncSetUp(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() + + async def asyncTearDown(self): + await self.api_client.close() + + def setUpModels(self): + self.category = petstore_api.Category(id=id_gen(), name="dog") + # 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", + photoUrls=["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_accept_header_serialization(self): + (_, _, headers, *_) = self.pet_api._get_pet_by_id_serialize( + pet_id=self.pet.id, + _request_auth=None, + _content_type=None, + _headers=None, + _host_index=0, + ) + self.assertEqual(headers["Accept"], "application/json") + + (_, _, headers_overwritten, *_) = self.pet_api._get_pet_by_id_serialize( + pet_id=self.pet.id, + _request_auth=None, + _content_type=None, + _headers={"Accept": "text/plain"}, + _host_index=0, + ) + self.assertEqual(headers_overwritten["Accept"], "text/plain") + + def test_separate_default_client_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertEqual(id(pet_api.api_client), id(pet_api2.api_client)) + + def test_separate_default_config_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertEqual( + id(pet_api.api_client.configuration), id(pet_api2.api_client.configuration) + ) + + async def test_async_with_result(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.id is not None + + tasks = [ + asyncio.create_task(coro) + for coro in [ + self.pet_api.get_pet_by_id(self.pet.id), + self.pet_api.get_pet_by_id(self.pet.id), + ] + ] + + responses = await asyncio.gather(*tasks) + for response in responses: + self.assertEqual(response.id, self.pet.id) + self.assertEqual(len(responses), 2) + + 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 def test_add_pet_and_get_pet_by_id(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.id is not None + + fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + assert self.pet.category is not None + assert fetched.category is not None + self.assertEqual(self.pet.category.name, fetched.category.name) + + async def test_add_pet_and_get_pet_by_id_with_http_info(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.id is not None + + fetched = await self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.data.id) + assert self.pet.category is not None + assert fetched.data.category is not None + self.assertEqual(self.pet.category.name, fetched.data.category.name) + + @unittest.skip("TODO: httpx: httpx.AsyncClient.request always preloads content") + async def test_add_pet_and_get_pet_by_id_without_preload_content(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.id is not None + + fetched = await self.pet_api.get_pet_by_id_without_preload_content( + pet_id=self.pet.id + ) + self.assertIsInstance(fetched, httpx.Response) + read = await fetched.aread() + self.assertTrue(fetched.is_closed) + self.assertIsInstance(read, bytes) + self.assertEqual(await fetched.aread(), b"") + self.assertTrue(read.decode("utf-8").startswith('{"id":')) + + async def test_update_pet(self): + self.pet.name = "hello kity with updated" + await self.pet_api.update_pet(self.pet) + assert self.pet.id is not None + + fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(self.pet.name, fetched.name) + assert self.pet.category is not None + assert fetched.category is not None + self.assertEqual(fetched.category.name, self.pet.category.name) + + async def test_find_pets_by_status(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.status is not None + 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 def test_find_pets_by_tags(self): + await self.pet_api.add_pet(self.pet) + assert self.tag.name is not None + 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 def test_update_pet_with_form(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.id is not None + + 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 def test_upload_file(self): + # upload file with form parameter + try: + additional_metadata = "special" + assert self.pet.id is not None + 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 def test_delete_pet(self): + await self.pet_api.add_pet(self.pet) + assert self.pet.id is not None + 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 def test_proxy(self): + config = Configuration() + # set not-existent proxy and catch an error to verify that + # the client library (httpx) tried to use it. + config.proxy = "http://localhost:8080/proxy" + async with petstore_api.ApiClient(config) as client: + pet_api = petstore_api.PetApi(client) + assert self.pet.id is not None + + with self.assertRaisesRegex( + petstore_api.rest.httpx.ConnectError, + "All connection attempts failed", + ): + 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/openapi3/client/petstore/python-httpx/tests/test_pet_model.py b/samples/openapi3/client/petstore/python-httpx/tests/test_pet_model.py new file mode 100644 index 00000000000..e4738e86b3e --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tests/test_pet_model.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +# flake8: noqa + +import os +import time +import unittest + +import petstore_api +import json +from pydantic import ValidationError + + +class PetModelTests(unittest.TestCase): + + def setUp(self): + self.pet = petstore_api.Pet(name="test name", photoUrls=["string"]) + self.pet.id = 1 + self.pet.status = "available" + cate = petstore_api.Category(name="dog") + 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" + " 'photoUrls': ['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", photoUrls=["string"]) + self.pet1.id = 1 + self.pet1.status = "available" + cate1 = petstore_api.Category(name="dog") + 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", photoUrls=["string"]) + self.pet2.id = 1 + self.pet2.status = "available" + cate2 = petstore_api.Category(name="dog") + 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) + + # test from_json, to_json, to_dict, from_dict + def test_from_to_methods(self): + json_str = ("{\"category\": {\"id\": 1, \"name\": \"dog\"},\n" + " \"id\": 1,\n" + " \"name\": \"test name\",\n" + " \"photoUrls\": [\"string\"],\n" + " \"status\": \"available\",\n" + " \"tags\": [{\"id\": 1, \"name\": \"None\"}]}") + pet = petstore_api.Pet.from_json(json_str) + assert pet is not None + self.assertEqual(pet.id, 1) + self.assertEqual(pet.status, "available") + self.assertEqual(pet.photo_urls, ["string"]) + assert pet.tags is not None + self.assertEqual(pet.tags[0].id, 1) + self.assertEqual(pet.tags[0].name, "None") + assert pet.category is not None + self.assertEqual(pet.category.id, 1) + # test to_json + self.assertEqual(pet.to_json(), + '{"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": [' + '"string"], "tags": [{"id": 1, "name": "None"}], "status": "available"}') + + # test to_dict + self.assertEqual(pet.to_dict(), + {"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ["string"], + "tags": [{"id": 1, "name": "None"}], "status": "available"}) + + # test from_dict + pet2 = petstore_api.Pet.from_dict(pet.to_dict()) + assert pet2 is not None + self.assertEqual(pet2.id, 1) + self.assertEqual(pet2.status, "available") + self.assertEqual(pet2.photo_urls, ["string"]) + assert pet2.tags is not None + self.assertEqual(pet2.tags[0].id, 1) + self.assertEqual(pet2.tags[0].name, "None") + assert pet2.category is not None + self.assertEqual(pet2.category.id, 1) + + def test_unpack_operator(self): + pet = petstore_api.Pet( + name="required name", + id=123, + photoUrls=["https://a.com", "https://b.com"], + ) + self.assertEqual(pet.to_json(), '{"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}') + self.assertEqual(pet.to_dict(), {"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}) + def test_optional_fields(self): + pet = petstore_api.Pet(name="required name", + photoUrls=["https://a.com", + "https://b.com"]) + self.assertEqual(pet.to_json(), '{"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}') + self.assertEqual(pet.to_dict(), {"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}) + + + diff --git a/samples/openapi3/client/petstore/python-httpx/tests/test_rest.py b/samples/openapi3/client/petstore/python-httpx/tests/test_rest.py new file mode 100644 index 00000000000..4507319e861 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tests/test_rest.py @@ -0,0 +1,75 @@ +import os +import unittest +from unittest.mock import AsyncMock, Mock, patch + +import petstore_api + + +def get_field_from_formdata(formdata, name): + return next(filter(lambda x: x[0]["name"] == name, formdata._fields))[-1] + + +class TestMultipleResponseTypes(unittest.IsolatedAsyncioTestCase): + 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.test_file_path = os.path.join(self.test_file_dir, "foo.png") + + def setUp(self): + self.setUpFiles() + + async def test_multipart_requests(self): + mock_resp = AsyncMock() + mock_resp.return_value.aread.return_value = b"some text" + mock_resp.return_value.status_code = 200 + mock_resp.return_value.headers = {} + + marker = petstore_api.TestObjectForMultipartRequestsRequestMarker( + name="name", + ) + + with patch("httpx.AsyncClient.request", mock_resp): + async with petstore_api.ApiClient() as api_client: + fake_api = petstore_api.FakeApi(api_client) + await fake_api.test_object_for_multipart_requests(marker=marker) + + # success if no errors + + async def test_multipart_requests_with_file_and_additional_properties(self): + mock_resp = Mock() + mock_resp.status_code = 200 + mock_resp.aread = AsyncMock( + return_value=b'{"code": 200, "type": "success", "message": "OK"}' + ) + mock_resp.headers = {"Content-Type": "application/json"} + + mock_request = AsyncMock(return_value=mock_resp) + with ( + open(self.test_file_path, "rb") as f, + patch("httpx.AsyncClient.request", mock_request), + ): + async with petstore_api.ApiClient() as api_client: + fake_api = petstore_api.FakeApi(api_client) + returned = await fake_api.upload_file_with_additional_properties( + file=(self.test_file_path, f.read()), + count=100, + object=petstore_api.UploadFileWithAdditionalPropertiesRequestObject( + name="foo" + ), + ) + + assert ( + returned.code == 200 + and returned.type == "success" + and returned.message == "OK" + ) + + mock_request.assert_called_once() + + formdata = mock_request.call_args_list[0].kwargs["data"] + + data_object = formdata["object"] + data_count = formdata["count"] + + assert type(data_count) is str + assert type(data_object) is str diff --git a/samples/openapi3/client/petstore/python-httpx/tests/util.py b/samples/openapi3/client/petstore/python-httpx/tests/util.py new file mode 100644 index 00000000000..113d7dcc547 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tests/util.py @@ -0,0 +1,8 @@ +# 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-httpx/tox.ini b/samples/openapi3/client/petstore/python-httpx/tox.ini new file mode 100644 index 00000000000..8989fc3c4d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-httpx/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=petstore_api