From 6f994e3c52ea889a4d6012f71c3dea9154b620c8 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Tue, 19 May 2020 10:46:55 +0100 Subject: [PATCH 1/2] [kotlin][client] add support for coroutines with OkHttp --- bin/openapi3/kotlin-client-petstore-all.sh | 2 +- ...otlin-client-petstore-okhttp-coroutines.sh | 37 + .../{ => libraries/jvm-okhttp}/api.mustache | 2 +- .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../kotlin-jvm-okhttp4-coroutines/README.md | 173 ++++ .../build.gradle | 36 + .../docs/200Response.md | 11 + .../docs/AdditionalPropertiesClass.md | 11 + .../docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 56 ++ .../docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../kotlin-jvm-okhttp4-coroutines/docs/Cat.md | 10 + .../docs/CatAllOf.md | 10 + .../docs/Category.md | 11 + .../docs/ClassModel.md | 10 + .../docs/Client.md | 10 + .../docs/DefaultApi.md | 50 ++ .../kotlin-jvm-okhttp4-coroutines/docs/Dog.md | 10 + .../docs/DogAllOf.md | 10 + .../docs/EnumArrays.md | 25 + .../docs/EnumClass.md | 14 + .../docs/EnumTest.md | 45 + .../docs/FakeApi.md | 776 ++++++++++++++++++ .../docs/FakeClassnameTags123Api.md | 59 ++ .../docs/FileSchemaTestClass.md | 11 + .../kotlin-jvm-okhttp4-coroutines/docs/Foo.md | 10 + .../docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 10 + .../docs/InlineObject.md | 11 + .../docs/InlineObject1.md | 11 + .../docs/InlineObject2.md | 25 + .../docs/InlineObject3.md | 23 + .../docs/InlineObject4.md | 11 + .../docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../docs/List.md | 10 + .../docs/MapTest.md | 20 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Name.md | 13 + .../docs/NullableClass.md | 21 + .../docs/NumberOnly.md | 10 + .../docs/Order.md | 22 + .../docs/OuterComposite.md | 12 + .../docs/OuterEnum.md | 14 + .../docs/OuterEnumDefaultValue.md | 14 + .../docs/OuterEnumInteger.md | 14 + .../docs/OuterEnumIntegerDefaultValue.md | 14 + .../kotlin-jvm-okhttp4-coroutines/docs/Pet.md | 22 + .../docs/PetApi.md | 457 +++++++++++ .../docs/ReadOnlyFirst.md | 11 + .../docs/Return.md | 10 + .../docs/SpecialModelName.md | 10 + .../docs/StoreApi.md | 196 +++++ .../kotlin-jvm-okhttp4-coroutines/docs/Tag.md | 11 + .../docs/User.md | 17 + .../docs/UserApi.md | 376 +++++++++ .../settings.gradle | 2 + .../client/apis/AnotherFakeApi.kt | 77 ++ .../openapitools/client/apis/DefaultApi.kt | 76 ++ .../org/openapitools/client/apis/FakeApi.kt | 718 ++++++++++++++++ .../client/apis/FakeClassnameTags123Api.kt | 77 ++ .../org/openapitools/client/apis/PetApi.kt | 416 ++++++++++ .../org/openapitools/client/apis/StoreApi.kt | 198 +++++ .../org/openapitools/client/apis/UserApi.kt | 363 ++++++++ .../client/infrastructure/ApiAbstractions.kt | 23 + .../client/infrastructure/ApiClient.kt | 272 ++++++ .../ApiInfrastructureResponse.kt | 43 + .../infrastructure/ApplicationDelegates.kt | 29 + .../client/infrastructure/ByteArrayAdapter.kt | 33 + .../client/infrastructure/DateAdapter.kt | 37 + .../client/infrastructure/Errors.kt | 18 + .../client/infrastructure/LocalDateAdapter.kt | 35 + .../infrastructure/LocalDateTimeAdapter.kt | 35 + .../infrastructure/OffsetDateTimeAdapter.kt | 35 + .../client/infrastructure/RequestConfig.kt | 16 + .../client/infrastructure/RequestMethod.kt | 8 + .../infrastructure/ResponseExtensions.kt | 23 + .../client/infrastructure/Serializer.kt | 24 + .../models/AdditionalPropertiesClass.kt | 34 + .../org/openapitools/client/models/Animal.kt | 33 + .../openapitools/client/models/ApiResponse.kt | 37 + .../client/models/ArrayOfArrayOfNumberOnly.kt | 31 + .../client/models/ArrayOfNumberOnly.kt | 31 + .../openapitools/client/models/ArrayTest.kt | 38 + .../client/models/Capitalization.kt | 47 ++ .../org/openapitools/client/models/Cat.kt | 39 + .../openapitools/client/models/CatAllOf.kt | 31 + .../openapitools/client/models/Category.kt | 34 + .../openapitools/client/models/ClassModel.kt | 31 + .../org/openapitools/client/models/Client.kt | 31 + .../org/openapitools/client/models/Dog.kt | 39 + .../openapitools/client/models/DogAllOf.kt | 31 + .../openapitools/client/models/EnumArrays.kt | 52 ++ .../openapitools/client/models/EnumClass.kt | 47 ++ .../openapitools/client/models/EnumTest.kt | 94 +++ .../client/models/FileSchemaTestClass.kt | 34 + .../org/openapitools/client/models/Foo.kt | 31 + .../openapitools/client/models/FormatTest.kt | 75 ++ .../client/models/HasOnlyReadOnly.kt | 34 + .../client/models/HealthCheckResult.kt | 31 + .../client/models/InlineObject.kt | 36 + .../client/models/InlineObject1.kt | 36 + .../client/models/InlineObject2.kt | 55 ++ .../client/models/InlineObject3.kt | 84 ++ .../client/models/InlineObject4.kt | 36 + .../client/models/InlineObject5.kt | 36 + .../client/models/InlineResponseDefault.kt | 32 + .../org/openapitools/client/models/List.kt | 31 + .../org/openapitools/client/models/MapTest.kt | 49 ++ ...dPropertiesAndAdditionalPropertiesClass.kt | 38 + .../client/models/Model200Response.kt | 34 + .../org/openapitools/client/models/Name.kt | 40 + .../client/models/NullableClass.kt | 64 ++ .../openapitools/client/models/NumberOnly.kt | 31 + .../org/openapitools/client/models/Order.kt | 57 ++ .../client/models/OuterComposite.kt | 37 + .../openapitools/client/models/OuterEnum.kt | 47 ++ .../client/models/OuterEnumDefaultValue.kt | 47 ++ .../client/models/OuterEnumInteger.kt | 47 ++ .../models/OuterEnumIntegerDefaultValue.kt | 47 ++ .../org/openapitools/client/models/Pet.kt | 59 ++ .../client/models/ReadOnlyFirst.kt | 34 + .../org/openapitools/client/models/Return.kt | 31 + .../client/models/SpecialModelname.kt | 31 + .../org/openapitools/client/models/Tag.kt | 34 + .../org/openapitools/client/models/User.kt | 53 ++ 132 files changed, 7483 insertions(+), 2 deletions(-) create mode 100755 bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh rename modules/openapi-generator/src/main/resources/kotlin-client/{ => libraries/jvm-okhttp}/api.mustache (94%) create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/bin/openapi3/kotlin-client-petstore-all.sh b/bin/openapi3/kotlin-client-petstore-all.sh index 5be9f089bf28..4a97ccd2ff08 100755 --- a/bin/openapi3/kotlin-client-petstore-all.sh +++ b/bin/openapi3/kotlin-client-petstore-all.sh @@ -7,4 +7,4 @@ ./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh ./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh ./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh - +./bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh diff --git a/bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh b/bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh new file mode 100755 index 000000000000..05f3a05ea7e9 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +samplePath="samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines" + +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-okhttp4-coroutines-client --library jvm-okhttp4 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath + +echo "Generating Kotling client..." +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache similarity index 94% rename from modules/openapi-generator/src/main/resources/kotlin-client/api.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index bcf58a6d0caf..ee9bf10a7641 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -40,7 +40,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to {{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() {{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.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/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md new file mode 100644 index 000000000000..b7028d917a24 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md @@ -0,0 +1,173 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### 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 + + +### bearer_test + +- **Type**: HTTP basic authentication + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### http_signature_test + +- **Type**: HTTP basic authentication + + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle new file mode 100644 index 000000000000..ce9cb568dd7b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle @@ -0,0 +1,36 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1025301ce946 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md new file mode 100644 index 000000000000..5ce5a4972c8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..55d482238db4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} +``` + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md new file mode 100644 index 000000000000..6b4c6bf27795 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..23a475664205 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b115a5d54c22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md new file mode 100644 index 000000000000..aa0bbbe936c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md new file mode 100644 index 000000000000..9d44a82fb7ff --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md new file mode 100644 index 000000000000..b6da7c47cedd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md new file mode 100644 index 000000000000..1f12c3eb1582 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md new file mode 100644 index 000000000000..50ad61b51a56 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md new file mode 100644 index 000000000000..11afbcf0c9f5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md new file mode 100644 index 000000000000..784be537594d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md new file mode 100644 index 000000000000..41d9c6ba0d17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md new file mode 100644 index 000000000000..719084e5f949 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md new file mode 100644 index 000000000000..5ddb262871f9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md new file mode 100644 index 000000000000..f0370049eb3e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md new file mode 100644 index 000000000000..0a28947aa843 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md @@ -0,0 +1,776 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} +``` + +### 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 + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**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**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + e.printStackTrace() +} +``` + +### 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 + + +# **testEndpointParameters** +> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..962dfd4d2dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..089e61862c2a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md new file mode 100644 index 000000000000..e3e9918872b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md new file mode 100644 index 000000000000..0357923c97a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..ed3e4750f44f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md new file mode 100644 index 000000000000..472dc3104571 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md new file mode 100644 index 000000000000..2156c70addfe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md new file mode 100644 index 000000000000..2a77eecba2b7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md new file mode 100644 index 000000000000..0720925918bf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md new file mode 100644 index 000000000000..4ca6979b2806 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md new file mode 100644 index 000000000000..03c4daa76318 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md new file mode 100644 index 000000000000..c3c020b20f60 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..afdd81b1383e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md new file mode 100644 index 000000000000..13a09a4c4141 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md new file mode 100644 index 000000000000..8cee39e36048 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..744567412172 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md new file mode 100644 index 000000000000..343700533c72 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md new file mode 100644 index 000000000000..9ec43d0b87c6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md new file mode 100644 index 000000000000..41e8b82470bc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md new file mode 100644 index 000000000000..5112f08958d5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md new file mode 100644 index 000000000000..5296703674de --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md new file mode 100644 index 000000000000..9e7ecb9499a4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..821d297a001b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b40f6e4b7ef9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..c2fb3ee41d7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md new file mode 100644 index 000000000000..70c340005d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md new file mode 100644 index 000000000000..576d2f04ca85 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -0,0 +1,457 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..825f613f0907 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md new file mode 100644 index 000000000000..a5437240dc32 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md new file mode 100644 index 000000000000..282649449d96 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md new file mode 100644 index 000000000000..55bd8afdbc09 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| 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 + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md new file mode 100644 index 000000000000..dbf78e81eb22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| 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 + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle new file mode 100644 index 000000000000..6ca85294a549 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-okhttp4-coroutines-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 000000000000..9536cf583e27 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,77 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Client + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class AnotherFakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model + * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun call123testSpecialTags(client: Client) : Client { + val localVariableBody: kotlin.Any? = client + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PATCH, + "/another-fake/dummy", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 000000000000..7743a32f9905 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,76 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.InlineResponseDefault + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * + * + * @return InlineResponseDefault + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fooGet() : InlineResponseDefault { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/foo", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as InlineResponseDefault + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 000000000000..48bee61370d3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,718 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * Health check endpoint + * + * @return HealthCheckResult + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fakeHealthGet() : HealthCheckResult { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/health", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as HealthCheckResult + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fakeHttpSignatureTest(pet: Pet, query1: kotlin.String?, header1: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = pet + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + if (query1 != null) { + put("query_1", listOf(query1.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf("header_1" to header1.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/http-signature-test", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return kotlin.Boolean + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fakeOuterBooleanSerialize(body: kotlin.Boolean?) : kotlin.Boolean { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/boolean", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Boolean + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return OuterComposite + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : OuterComposite { + val localVariableBody: kotlin.Any? = outerComposite + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/composite", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as OuterComposite + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return java.math.BigDecimal + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fakeOuterNumberSerialize(body: java.math.BigDecimal?) : java.math.BigDecimal { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/number", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as java.math.BigDecimal + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun fakeOuterStringSerialize(body: kotlin.String?) : kotlin.String { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/outer/string", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit { + val localVariableBody: kotlin.Any? = fileSchemaTestClass + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/body-with-file-schema", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * + * @param query + * @param user + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testBodyWithQueryParams(query: kotlin.String, user: User) : Unit { + val localVariableBody: kotlin.Any? = user + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("query", listOf(query.toString())) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/body-with-query-params", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model + * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testClientModel(client: Client) : Client { + val localVariableBody: kotlin.Any? = client + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PATCH, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.OffsetDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("integer" to integer, "int32" to int32, "int64" to int64, "number" to number, "float" to float, "double" to double, "string" to string, "pattern_without_delimiter" to patternWithoutDelimiter, "byte" to byte, "binary" to binary, "date" to date, "dateTime" to dateTime, "password" to password, "callback" to paramCallback) + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") + * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to enumFormStringArray, "enum_form_string" to enumFormString) + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + if (enumQueryStringArray != null) { + put("enum_query_string_array", toMultiValue(enumQueryStringArray.toList(), "multi")) + } + if (enumQueryString != null) { + put("enum_query_string", listOf(enumQueryString.toString())) + } + if (enumQueryInteger != null) { + put("enum_query_integer", listOf(enumQueryInteger.toString())) + } + if (enumQueryDouble != null) { + put("enum_query_double", listOf(enumQueryDouble.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("required_string_group", listOf(requiredStringGroup.toString())) + put("required_int64_group", listOf(requiredInt64Group.toString())) + if (stringGroup != null) { + put("string_group", listOf(stringGroup.toString())) + } + if (int64Group != null) { + put("int64_group", listOf(int64Group.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/fake", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * test inline additionalProperties + * + * @param requestBody request body + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : Unit { + val localVariableBody: kotlin.Any? = requestBody + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/inline-additionalProperties", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * test json serialization of form data + * + * @param param field1 + * @param param2 field2 + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = mapOf("param" to param, "param2" to param2) + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/jsonFormData", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * To test the collection format in query parameters + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testQueryParameterCollectionFormat(pipe: kotlin.Array, ioutil: kotlin.Array, http: kotlin.Array, url: kotlin.Array, context: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("pipe", toMultiValue(pipe.toList(), "multi")) + put("ioutil", toMultiValue(ioutil.toList(), "csv")) + put("http", toMultiValue(http.toList(), "space")) + put("url", toMultiValue(url.toList(), "csv")) + put("context", toMultiValue(context.toList(), "multi")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/fake/test-query-paramters", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 000000000000..9739a0859ea2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,77 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Client + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class FakeClassnameTags123Api(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model + * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun testClassname(client: Client) : Client { + val localVariableBody: kotlin.Any? = client + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PATCH, + "/fake_classname_test", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..1093b32def31 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,416 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun addPet(pet: Pet) : Unit { + val localVariableBody: kotlin.Any? = pet + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * 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 + * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("status", toMultiValue(status.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * 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 + * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + suspend fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("tags", toMultiValue(tags.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getPetById(petId: kotlin.Long) : Pet { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updatePet(pet: Pet) : Unit { + val localVariableBody: kotlin.Any? = pet + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "requiredFile" to requiredFile) + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..8a889b251be2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,198 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deleteOrder(orderId: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getInventory() : kotlin.collections.Map { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getOrderById(orderId: kotlin.Long) : Order { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun placeOrder(order: Order) : Order { + val localVariableBody: kotlin.Any? = order + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..2395f651143a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,363 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUser(user: User) : Unit { + val localVariableBody: kotlin.Any? = user + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUsersWithArrayInput(user: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = user + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUsersWithListInput(user: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = user + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getUserByName(username: kotlin.String) : User { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("username", listOf(username.toString())) + put("password", listOf(password.toString())) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun logoutUser() : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updateUser(username: kotlin.String, user: User) : Unit { + val localVariableBody: kotlin.Any? = user + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..ef7a8f1e1a62 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..8943d2ed5d42 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,272 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Credentials +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.asRequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.FormBody +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.ResponseBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.Request +import okhttp3.Headers +import okhttp3.MultipartBody +import java.io.File +import java.net.URLConnection +import java.util.Date +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.LocalTime +import java.time.OffsetDateTime +import java.time.OffsetTime + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val Authorization = "Authorization" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + val apiKey: MutableMap = mutableMapOf() + val apiKeyPrefix: MutableMap = mutableMapOf() + var username: String? = null + var password: String? = null + var accessToken: String? = null + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + protected fun guessContentTypeFromFile(file: File): String { + val contentType = URLConnection.guessContentTypeFromName(file.name) + return contentType ?: "application/octet-stream" + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> content.asRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == FormDataMediaType -> { + MultipartBody.Builder() + .setType(MultipartBody.FORM) + .apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + if (value is File) { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"; filename=\"${value.name}\"" + ) + val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() + addPart(partHeaders, value.asRequestBody(fileMediaType)) + } else { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"" + ) + addPart( + partHeaders, + parameterToString(value).toRequestBody(null) + ) + } + } + }.build() + } + mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, parameterToString(value)) + } + }.build() + } + mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun updateAuthParams(requestConfig: RequestConfig) { + if (requestConfig.headers["api_key"].isNullOrEmpty()) { + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! + } else { + requestConfig.headers["api_key"] = apiKey["api_key"]!! + } + } + } + if (requestConfig.query["api_key_query"].isNullOrEmpty()) { + if (apiKey["api_key_query"] != null) { + if (apiKeyPrefix["api_key_query"] != null) { + requestConfig.query["api_key_query"] = apiKeyPrefix["api_key_query"]!! + " " + apiKey["api_key_query"]!! + } else { + requestConfig.query["api_key_query"] = apiKey["api_key_query"]!! + } + } + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + accessToken?.let { accessToken -> + requestConfig.headers[Authorization] = "Bearer $accessToken" + } + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + username?.let { username -> + password?.let { password -> + requestConfig.headers[Authorization] = Credentials.basic(username, password) + } + } + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + accessToken?.let { accessToken -> + requestConfig.headers[Authorization] = "Bearer $accessToken " + } + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + + // take authMethod from operation + updateAuthParams(requestConfig) + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code, + response.headers.toMultimap() + ) + response.isInformational -> return Informational( + response.message, + response.code, + response.headers.toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() + ) + response.isClientError -> return ClientError( + response.message, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + else -> return ServerError( + response.message, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + } + } + + protected fun parameterToString(value: Any?): String { + when (value) { + null -> { + return "" + } + is Array<*> -> { + return toMultiValue(value, "csv").toString() + } + is Iterable<*> -> { + return toMultiValue(value, "csv").toString() + } + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { + return parseDateToQueryString(value) + } + else -> { + return value.toString() + } + } + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.gson.toJson(value, T::class.java).replace("\"", "") + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 000000000000..9dc8d8dbbfaa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 000000000000..dd34bd48b2c0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..6120b081929d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 000000000000..c5d330ac0757 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: Date?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): Date? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return formatter.parse(out.nextString()) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 000000000000..b5310e71f13c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..30ef6697183a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..3ad781c66ca1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..e615135c9cc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..9c22257e223a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf() +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 000000000000..69b562becb07 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..6465f1485531 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 000000000000..6d216739f0b2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 000000000000..86992f00d6a6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..15ea8f6ce57a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @SerializedName("code") + val code: kotlin.Int? = null, + @SerializedName("type") + val type: kotlin.String? = null, + @SerializedName("message") + val message: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 000000000000..02723cb9dcd9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 000000000000..afde31b7ff41 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 000000000000..d9946e24ba46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 000000000000..a7c7d3c9a761 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 000000000000..3c0b6063ce16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..7b42c1e2f515 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..eddd17dc0231 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 000000000000..d4ca6d612415 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 000000000000..2823f40b88b5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 000000000000..fbc06cf1dd61 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..c422756a65fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 000000000000..8ffe63f244b1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -0,0 +1,52 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 000000000000..2eccf5d72fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 000000000000..a939ed3f41ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 000000000000..8ccd536e097a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 000000000000..eac43b985250 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 000000000000..f8f4fd031287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -0,0 +1,75 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 000000000000..e70f33609981 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 000000000000..5ea4977b7cb5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 000000000000..e513221c62ba --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 000000000000..183929c471fe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 000000000000..29c4d228fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 000000000000..a5734ebed46d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -0,0 +1,84 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 000000000000..488f57faff3d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 000000000000..1bd7d0c64b88 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 000000000000..0252304ee847 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 000000000000..b7c9f9b029bb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 000000000000..768f0a766039 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -0,0 +1,49 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 000000000000..ec5c3ba8eadb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 000000000000..b9506ce766f2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 000000000000..a26df5946ca7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..44ef32f26378 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 000000000000..ca273d1f3a17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..e691b5ca8fbd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,57 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("petId") + val petId: kotlin.Long? = null, + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + @SerializedName("complete") + val complete: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Order Status + * Values: placed,approved,delivered + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 000000000000..8246390507ec --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 000000000000..1c2c521eaf57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 000000000000..12c2b0a94aa3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 000000000000..c2ac6a4a936d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 000000000000..3066cfbae73d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..6e0b0b873d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("photoUrls") + val photoUrls: kotlin.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * pet status in the store + * Values: available,pending,sold + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 000000000000..5dff54dc190a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 000000000000..ecdce7f408fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 000000000000..f67aa3c948b6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..04ca19143287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param name + */ + +data class Tag ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..24b8c5d47ac2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,53 @@ +/** +* OpenAPI Petstore +* 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 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("username") + val username: kotlin.String? = null, + @SerializedName("firstName") + val firstName: kotlin.String? = null, + @SerializedName("lastName") + val lastName: kotlin.String? = null, + @SerializedName("email") + val email: kotlin.String? = null, + @SerializedName("password") + val password: kotlin.String? = null, + @SerializedName("phone") + val phone: kotlin.String? = null, + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + From dfcce95480525549e028079b698eaf4e19a4ee38 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Sat, 23 May 2020 22:18:35 +0100 Subject: [PATCH 2/2] [kotlin] fix petstore project --- bin/kotlin-client-all.sh | 1 + ...otlin-client-petstore-okhttp-coroutines.sh | 4 +- bin/openapi3/kotlin-client-petstore-all.sh | 1 - .../.openapi-generator-ignore | 0 .../.openapi-generator/VERSION | 0 .../kotlin-jvm-okhttp4-coroutines/README.md | 90 ++ .../build.gradle | 0 .../docs/ApiResponse.md | 0 .../docs/Category.md | 2 +- .../docs/Order.md | 0 .../kotlin-jvm-okhttp4-coroutines/docs/Pet.md | 0 .../docs/PetApi.md | 70 +- .../docs/StoreApi.md | 16 +- .../kotlin-jvm-okhttp4-coroutines/docs/Tag.md | 0 .../docs/User.md | 0 .../docs/UserApi.md | 42 +- .../settings.gradle | 0 .../org/openapitools/client/apis/PetApi.kt | 59 +- .../org/openapitools/client/apis/StoreApi.kt | 14 +- .../org/openapitools/client/apis/UserApi.kt | 28 +- .../client/infrastructure/ApiAbstractions.kt | 0 .../client/infrastructure/ApiClient.kt | 21 - .../ApiInfrastructureResponse.kt | 0 .../infrastructure/ApplicationDelegates.kt | 0 .../client/infrastructure/ByteArrayAdapter.kt | 0 .../client/infrastructure/DateAdapter.kt | 0 .../client/infrastructure/Errors.kt | 0 .../client/infrastructure/LocalDateAdapter.kt | 0 .../infrastructure/LocalDateTimeAdapter.kt | 0 .../infrastructure/OffsetDateTimeAdapter.kt | 0 .../client/infrastructure/RequestConfig.kt | 0 .../client/infrastructure/RequestMethod.kt | 0 .../infrastructure/ResponseExtensions.kt | 0 .../client/infrastructure/Serializer.kt | 0 .../openapitools/client/models/ApiResponse.kt | 4 +- .../openapitools/client/models/Category.kt | 12 +- .../org/openapitools/client/models/Order.kt | 4 +- .../org/openapitools/client/models/Pet.kt | 4 +- .../org/openapitools/client/models/Tag.kt | 4 +- .../org/openapitools/client/models/User.kt | 4 +- .../kotlin-jvm-okhttp4-coroutines/README.md | 173 ---- .../docs/200Response.md | 11 - .../docs/AdditionalPropertiesClass.md | 11 - .../docs/Animal.md | 11 - .../docs/AnotherFakeApi.md | 56 -- .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../docs/ArrayOfNumberOnly.md | 10 - .../docs/ArrayTest.md | 12 - .../docs/Capitalization.md | 15 - .../kotlin-jvm-okhttp4-coroutines/docs/Cat.md | 10 - .../docs/CatAllOf.md | 10 - .../docs/ClassModel.md | 10 - .../docs/Client.md | 10 - .../docs/DefaultApi.md | 50 -- .../kotlin-jvm-okhttp4-coroutines/docs/Dog.md | 10 - .../docs/DogAllOf.md | 10 - .../docs/EnumArrays.md | 25 - .../docs/EnumClass.md | 14 - .../docs/EnumTest.md | 45 - .../docs/FakeApi.md | 776 ------------------ .../docs/FakeClassnameTags123Api.md | 59 -- .../docs/FileSchemaTestClass.md | 11 - .../kotlin-jvm-okhttp4-coroutines/docs/Foo.md | 10 - .../docs/FormatTest.md | 24 - .../docs/HasOnlyReadOnly.md | 11 - .../docs/HealthCheckResult.md | 10 - .../docs/InlineObject.md | 11 - .../docs/InlineObject1.md | 11 - .../docs/InlineObject2.md | 25 - .../docs/InlineObject3.md | 23 - .../docs/InlineObject4.md | 11 - .../docs/InlineObject5.md | 11 - .../docs/InlineResponseDefault.md | 10 - .../docs/List.md | 10 - .../docs/MapTest.md | 20 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../docs/Name.md | 13 - .../docs/NullableClass.md | 21 - .../docs/NumberOnly.md | 10 - .../docs/OuterComposite.md | 12 - .../docs/OuterEnum.md | 14 - .../docs/OuterEnumDefaultValue.md | 14 - .../docs/OuterEnumInteger.md | 14 - .../docs/OuterEnumIntegerDefaultValue.md | 14 - .../docs/ReadOnlyFirst.md | 11 - .../docs/Return.md | 10 - .../docs/SpecialModelName.md | 10 - .../client/apis/AnotherFakeApi.kt | 77 -- .../openapitools/client/apis/DefaultApi.kt | 76 -- .../org/openapitools/client/apis/FakeApi.kt | 718 ---------------- .../client/apis/FakeClassnameTags123Api.kt | 77 -- .../models/AdditionalPropertiesClass.kt | 34 - .../org/openapitools/client/models/Animal.kt | 33 - .../client/models/ArrayOfArrayOfNumberOnly.kt | 31 - .../client/models/ArrayOfNumberOnly.kt | 31 - .../openapitools/client/models/ArrayTest.kt | 38 - .../client/models/Capitalization.kt | 47 -- .../org/openapitools/client/models/Cat.kt | 39 - .../openapitools/client/models/CatAllOf.kt | 31 - .../openapitools/client/models/ClassModel.kt | 31 - .../org/openapitools/client/models/Client.kt | 31 - .../org/openapitools/client/models/Dog.kt | 39 - .../openapitools/client/models/DogAllOf.kt | 31 - .../openapitools/client/models/EnumArrays.kt | 52 -- .../openapitools/client/models/EnumClass.kt | 47 -- .../openapitools/client/models/EnumTest.kt | 94 --- .../client/models/FileSchemaTestClass.kt | 34 - .../org/openapitools/client/models/Foo.kt | 31 - .../openapitools/client/models/FormatTest.kt | 75 -- .../client/models/HasOnlyReadOnly.kt | 34 - .../client/models/HealthCheckResult.kt | 31 - .../client/models/InlineObject.kt | 36 - .../client/models/InlineObject1.kt | 36 - .../client/models/InlineObject2.kt | 55 -- .../client/models/InlineObject3.kt | 84 -- .../client/models/InlineObject4.kt | 36 - .../client/models/InlineObject5.kt | 36 - .../client/models/InlineResponseDefault.kt | 32 - .../org/openapitools/client/models/List.kt | 31 - .../org/openapitools/client/models/MapTest.kt | 49 -- ...dPropertiesAndAdditionalPropertiesClass.kt | 38 - .../client/models/Model200Response.kt | 34 - .../org/openapitools/client/models/Name.kt | 40 - .../client/models/NullableClass.kt | 64 -- .../openapitools/client/models/NumberOnly.kt | 31 - .../client/models/OuterComposite.kt | 37 - .../openapitools/client/models/OuterEnum.kt | 47 -- .../client/models/OuterEnumDefaultValue.kt | 47 -- .../client/models/OuterEnumInteger.kt | 47 -- .../models/OuterEnumIntegerDefaultValue.kt | 47 -- .../client/models/ReadOnlyFirst.kt | 34 - .../org/openapitools/client/models/Return.kt | 31 - .../client/models/SpecialModelname.kt | 31 - 133 files changed, 177 insertions(+), 4579 deletions(-) rename bin/{openapi3 => }/kotlin-client-petstore-okhttp-coroutines.sh (61%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION (100%) create mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md (78%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md (82%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md (91%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md (89%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt (86%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt (94%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt (95%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt (91%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt (100%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt (79%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt (71%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt (88%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt (89%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt (79%) rename samples/{openapi3 => }/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt (87%) delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt delete mode 100644 samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt diff --git a/bin/kotlin-client-all.sh b/bin/kotlin-client-all.sh index 137c6eb5e898..91348c423e17 100755 --- a/bin/kotlin-client-all.sh +++ b/bin/kotlin-client-all.sh @@ -12,3 +12,4 @@ ./bin/kotlin-client-nullable.sh ./bin/kotlin-client-retrofit2.sh ./bin/kotlin-client-json-request-string.sh +./bin/kotlin-client-petstore-okhttp-coroutines.sh diff --git a/bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh b/bin/kotlin-client-petstore-okhttp-coroutines.sh similarity index 61% rename from bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh rename to bin/kotlin-client-petstore-okhttp-coroutines.sh index 05f3a05ea7e9..6d7325821efa 100755 --- a/bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh +++ b/bin/kotlin-client-petstore-okhttp-coroutines.sh @@ -25,10 +25,10 @@ then mvn clean package fi -samplePath="samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines" +samplePath="samples/client/petstore/kotlin-jvm-okhttp4-coroutines" export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-okhttp4-coroutines-client --library jvm-okhttp4 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-okhttp4-coroutines-client --library jvm-okhttp4 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@" echo "Cleaning previously generated files if any from $samplePath" rm -rf $samplePath diff --git a/bin/openapi3/kotlin-client-petstore-all.sh b/bin/openapi3/kotlin-client-petstore-all.sh index 4a97ccd2ff08..951e2befa170 100755 --- a/bin/openapi3/kotlin-client-petstore-all.sh +++ b/bin/openapi3/kotlin-client-petstore-all.sh @@ -7,4 +7,3 @@ ./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh ./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh ./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh -./bin/openapi3/kotlin-client-petstore-okhttp-coroutines.sh diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md new file mode 100644 index 000000000000..aef4ea15beed --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md @@ -0,0 +1,90 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md similarity index 78% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md index 1f12c3eb1582..2c28a670fc79 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | **id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md similarity index 82% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index 576d2f04ca85..ea93e1745279 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -1,6 +1,6 @@ # PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -12,12 +12,11 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **addPet** -> addPet(pet) +> addPet(body) Add a new pet to the store @@ -28,9 +27,9 @@ Add a new pet to the store //import org.openapitools.client.models.* val apiInstance = PetApi() -val pet : Pet = // Pet | Pet object that needs to be added to the store +val body : Pet = // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet) + apiInstance.addPet(body) } catch (e: ClientException) { println("4xx response calling PetApi#addPet") e.printStackTrace() @@ -44,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -259,7 +258,7 @@ Configure api_key: # **updatePet** -> updatePet(pet) +> updatePet(body) Update an existing pet @@ -270,9 +269,9 @@ Update an existing pet //import org.openapitools.client.models.* val apiInstance = PetApi() -val pet : Pet = // Pet | Pet object that needs to be added to the store +val body : Pet = // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet) + apiInstance.updatePet(body) } catch (e: ClientException) { println("4xx response calling PetApi#updatePet") e.printStackTrace() @@ -286,7 +285,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -396,57 +395,6 @@ Name | Type | Description | Notes ### Authorization -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - -# **uploadFileWithRequiredFile** -> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - -uploads an image (required) - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update -val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server -try { - val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - println(result) -} catch (e: ClientException) { - println("4xx response calling PetApi#uploadFileWithRequiredFile") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#uploadFileWithRequiredFile") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **requiredFile** | **java.io.File**| file to upload | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - - Configure petstore_auth: ApiClient.accessToken = "" diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md similarity index 91% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md index 55bd8afdbc09..f4986041af8c 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md @@ -1,12 +1,12 @@ # StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet @@ -151,7 +151,7 @@ No authorization required # **placeOrder** -> Order placeOrder(order) +> Order placeOrder(body) Place an order for a pet @@ -162,9 +162,9 @@ Place an order for a pet //import org.openapitools.client.models.* val apiInstance = StoreApi() -val order : Order = // Order | order placed for purchasing the pet +val body : Order = // Order | order placed for purchasing the pet try { - val result : Order = apiInstance.placeOrder(order) + val result : Order = apiInstance.placeOrder(body) println(result) } catch (e: ClientException) { println("4xx response calling StoreApi#placeOrder") @@ -179,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -191,6 +191,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/xml, application/json diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md similarity index 89% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md index dbf78e81eb22..0f55f06bc629 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(user) +> createUser(body) Create user @@ -29,9 +29,9 @@ This can only be done by the logged in user. //import org.openapitools.client.models.* val apiInstance = UserApi() -val user : User = // User | Created user object +val body : User = // User | Created user object try { - apiInstance.createUser(user) + apiInstance.createUser(body) } catch (e: ClientException) { println("4xx response calling UserApi#createUser") e.printStackTrace() @@ -45,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -57,12 +57,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(user) +> createUsersWithArrayInput(body) Creates list of users with given input array @@ -73,9 +73,9 @@ Creates list of users with given input array //import org.openapitools.client.models.* val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object +val body : kotlin.Array = // kotlin.Array | List of user object try { - apiInstance.createUsersWithArrayInput(user) + apiInstance.createUsersWithArrayInput(body) } catch (e: ClientException) { println("4xx response calling UserApi#createUsersWithArrayInput") e.printStackTrace() @@ -89,7 +89,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **body** | [**kotlin.Array<User>**](User.md)| List of user object | ### Return type @@ -101,12 +101,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(user) +> createUsersWithListInput(body) Creates list of users with given input array @@ -117,9 +117,9 @@ Creates list of users with given input array //import org.openapitools.client.models.* val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object +val body : kotlin.Array = // kotlin.Array | List of user object try { - apiInstance.createUsersWithListInput(user) + apiInstance.createUsersWithListInput(body) } catch (e: ClientException) { println("4xx response calling UserApi#createUsersWithListInput") e.printStackTrace() @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **body** | [**kotlin.Array<User>**](User.md)| List of user object | ### Return type @@ -145,7 +145,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined @@ -328,7 +328,7 @@ No authorization required # **updateUser** -> updateUser(username, user) +> updateUser(username, body) Updated user @@ -342,9 +342,9 @@ This can only be done by the logged in user. val apiInstance = UserApi() val username : kotlin.String = username_example // kotlin.String | name that need to be deleted -val user : User = // User | Updated user object +val body : User = // User | Updated user object try { - apiInstance.updateUser(username, user) + apiInstance.updateUser(username, body) } catch (e: ClientException) { println("4xx response calling UserApi#updateUser") e.printStackTrace() @@ -359,7 +359,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -371,6 +371,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt similarity index 86% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1093b32def31..565a31075c95 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -30,22 +30,22 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") } } /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun addPet(pet: Pet) : Unit { - val localVariableBody: kotlin.Any? = pet + suspend fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( @@ -248,15 +248,15 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updatePet(pet: Pet) : Unit { - val localVariableBody: kotlin.Any? = pet + suspend fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( @@ -370,47 +370,4 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } - /** - * uploads an image (required) - * - * @param petId ID of pet to update - * @param requiredFile file to upload - * @param additionalMetadata Additional data to pass to server (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "requiredFile" to requiredFile) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - } diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt similarity index 94% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 8a889b251be2..deb7ba6cf49f 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -29,7 +29,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") } } @@ -49,7 +49,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.DELETE, - "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), query = localVariableQuery, headers = localVariableHeaders ) @@ -130,7 +130,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, - "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), query = localVariableQuery, headers = localVariableHeaders ) @@ -157,7 +157,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet * @return Order * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response @@ -165,8 +165,8 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) */ @Suppress("UNCHECKED_CAST") @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun placeOrder(order: Order) : Order { - val localVariableBody: kotlin.Any? = order + suspend fun placeOrder(body: Order) : Order { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt similarity index 95% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 2395f651143a..0bd96e7456c3 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -29,22 +29,22 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") } } /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUser(user: User) : Unit { - val localVariableBody: kotlin.Any? = user + suspend fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( @@ -76,15 +76,15 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUsersWithArrayInput(user: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = user + suspend fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( @@ -116,15 +116,15 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUsersWithListInput(user: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = user + suspend fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( @@ -323,15 +323,15 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param user Updated user object + * @param body Updated user object * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updateUser(username: kotlin.String, user: User) : Unit { - val localVariableBody: kotlin.Any? = user + suspend fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt similarity index 91% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8943d2ed5d42..5d64a9add421 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -130,27 +130,6 @@ open class ApiClient(val baseUrl: String) { } } } - if (requestConfig.query["api_key_query"].isNullOrEmpty()) { - if (apiKey["api_key_query"] != null) { - if (apiKeyPrefix["api_key_query"] != null) { - requestConfig.query["api_key_query"] = apiKeyPrefix["api_key_query"]!! + " " + apiKey["api_key_query"]!! - } else { - requestConfig.query["api_key_query"] = apiKey["api_key_query"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken" - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - username?.let { username -> - password?.let { password -> - requestConfig.headers[Authorization] = Credentials.basic(username, password) - } - } - } if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> requestConfig.headers[Authorization] = "Bearer $accessToken " diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt similarity index 100% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt similarity index 79% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 15ea8f6ce57a..b4c9c9b76743 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -15,7 +15,7 @@ package org.openapitools.client.models import com.google.gson.annotations.SerializedName import java.io.Serializable /** - * + * Describes the result of uploading an image resource * @param code * @param type * @param message diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt similarity index 71% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt index eddd17dc0231..6dfe689dd04c 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -15,16 +15,16 @@ package org.openapitools.client.models import com.google.gson.annotations.SerializedName import java.io.Serializable /** - * - * @param name + * A category for a pet * @param id + * @param name */ data class Category ( - @SerializedName("name") - val name: kotlin.String, @SerializedName("id") - val id: kotlin.Long? = null + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt similarity index 88% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt index e691b5ca8fbd..0a049435cdb0 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -15,7 +15,7 @@ package org.openapitools.client.models import com.google.gson.annotations.SerializedName import java.io.Serializable /** - * + * An order for a pets from the pet store * @param id * @param petId * @param quantity diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt similarity index 89% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt index 6e0b0b873d16..0290ccbb124f 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -17,7 +17,7 @@ import org.openapitools.client.models.Tag import com.google.gson.annotations.SerializedName import java.io.Serializable /** - * + * A pet for sale in the pet store * @param name * @param photoUrls * @param id diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt similarity index 79% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt index 04ca19143287..68c1ca9365fa 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -15,7 +15,7 @@ package org.openapitools.client.models import com.google.gson.annotations.SerializedName import java.io.Serializable /** - * + * A tag for a pet * @param id * @param name */ diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt similarity index 87% rename from samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt index 24b8c5d47ac2..32eaba94d250 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -1,6 +1,6 @@ /** * OpenAPI Petstore -* 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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -15,7 +15,7 @@ package org.openapitools.client.models import com.google.gson.annotations.SerializedName import java.io.Serializable /** - * + * A User who is purchasing from the pet store * @param id * @param username * @param firstName diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md deleted file mode 100644 index b7028d917a24..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md +++ /dev/null @@ -1,173 +0,0 @@ -# org.openapitools.client - Kotlin client library for OpenAPI Petstore - -## Requires - -* Kotlin 1.3.41 -* Gradle 4.9 - -## Build - -First, create the gradle wrapper script: - -``` -gradle wrapper -``` - -Then, run: - -``` -./gradlew check assemble -``` - -This runs all tests and packages the library. - -## Features/Implementation Notes - -* Supports JSON inputs/outputs, File inputs, and Form inputs. -* Supports collection formats for query parameters: csv, tsv, ssv, pipes. -* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. -* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. - - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | -*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | -*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - -## Documentation for Models - - - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [org.openapitools.client.models.Animal](docs/Animal.md) - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) - - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) - - [org.openapitools.client.models.Cat](docs/Cat.md) - - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) - - [org.openapitools.client.models.Category](docs/Category.md) - - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) - - [org.openapitools.client.models.Client](docs/Client.md) - - [org.openapitools.client.models.Dog](docs/Dog.md) - - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) - - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) - - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) - - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) - - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [org.openapitools.client.models.Foo](docs/Foo.md) - - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) - - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) - - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) - - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) - - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) - - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) - - [org.openapitools.client.models.List](docs/List.md) - - [org.openapitools.client.models.MapTest](docs/MapTest.md) - - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) - - [org.openapitools.client.models.Name](docs/Name.md) - - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) - - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) - - [org.openapitools.client.models.Order](docs/Order.md) - - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) - - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) - - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) - - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [org.openapitools.client.models.Pet](docs/Pet.md) - - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [org.openapitools.client.models.Return](docs/Return.md) - - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md) - - [org.openapitools.client.models.Tag](docs/Tag.md) - - [org.openapitools.client.models.User](docs/User.md) - - - -## Documentation for Authorization - - -### 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 - - -### bearer_test - -- **Type**: HTTP basic authentication - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -### http_signature_test - -- **Type**: HTTP basic authentication - - -### 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 - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md deleted file mode 100644 index 53c1edacfb84..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/200Response.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.Int** | | [optional] -**propertyClass** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 1025301ce946..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ - -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] -**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md deleted file mode 100644 index 5ce5a4972c8c..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **kotlin.String** | | -**color** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md deleted file mode 100644 index 55d482238db4..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/AnotherFakeApi.md +++ /dev/null @@ -1,56 +0,0 @@ -# AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - - - -# **call123testSpecialTags** -> Client call123testSpecialTags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = AnotherFakeApi() -val client : Client = // Client | client model -try { - val result : Client = apiInstance.call123testSpecialTags(client) - println(result) -} catch (e: ClientException) { - println("4xx response calling AnotherFakeApi#call123testSpecialTags") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling AnotherFakeApi#call123testSpecialTags") - e.printStackTrace() -} -``` - -### 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 - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 23a475664205..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md deleted file mode 100644 index b115a5d54c22..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md deleted file mode 100644 index aa0bbbe936c1..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] -**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] -**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md deleted file mode 100644 index 9d44a82fb7ff..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **kotlin.String** | | [optional] -**capitalCamel** | **kotlin.String** | | [optional] -**smallSnake** | **kotlin.String** | | [optional] -**capitalSnake** | **kotlin.String** | | [optional] -**scAETHFlowPoints** | **kotlin.String** | | [optional] -**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md deleted file mode 100644 index b6da7c47cedd..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **kotlin.Boolean** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md deleted file mode 100644 index fb8883197a18..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ - -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **kotlin.Boolean** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md deleted file mode 100644 index 50ad61b51a56..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyClass** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md deleted file mode 100644 index 11afbcf0c9f5..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md deleted file mode 100644 index 784be537594d..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DefaultApi.md +++ /dev/null @@ -1,50 +0,0 @@ -# DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | - - - -# **fooGet** -> InlineResponseDefault fooGet() - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = DefaultApi() -try { - val result : InlineResponseDefault = apiInstance.fooGet() - println(result) -} catch (e: ClientException) { - println("4xx response calling DefaultApi#fooGet") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling DefaultApi#fooGet") - e.printStackTrace() -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**InlineResponseDefault**](InlineResponseDefault.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md deleted file mode 100644 index 41d9c6ba0d17..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md deleted file mode 100644 index 6b14d5e9147d..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ - -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md deleted file mode 100644 index 719084e5f949..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumArrays.md +++ /dev/null @@ -1,25 +0,0 @@ - -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] -**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] - - - -## Enum: just_symbol -Name | Value ----- | ----- -justSymbol | >=, $ - - - -## Enum: array_enum -Name | Value ----- | ----- -arrayEnum | fish, crab - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md deleted file mode 100644 index 5ddb262871f9..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ - -# EnumClass - -## Enum - - - * `abc` (value: `"_abc"`) - - * `minusEfg` (value: `"-efg"`) - - * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md deleted file mode 100644 index f0370049eb3e..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/EnumTest.md +++ /dev/null @@ -1,45 +0,0 @@ - -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | -**enumString** | [**inline**](#EnumStringEnum) | | [optional] -**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] -**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - - - -## Enum: enum_string_required -Name | Value ----- | ----- -enumStringRequired | UPPER, lower, - - - -## Enum: enum_string -Name | Value ----- | ----- -enumString | UPPER, lower, - - - -## Enum: enum_integer -Name | Value ----- | ----- -enumInteger | 1, -1 - - - -## Enum: enum_number -Name | Value ----- | ----- -enumNumber | 1.1, -1.2 - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md deleted file mode 100644 index 0a28947aa843..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeApi.md +++ /dev/null @@ -1,776 +0,0 @@ -# FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication -[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | - - - -# **fakeHealthGet** -> HealthCheckResult fakeHealthGet() - -Health check endpoint - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -try { - val result : HealthCheckResult = apiInstance.fakeHealthGet() - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeApi#fakeHealthGet") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#fakeHealthGet") - e.printStackTrace() -} -``` - -### 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 - - -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val pet : Pet = // Pet | Pet object that needs to be added to the store -val query1 : kotlin.String = query1_example // kotlin.String | query parameter -val header1 : kotlin.String = header1_example // kotlin.String | header parameter -try { - apiInstance.fakeHttpSignatureTest(pet, query1, header1) -} catch (e: ClientException) { - println("4xx response calling FakeApi#fakeHttpSignatureTest") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#fakeHttpSignatureTest") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **kotlin.String**| query parameter | [optional] - **header1** | **kotlin.String**| header parameter | [optional] - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **fakeOuterBooleanSerialize** -> kotlin.Boolean fakeOuterBooleanSerialize(body) - - - -Test serialization of outer boolean types - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body -try { - val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeApi#fakeOuterBooleanSerialize") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#fakeOuterBooleanSerialize") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **kotlin.Boolean**| Input boolean as post body | [optional] - -### Return type - -**kotlin.Boolean** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(outerComposite) - - - -Test serialization of object with outer number type - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val outerComposite : OuterComposite = // OuterComposite | Input composite as post body -try { - val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeApi#fakeOuterCompositeSerialize") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#fakeOuterCompositeSerialize") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**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**: */* - - -# **fakeOuterNumberSerialize** -> java.math.BigDecimal fakeOuterNumberSerialize(body) - - - -Test serialization of outer number types - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body -try { - val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeApi#fakeOuterNumberSerialize") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#fakeOuterNumberSerialize") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **java.math.BigDecimal**| Input number as post body | [optional] - -### Return type - -[**java.math.BigDecimal**](java.math.BigDecimal.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - - -# **fakeOuterStringSerialize** -> kotlin.String fakeOuterStringSerialize(body) - - - -Test serialization of outer string types - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val body : kotlin.String = body_example // kotlin.String | Input string as post body -try { - val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeApi#fakeOuterStringSerialize") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#fakeOuterStringSerialize") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **kotlin.String**| Input string as post body | [optional] - -### Return type - -**kotlin.String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - - -# **testBodyWithFileSchema** -> testBodyWithFileSchema(fileSchemaTestClass) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | -try { - apiInstance.testBodyWithFileSchema(fileSchemaTestClass) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testBodyWithFileSchema") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testBodyWithFileSchema") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(query, user) - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val query : kotlin.String = query_example // kotlin.String | -val user : User = // User | -try { - apiInstance.testBodyWithQueryParams(query, user) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testBodyWithQueryParams") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testBodyWithQueryParams") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **kotlin.String**| | - **user** | [**User**](User.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testClientModel** -> Client testClientModel(client) - -To test \"client\" model - -To test \"client\" model - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val client : Client = // Client | client model -try { - val result : Client = apiInstance.testClientModel(client) - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testClientModel") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testClientModel") - e.printStackTrace() -} -``` - -### 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 - - -# **testEndpointParameters** -> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None -val double : kotlin.Double = 1.2 // kotlin.Double | None -val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None -val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None -val integer : kotlin.Int = 56 // kotlin.Int | None -val int32 : kotlin.Int = 56 // kotlin.Int | None -val int64 : kotlin.Long = 789 // kotlin.Long | None -val float : kotlin.Float = 3.4 // kotlin.Float | None -val string : kotlin.String = string_example // kotlin.String | None -val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None -val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None -val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None -val password : kotlin.String = password_example // kotlin.String | None -val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None -try { - apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testEndpointParameters") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testEndpointParameters") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **java.math.BigDecimal**| None | - **double** | **kotlin.Double**| None | - **patternWithoutDelimiter** | **kotlin.String**| None | - **byte** | **kotlin.ByteArray**| None | - **integer** | **kotlin.Int**| None | [optional] - **int32** | **kotlin.Int**| None | [optional] - **int64** | **kotlin.Long**| None | [optional] - **float** | **kotlin.Float**| None | [optional] - **string** | **kotlin.String**| None | [optional] - **binary** | **java.io.File**| None | [optional] - **date** | **java.time.LocalDate**| None | [optional] - **dateTime** | **java.time.OffsetDateTime**| None | [optional] - **password** | **kotlin.String**| None | [optional] - **paramCallback** | **kotlin.String**| None | [optional] - -### Return type - -null (empty response body) - -### Authorization - - -Configure http_basic_test: - ApiClient.username = "" - ApiClient.password = "" - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **testEnumParameters** -> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) - -To test enum parameters - -To test enum parameters - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) -val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) -val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) -val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) -val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) -val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) -val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) -val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) -try { - apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testEnumParameters") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testEnumParameters") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] - **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters -val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters -val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters -val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters -val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters -val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters -try { - apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testGroupParameters") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testGroupParameters") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | - **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | - **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | - **stringGroup** | **kotlin.Int**| String in group parameters | [optional] - **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] - **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] - -### Return type - -null (empty response body) - -### Authorization - - -Configure bearer_test: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(requestBody) - -test inline additionalProperties - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body -try { - apiInstance.testInlineAdditionalProperties(requestBody) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testInlineAdditionalProperties") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testInlineAdditionalProperties") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val param : kotlin.String = param_example // kotlin.String | field1 -val param2 : kotlin.String = param2_example // kotlin.String | field2 -try { - apiInstance.testJsonFormData(param, param2) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testJsonFormData") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testJsonFormData") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **kotlin.String**| field1 | - **param2** | **kotlin.String**| field2 | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeApi() -val pipe : kotlin.Array = // kotlin.Array | -val ioutil : kotlin.Array = // kotlin.Array | -val http : kotlin.Array = // kotlin.Array | -val url : kotlin.Array = // kotlin.Array | -val context : kotlin.Array = // kotlin.Array | -try { - apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) -} catch (e: ClientException) { - println("4xx response calling FakeApi#testQueryParameterCollectionFormat") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeApi#testQueryParameterCollectionFormat") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 962dfd4d2dc2..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,59 +0,0 @@ -# FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(client) - -To test class name in snake case - -To test class name in snake case - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = FakeClassnameTags123Api() -val client : Client = // Client | client model -try { - val result : Client = apiInstance.testClassname(client) - println(result) -} catch (e: ClientException) { - println("4xx response calling FakeClassnameTags123Api#testClassname") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling FakeClassnameTags123Api#testClassname") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - - -Configure api_key_query: - ApiClient.apiKey["api_key_query"] = "" - ApiClient.apiKeyPrefix["api_key_query"] = "" - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md deleted file mode 100644 index 089e61862c2a..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ - -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**java.io.File**](java.io.File.md) | | [optional] -**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md deleted file mode 100644 index e3e9918872b3..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Foo.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Foo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md deleted file mode 100644 index 0357923c97a5..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ - -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | -**byte** | **kotlin.ByteArray** | | -**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | -**password** | **kotlin.String** | | -**integer** | **kotlin.Int** | | [optional] -**int32** | **kotlin.Int** | | [optional] -**int64** | **kotlin.Long** | | [optional] -**float** | **kotlin.Float** | | [optional] -**double** | **kotlin.Double** | | [optional] -**string** | **kotlin.String** | | [optional] -**binary** | [**java.io.File**](java.io.File.md) | | [optional] -**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] -**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md deleted file mode 100644 index ed3e4750f44f..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ - -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **kotlin.String** | | [optional] [readonly] -**foo** | **kotlin.String** | | [optional] [readonly] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md deleted file mode 100644 index 472dc3104571..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/HealthCheckResult.md +++ /dev/null @@ -1,10 +0,0 @@ - -# HealthCheckResult - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullableMessage** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md deleted file mode 100644 index 2156c70addfe..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ - -# InlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | Updated name of the pet | [optional] -**status** | **kotlin.String** | Updated status of the pet | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md deleted file mode 100644 index 2a77eecba2b7..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ - -# InlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] -**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md deleted file mode 100644 index 0720925918bf..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject2.md +++ /dev/null @@ -1,25 +0,0 @@ - -# InlineObject2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] -**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] - - - -## Enum: enum_form_string_array -Name | Value ----- | ----- -enumFormStringArray | >, $ - - - -## Enum: enum_form_string -Name | Value ----- | ----- -enumFormString | _abc, -efg, (xyz) - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md deleted file mode 100644 index 4ca6979b2806..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject3.md +++ /dev/null @@ -1,23 +0,0 @@ - -# InlineObject3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | -**double** | **kotlin.Double** | None | -**patternWithoutDelimiter** | **kotlin.String** | None | -**byte** | **kotlin.ByteArray** | None | -**integer** | **kotlin.Int** | None | [optional] -**int32** | **kotlin.Int** | None | [optional] -**int64** | **kotlin.Long** | None | [optional] -**float** | **kotlin.Float** | None | [optional] -**string** | **kotlin.String** | None | [optional] -**binary** | [**java.io.File**](java.io.File.md) | None | [optional] -**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] -**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] -**password** | **kotlin.String** | None | [optional] -**callback** | **kotlin.String** | None | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md deleted file mode 100644 index 03c4daa76318..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject4.md +++ /dev/null @@ -1,11 +0,0 @@ - -# InlineObject4 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **kotlin.String** | field1 | -**param2** | **kotlin.String** | field2 | - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md deleted file mode 100644 index c3c020b20f60..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineObject5.md +++ /dev/null @@ -1,11 +0,0 @@ - -# InlineObject5 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md deleted file mode 100644 index afdd81b1383e..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/InlineResponseDefault.md +++ /dev/null @@ -1,10 +0,0 @@ - -# InlineResponseDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md deleted file mode 100644 index 13a09a4c4141..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ - -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**`123minusList`** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md deleted file mode 100644 index 8cee39e36048..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MapTest.md +++ /dev/null @@ -1,20 +0,0 @@ - -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] -**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] -**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] -**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] - - - -## Enum: map_of_enum_string -Name | Value ----- | ----- -mapOfEnumString | UPPER, lower - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 744567412172..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ - -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] -**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md deleted file mode 100644 index 343700533c72..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.Int** | | -**snakeCase** | **kotlin.Int** | | [optional] [readonly] -**property** | **kotlin.String** | | [optional] -**`123number`** | **kotlin.Int** | | [optional] [readonly] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md deleted file mode 100644 index 9ec43d0b87c6..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NullableClass.md +++ /dev/null @@ -1,21 +0,0 @@ - -# NullableClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integerProp** | **kotlin.Int** | | [optional] -**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**booleanProp** | **kotlin.Boolean** | | [optional] -**stringProp** | **kotlin.String** | | [optional] -**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] -**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] -**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] -**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] -**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] -**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] -**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md deleted file mode 100644 index 41e8b82470bc..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md deleted file mode 100644 index 5296703674de..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ - -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**myString** | **kotlin.String** | | [optional] -**myBoolean** | **kotlin.Boolean** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md deleted file mode 100644 index 9e7ecb9499a4..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnum.md +++ /dev/null @@ -1,14 +0,0 @@ - -# OuterEnum - -## Enum - - - * `placed` (value: `"placed"`) - - * `approved` (value: `"approved"`) - - * `delivered` (value: `"delivered"`) - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md deleted file mode 100644 index 821d297a001b..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ - -# OuterEnumDefaultValue - -## Enum - - - * `placed` (value: `"placed"`) - - * `approved` (value: `"approved"`) - - * `delivered` (value: `"delivered"`) - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md deleted file mode 100644 index b40f6e4b7ef9..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumInteger.md +++ /dev/null @@ -1,14 +0,0 @@ - -# OuterEnumInteger - -## Enum - - - * `_0` (value: `0`) - - * `_1` (value: `1`) - - * `_2` (value: `2`) - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index c2fb3ee41d7a..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ - -# OuterEnumIntegerDefaultValue - -## Enum - - - * `_0` (value: `0`) - - * `_1` (value: `1`) - - * `_2` (value: `2`) - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md deleted file mode 100644 index 825f613f0907..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **kotlin.String** | | [optional] [readonly] -**baz** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md deleted file mode 100644 index a5437240dc32..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**`return`** | **kotlin.Int** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md deleted file mode 100644 index 282649449d96..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ - -# SpecialModelname - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt deleted file mode 100644 index 9536cf583e27..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ /dev/null @@ -1,77 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Client - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class AnotherFakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") - } - } - - /** - * To test special tags - * To test special tags and operation ID starting with number - * @param client client model - * @return Client - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun call123testSpecialTags(client: Client) : Client { - val localVariableBody: kotlin.Any? = client - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PATCH, - "/another-fake/dummy", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Client - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt deleted file mode 100644 index 7743a32f9905..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ /dev/null @@ -1,76 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.InlineResponseDefault - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") - } - } - - /** - * - * - * @return InlineResponseDefault - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fooGet() : InlineResponseDefault { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/foo", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as InlineResponseDefault - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt deleted file mode 100644 index 48bee61370d3..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ /dev/null @@ -1,718 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Client -import org.openapitools.client.models.FileSchemaTestClass -import org.openapitools.client.models.HealthCheckResult -import org.openapitools.client.models.OuterComposite -import org.openapitools.client.models.Pet -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") - } - } - - /** - * Health check endpoint - * - * @return HealthCheckResult - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fakeHealthGet() : HealthCheckResult { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/fake/health", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as HealthCheckResult - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * test http signature authentication - * - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter (optional) - * @param header1 header parameter (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fakeHttpSignatureTest(pet: Pet, query1: kotlin.String?, header1: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = pet - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - if (query1 != null) { - put("query_1", listOf(query1.toString())) - } - } - val localVariableHeaders: MutableMap = mutableMapOf("header_1" to header1.toString()) - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/fake/http-signature-test", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return kotlin.Boolean - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fakeOuterBooleanSerialize(body: kotlin.Boolean?) : kotlin.Boolean { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake/outer/boolean", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Boolean - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * Test serialization of object with outer number type - * @param outerComposite Input composite as post body (optional) - * @return OuterComposite - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : OuterComposite { - val localVariableBody: kotlin.Any? = outerComposite - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake/outer/composite", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as OuterComposite - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return java.math.BigDecimal - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fakeOuterNumberSerialize(body: java.math.BigDecimal?) : java.math.BigDecimal { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake/outer/number", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as java.math.BigDecimal - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun fakeOuterStringSerialize(body: kotlin.String?) : kotlin.String { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake/outer/string", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit { - val localVariableBody: kotlin.Any? = fileSchemaTestClass - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/fake/body-with-file-schema", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * - * @param query - * @param user - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testBodyWithQueryParams(query: kotlin.String, user: User) : Unit { - val localVariableBody: kotlin.Any? = user - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("query", listOf(query.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/fake/body-with-query-params", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To test \"client\" model - * To test \"client\" model - * @param client client model - * @return Client - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testClientModel(client: Client) : Client { - val localVariableBody: kotlin.Any? = client - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PATCH, - "/fake", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Client - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None - * @param double None - * @param patternWithoutDelimiter None - * @param byte None - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.OffsetDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("integer" to integer, "int32" to int32, "int64" to int64, "number" to number, "float" to float, "double" to double, "string" to string, "pattern_without_delimiter" to patternWithoutDelimiter, "byte" to byte, "binary" to binary, "date" to date, "dateTime" to dateTime, "password" to password, "callback" to paramCallback) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") - * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to enumFormStringArray, "enum_form_string" to enumFormString) - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - if (enumQueryStringArray != null) { - put("enum_query_string_array", toMultiValue(enumQueryStringArray.toList(), "multi")) - } - if (enumQueryString != null) { - put("enum_query_string", listOf(enumQueryString.toString())) - } - if (enumQueryInteger != null) { - put("enum_query_integer", listOf(enumQueryInteger.toString())) - } - if (enumQueryDouble != null) { - put("enum_query_double", listOf(enumQueryDouble.toString())) - } - } - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/fake", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters - * @param requiredBooleanGroup Required Boolean in group parameters - * @param requiredInt64Group Required Integer in group parameters - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("required_string_group", listOf(requiredStringGroup.toString())) - put("required_int64_group", listOf(requiredInt64Group.toString())) - if (stringGroup != null) { - put("string_group", listOf(stringGroup.toString())) - } - if (int64Group != null) { - put("int64_group", listOf(int64Group.toString())) - } - } - val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/fake", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * test inline additionalProperties - * - * @param requestBody request body - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : Unit { - val localVariableBody: kotlin.Any? = requestBody - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/fake/inline-additionalProperties", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * test json serialization of form data - * - * @param param field1 - * @param param2 field2 - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = mapOf("param" to param, "param2" to param2) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/fake/jsonFormData", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * - * To test the collection format in query parameters - * @param pipe - * @param ioutil - * @param http - * @param url - * @param context - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testQueryParameterCollectionFormat(pipe: kotlin.Array, ioutil: kotlin.Array, http: kotlin.Array, url: kotlin.Array, context: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("pipe", toMultiValue(pipe.toList(), "multi")) - put("ioutil", toMultiValue(ioutil.toList(), "csv")) - put("http", toMultiValue(http.toList(), "space")) - put("url", toMultiValue(url.toList(), "csv")) - put("context", toMultiValue(context.toList(), "multi")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/fake/test-query-paramters", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt deleted file mode 100644 index 9739a0859ea2..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ /dev/null @@ -1,77 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Client - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class FakeClassnameTags123Api(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") - } - } - - /** - * To test class name in snake case - * To test class name in snake case - * @param client client model - * @return Client - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun testClassname(client: Client) : Client { - val localVariableBody: kotlin.Any? = client - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PATCH, - "/fake_classname_test", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Client - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt deleted file mode 100644 index 6d216739f0b2..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param mapProperty - * @param mapOfMapProperty - */ - -data class AdditionalPropertiesClass ( - @SerializedName("map_property") - val mapProperty: kotlin.collections.Map? = null, - @SerializedName("map_of_map_property") - val mapOfMapProperty: kotlin.collections.Map>? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt deleted file mode 100644 index 86992f00d6a6..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param className - * @param color - */ - -interface Animal : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - @get:SerializedName("className") - val className: kotlin.String - @get:SerializedName("color") - val color: kotlin.String? -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt deleted file mode 100644 index 02723cb9dcd9..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param arrayArrayNumber - */ - -data class ArrayOfArrayOfNumberOnly ( - @SerializedName("ArrayArrayNumber") - val arrayArrayNumber: kotlin.Array>? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt deleted file mode 100644 index afde31b7ff41..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param arrayNumber - */ - -data class ArrayOfNumberOnly ( - @SerializedName("ArrayNumber") - val arrayNumber: kotlin.Array? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt deleted file mode 100644 index d9946e24ba46..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.ReadOnlyFirst - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param arrayOfString - * @param arrayArrayOfInteger - * @param arrayArrayOfModel - */ - -data class ArrayTest ( - @SerializedName("array_of_string") - val arrayOfString: kotlin.Array? = null, - @SerializedName("array_array_of_integer") - val arrayArrayOfInteger: kotlin.Array>? = null, - @SerializedName("array_array_of_model") - val arrayArrayOfModel: kotlin.Array>? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt deleted file mode 100644 index a7c7d3c9a761..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param smallCamel - * @param capitalCamel - * @param smallSnake - * @param capitalSnake - * @param scAETHFlowPoints - * @param ATT_NAME Name of the pet - */ - -data class Capitalization ( - @SerializedName("smallCamel") - val smallCamel: kotlin.String? = null, - @SerializedName("CapitalCamel") - val capitalCamel: kotlin.String? = null, - @SerializedName("small_Snake") - val smallSnake: kotlin.String? = null, - @SerializedName("Capital_Snake") - val capitalSnake: kotlin.String? = null, - @SerializedName("SCA_ETH_Flow_Points") - val scAETHFlowPoints: kotlin.String? = null, - /* Name of the pet */ - @SerializedName("ATT_NAME") - val ATT_NAME: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt deleted file mode 100644 index 3c0b6063ce16..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* OpenAPI Petstore -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Animal -import org.openapitools.client.models.CatAllOf - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param className - * @param color - * @param declawed - */ - -data class Cat ( - @SerializedName("className") - override val className: kotlin.String, - @SerializedName("color") - override val color: kotlin.String? = null, - @SerializedName("declawed") - val declawed: kotlin.Boolean? = null -) : Animal, Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt deleted file mode 100644 index 7b42c1e2f515..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param declawed - */ - -data class CatAllOf ( - @SerializedName("declawed") - val declawed: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt deleted file mode 100644 index d4ca6d612415..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * Model for testing model with \"_class\" property - * @param propertyClass - */ - -data class ClassModel ( - @SerializedName("_class") - val propertyClass: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt deleted file mode 100644 index 2823f40b88b5..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param client - */ - -data class Client ( - @SerializedName("client") - val client: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt deleted file mode 100644 index fbc06cf1dd61..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* OpenAPI Petstore -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Animal -import org.openapitools.client.models.DogAllOf - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param className - * @param color - * @param breed - */ - -data class Dog ( - @SerializedName("className") - override val className: kotlin.String, - @SerializedName("color") - override val color: kotlin.String? = null, - @SerializedName("breed") - val breed: kotlin.String? = null -) : Animal, Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt deleted file mode 100644 index c422756a65fa..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param breed - */ - -data class DogAllOf ( - @SerializedName("breed") - val breed: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt deleted file mode 100644 index 8ffe63f244b1..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ /dev/null @@ -1,52 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param justSymbol - * @param arrayEnum - */ - -data class EnumArrays ( - @SerializedName("just_symbol") - val justSymbol: EnumArrays.JustSymbol? = null, - @SerializedName("array_enum") - val arrayEnum: kotlin.Array? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * - * Values: greaterThanEqual,dollar - */ - - enum class JustSymbol(val value: kotlin.String){ - @SerializedName(value = ">=") greaterThanEqual(">="), - @SerializedName(value = "$") dollar("$"); - } - /** - * - * Values: fish,crab - */ - - enum class ArrayEnum(val value: kotlin.String){ - @SerializedName(value = "fish") fish("fish"), - @SerializedName(value = "crab") crab("crab"); - } -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt deleted file mode 100644 index 2eccf5d72fa7..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** -* -* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis -*/ - -enum class EnumClass(val value: kotlin.String){ - - - @SerializedName(value = "_abc") - abc("_abc"), - - - @SerializedName(value = "-efg") - minusEfg("-efg"), - - - @SerializedName(value = "(xyz)") - leftParenthesisXyzRightParenthesis("(xyz)"); - - - - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt deleted file mode 100644 index a939ed3f41ac..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ /dev/null @@ -1,94 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.OuterEnum -import org.openapitools.client.models.OuterEnumDefaultValue -import org.openapitools.client.models.OuterEnumInteger -import org.openapitools.client.models.OuterEnumIntegerDefaultValue - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param enumStringRequired - * @param enumString - * @param enumInteger - * @param enumNumber - * @param outerEnum - * @param outerEnumInteger - * @param outerEnumDefaultValue - * @param outerEnumIntegerDefaultValue - */ - -data class EnumTest ( - @SerializedName("enum_string_required") - val enumStringRequired: EnumTest.EnumStringRequired, - @SerializedName("enum_string") - val enumString: EnumTest.EnumString? = null, - @SerializedName("enum_integer") - val enumInteger: EnumTest.EnumInteger? = null, - @SerializedName("enum_number") - val enumNumber: EnumTest.EnumNumber? = null, - @SerializedName("outerEnum") - val outerEnum: OuterEnum? = null, - @SerializedName("outerEnumInteger") - val outerEnumInteger: OuterEnumInteger? = null, - @SerializedName("outerEnumDefaultValue") - val outerEnumDefaultValue: OuterEnumDefaultValue? = null, - @SerializedName("outerEnumIntegerDefaultValue") - val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * - * Values: uPPER,lower,eMPTY - */ - - enum class EnumStringRequired(val value: kotlin.String){ - @SerializedName(value = "UPPER") uPPER("UPPER"), - @SerializedName(value = "lower") lower("lower"), - @SerializedName(value = "") eMPTY(""); - } - /** - * - * Values: uPPER,lower,eMPTY - */ - - enum class EnumString(val value: kotlin.String){ - @SerializedName(value = "UPPER") uPPER("UPPER"), - @SerializedName(value = "lower") lower("lower"), - @SerializedName(value = "") eMPTY(""); - } - /** - * - * Values: _1,minus1 - */ - - enum class EnumInteger(val value: kotlin.Int){ - @SerializedName(value = "1") _1(1), - @SerializedName(value = "-1") minus1(-1); - } - /** - * - * Values: _1period1,minus1Period2 - */ - - enum class EnumNumber(val value: kotlin.Double){ - @SerializedName(value = "1.1") _1period1(1.1), - @SerializedName(value = "-1.2") minus1Period2(-1.2); - } -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt deleted file mode 100644 index 8ccd536e097a..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param file - * @param files - */ - -data class FileSchemaTestClass ( - @SerializedName("file") - val file: java.io.File? = null, - @SerializedName("files") - val files: kotlin.Array? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt deleted file mode 100644 index eac43b985250..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param bar - */ - -data class Foo ( - @SerializedName("bar") - val bar: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt deleted file mode 100644 index f8f4fd031287..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ /dev/null @@ -1,75 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param number - * @param byte - * @param date - * @param password - * @param integer - * @param int32 - * @param int64 - * @param float - * @param double - * @param string - * @param binary - * @param dateTime - * @param uuid - * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. - * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - */ - -data class FormatTest ( - @SerializedName("number") - val number: java.math.BigDecimal, - @SerializedName("byte") - val byte: kotlin.ByteArray, - @SerializedName("date") - val date: java.time.LocalDate, - @SerializedName("password") - val password: kotlin.String, - @SerializedName("integer") - val integer: kotlin.Int? = null, - @SerializedName("int32") - val int32: kotlin.Int? = null, - @SerializedName("int64") - val int64: kotlin.Long? = null, - @SerializedName("float") - val float: kotlin.Float? = null, - @SerializedName("double") - val double: kotlin.Double? = null, - @SerializedName("string") - val string: kotlin.String? = null, - @SerializedName("binary") - val binary: java.io.File? = null, - @SerializedName("dateTime") - val dateTime: java.time.OffsetDateTime? = null, - @SerializedName("uuid") - val uuid: java.util.UUID? = null, - /* A string that is a 10 digit number. Can have leading zeros. */ - @SerializedName("pattern_with_digits") - val patternWithDigits: kotlin.String? = null, - /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ - @SerializedName("pattern_with_digits_and_delimiter") - val patternWithDigitsAndDelimiter: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt deleted file mode 100644 index e70f33609981..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param bar - * @param foo - */ - -data class HasOnlyReadOnly ( - @SerializedName("bar") - val bar: kotlin.String? = null, - @SerializedName("foo") - val foo: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt deleted file mode 100644 index 5ea4977b7cb5..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - * @param nullableMessage - */ - -data class HealthCheckResult ( - @SerializedName("NullableMessage") - val nullableMessage: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt deleted file mode 100644 index e513221c62ba..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - -data class InlineObject ( - /* Updated name of the pet */ - @SerializedName("name") - val name: kotlin.String? = null, - /* Updated status of the pet */ - @SerializedName("status") - val status: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt deleted file mode 100644 index 183929c471fe..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - -data class InlineObject1 ( - /* Additional data to pass to server */ - @SerializedName("additionalMetadata") - val additionalMetadata: kotlin.String? = null, - /* file to upload */ - @SerializedName("file") - val file: java.io.File? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt deleted file mode 100644 index 29c4d228fd8c..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ /dev/null @@ -1,55 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param enumFormStringArray Form parameter enum test (string array) - * @param enumFormString Form parameter enum test (string) - */ - -data class InlineObject2 ( - /* Form parameter enum test (string array) */ - @SerializedName("enum_form_string_array") - val enumFormStringArray: kotlin.Array? = null, - /* Form parameter enum test (string) */ - @SerializedName("enum_form_string") - val enumFormString: InlineObject2.EnumFormString? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Form parameter enum test (string array) - * Values: greaterThan,dollar - */ - - enum class EnumFormStringArray(val value: kotlin.String){ - @SerializedName(value = ">") greaterThan(">"), - @SerializedName(value = "$") dollar("$"); - } - /** - * Form parameter enum test (string) - * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis - */ - - enum class EnumFormString(val value: kotlin.String){ - @SerializedName(value = "_abc") abc("_abc"), - @SerializedName(value = "-efg") minusEfg("-efg"), - @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); - } -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt deleted file mode 100644 index a5734ebed46d..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ /dev/null @@ -1,84 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param number None - * @param double None - * @param patternWithoutDelimiter None - * @param byte None - * @param integer None - * @param int32 None - * @param int64 None - * @param float None - * @param string None - * @param binary None - * @param date None - * @param dateTime None - * @param password None - * @param callback None - */ - -data class InlineObject3 ( - /* None */ - @SerializedName("number") - val number: java.math.BigDecimal, - /* None */ - @SerializedName("double") - val double: kotlin.Double, - /* None */ - @SerializedName("pattern_without_delimiter") - val patternWithoutDelimiter: kotlin.String, - /* None */ - @SerializedName("byte") - val byte: kotlin.ByteArray, - /* None */ - @SerializedName("integer") - val integer: kotlin.Int? = null, - /* None */ - @SerializedName("int32") - val int32: kotlin.Int? = null, - /* None */ - @SerializedName("int64") - val int64: kotlin.Long? = null, - /* None */ - @SerializedName("float") - val float: kotlin.Float? = null, - /* None */ - @SerializedName("string") - val string: kotlin.String? = null, - /* None */ - @SerializedName("binary") - val binary: java.io.File? = null, - /* None */ - @SerializedName("date") - val date: java.time.LocalDate? = null, - /* None */ - @SerializedName("dateTime") - val dateTime: java.time.OffsetDateTime? = null, - /* None */ - @SerializedName("password") - val password: kotlin.String? = null, - /* None */ - @SerializedName("callback") - val callback: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt deleted file mode 100644 index 488f57faff3d..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param param field1 - * @param param2 field2 - */ - -data class InlineObject4 ( - /* field1 */ - @SerializedName("param") - val param: kotlin.String, - /* field2 */ - @SerializedName("param2") - val param2: kotlin.String -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt deleted file mode 100644 index 1bd7d0c64b88..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param requiredFile file to upload - * @param additionalMetadata Additional data to pass to server - */ - -data class InlineObject5 ( - /* file to upload */ - @SerializedName("requiredFile") - val requiredFile: java.io.File, - /* Additional data to pass to server */ - @SerializedName("additionalMetadata") - val additionalMetadata: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt deleted file mode 100644 index 0252304ee847..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Foo - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param string - */ - -data class InlineResponseDefault ( - @SerializedName("string") - val string: Foo? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt deleted file mode 100644 index b7c9f9b029bb..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param `123minusList` - */ - -data class List ( - @SerializedName("123-list") - val `123minusList`: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt deleted file mode 100644 index 768f0a766039..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ /dev/null @@ -1,49 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param mapMapOfString - * @param mapOfEnumString - * @param directMap - * @param indirectMap - */ - -data class MapTest ( - @SerializedName("map_map_of_string") - val mapMapOfString: kotlin.collections.Map>? = null, - @SerializedName("map_of_enum_string") - val mapOfEnumString: MapTest.MapOfEnumString? = null, - @SerializedName("direct_map") - val directMap: kotlin.collections.Map? = null, - @SerializedName("indirect_map") - val indirectMap: kotlin.collections.Map? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * - * Values: uPPER,lower - */ - - enum class MapOfEnumString(val value: kotlin.String){ - @SerializedName(value = "UPPER") uPPER("UPPER"), - @SerializedName(value = "lower") lower("lower"); - } -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt deleted file mode 100644 index ec5c3ba8eadb..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Animal - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param uuid - * @param dateTime - * @param map - */ - -data class MixedPropertiesAndAdditionalPropertiesClass ( - @SerializedName("uuid") - val uuid: java.util.UUID? = null, - @SerializedName("dateTime") - val dateTime: java.time.OffsetDateTime? = null, - @SerializedName("map") - val map: kotlin.collections.Map? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt deleted file mode 100644 index b9506ce766f2..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * Model for testing model name starting with number - * @param name - * @param propertyClass - */ - -data class Model200Response ( - @SerializedName("name") - val name: kotlin.Int? = null, - @SerializedName("class") - val propertyClass: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt deleted file mode 100644 index a26df5946ca7..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt +++ /dev/null @@ -1,40 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * Model for testing model name same as property name - * @param name - * @param snakeCase - * @param property - * @param `123number` - */ - -data class Name ( - @SerializedName("name") - val name: kotlin.Int, - @SerializedName("snake_case") - val snakeCase: kotlin.Int? = null, - @SerializedName("property") - val property: kotlin.String? = null, - @SerializedName("123Number") - val `123number`: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt deleted file mode 100644 index 44ef32f26378..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt +++ /dev/null @@ -1,64 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param integerProp - * @param numberProp - * @param booleanProp - * @param stringProp - * @param dateProp - * @param datetimeProp - * @param arrayNullableProp - * @param arrayAndItemsNullableProp - * @param arrayItemsNullable - * @param objectNullableProp - * @param objectAndItemsNullableProp - * @param objectItemsNullable - */ - -data class NullableClass ( - @SerializedName("integer_prop") - val integerProp: kotlin.Int? = null, - @SerializedName("number_prop") - val numberProp: java.math.BigDecimal? = null, - @SerializedName("boolean_prop") - val booleanProp: kotlin.Boolean? = null, - @SerializedName("string_prop") - val stringProp: kotlin.String? = null, - @SerializedName("date_prop") - val dateProp: java.time.LocalDate? = null, - @SerializedName("datetime_prop") - val datetimeProp: java.time.OffsetDateTime? = null, - @SerializedName("array_nullable_prop") - val arrayNullableProp: kotlin.Array? = null, - @SerializedName("array_and_items_nullable_prop") - val arrayAndItemsNullableProp: kotlin.Array? = null, - @SerializedName("array_items_nullable") - val arrayItemsNullable: kotlin.Array? = null, - @SerializedName("object_nullable_prop") - val objectNullableProp: kotlin.collections.Map? = null, - @SerializedName("object_and_items_nullable_prop") - val objectAndItemsNullableProp: kotlin.collections.Map? = null, - @SerializedName("object_items_nullable") - val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap(), Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt deleted file mode 100644 index ca273d1f3a17..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param justNumber - */ - -data class NumberOnly ( - @SerializedName("JustNumber") - val justNumber: java.math.BigDecimal? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt deleted file mode 100644 index 8246390507ec..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ /dev/null @@ -1,37 +0,0 @@ -/** -* OpenAPI Petstore -* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param myNumber - * @param myString - * @param myBoolean - */ - -data class OuterComposite ( - @SerializedName("my_number") - val myNumber: java.math.BigDecimal? = null, - @SerializedName("my_string") - val myString: kotlin.String? = null, - @SerializedName("my_boolean") - val myBoolean: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt deleted file mode 100644 index 1c2c521eaf57..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** -* -* Values: placed,approved,delivered -*/ - -enum class OuterEnum(val value: kotlin.String){ - - - @SerializedName(value = "placed") - placed("placed"), - - - @SerializedName(value = "approved") - approved("approved"), - - - @SerializedName(value = "delivered") - delivered("delivered"); - - - - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt deleted file mode 100644 index 12c2b0a94aa3..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** -* -* Values: placed,approved,delivered -*/ - -enum class OuterEnumDefaultValue(val value: kotlin.String){ - - - @SerializedName(value = "placed") - placed("placed"), - - - @SerializedName(value = "approved") - approved("approved"), - - - @SerializedName(value = "delivered") - delivered("delivered"); - - - - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt deleted file mode 100644 index c2ac6a4a936d..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** -* -* Values: _0,_1,_2 -*/ - -enum class OuterEnumInteger(val value: kotlin.Int){ - - - @SerializedName(value = "0") - _0(0), - - - @SerializedName(value = "1") - _1(1), - - - @SerializedName(value = "2") - _2(2); - - - - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value.toString() - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt deleted file mode 100644 index 3066cfbae73d..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** -* -* Values: _0,_1,_2 -*/ - -enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ - - - @SerializedName(value = "0") - _0(0), - - - @SerializedName(value = "1") - _1(1), - - - @SerializedName(value = "2") - _2(2); - - - - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value.toString() - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt deleted file mode 100644 index 5dff54dc190a..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param bar - * @param baz - */ - -data class ReadOnlyFirst ( - @SerializedName("bar") - val bar: kotlin.String? = null, - @SerializedName("baz") - val baz: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt deleted file mode 100644 index ecdce7f408fb..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * Model for testing reserved words - * @param `return` - */ - -data class Return ( - @SerializedName("return") - val `return`: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt deleted file mode 100644 index f67aa3c948b6..000000000000 --- a/samples/openapi3/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* 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 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable -/** - * - * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - */ - -data class SpecialModelname ( - @SerializedName("\$special[property.name]") - val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} -