From bcefbe99c1ec54ab680f3ad2e437147d9a8bec9f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 22 Jun 2020 16:56:03 +0800 Subject: [PATCH] Migrate PHP client samples to use OAS v3 spec (#6722) * consolidate php samples * restore EnumTestTest.php --- bin/configs/php-OpenAPIClient-oas2.yaml | 4 - bin/configs/php-OpenAPIClient.yaml | 2 +- pom.xml | 1 - .../.openapi-generator/FILES | 52 +- .../petstore/php/OpenAPIClient-php/README.md | 47 +- .../docs/Api/AnotherFakeApi.md | 8 +- .../OpenAPIClient-php/docs/Api/DefaultApi.md | 15 +- .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 143 +- .../docs/Api/FakeClassnameTags123Api.md | 8 +- .../php/OpenAPIClient-php/docs/Api/PetApi.md | 16 +- .../OpenAPIClient-php/docs/Api/StoreApi.md | 10 +- .../php/OpenAPIClient-php/docs/Api/UserApi.md | 40 +- .../docs/Model/AdditionalPropertiesClass.md | 13 +- .../OpenAPIClient-php/docs/Model/EnumTest.md | 3 + .../php/OpenAPIClient-php/docs/Model/Foo.md | 5 +- .../docs/Model/FormatTest.md | 3 +- .../docs/Model/HealthCheckResult.md | 0 .../docs/Model/InlineObject.md | 5 +- .../docs/Model/InlineObject1.md | 5 +- .../docs/Model/InlineObject2.md | 5 +- .../docs/Model/InlineObject3.md | 5 +- .../docs/Model/InlineObject4.md | 5 +- .../docs/Model/InlineObject5.md | 5 +- .../docs/Model/InlineResponseDefault.md | 5 +- .../docs/Model/NullableClass.md | 0 .../docs/Model/OuterEnumDefaultValue.md | 0 .../docs/Model/OuterEnumInteger.md | 0 .../Model/OuterEnumIntegerDefaultValue.md | 0 .../lib/Api/AnotherFakeApi.php | 38 +- .../OpenAPIClient-php/lib/Api/DefaultApi.php | 0 .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 689 ++- .../lib/Api/FakeClassnameTags123Api.php | 38 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 132 +- .../OpenAPIClient-php/lib/Api/StoreApi.php | 40 +- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 184 +- .../OpenAPIClient-php/lib/Configuration.php | 37 +- .../lib/Model/AdditionalPropertiesClass.php | 322 +- .../OpenAPIClient-php/lib/Model/EnumTest.php | 100 +- .../php/OpenAPIClient-php/lib/Model/Foo.php | 0 .../lib/Model/FormatTest.php | 85 +- .../lib/Model/HealthCheckResult.php | 0 .../lib/Model/InlineObject.php | 0 .../lib/Model/InlineObject1.php | 0 .../lib/Model/InlineObject2.php | 0 .../lib/Model/InlineObject3.php | 0 .../lib/Model/InlineObject4.php | 0 .../lib/Model/InlineObject5.php | 0 .../lib/Model/InlineResponseDefault.php | 0 .../lib/Model/NullableClass.php | 0 .../lib/Model/OuterEnumDefaultValue.php | 0 .../lib/Model/OuterEnumInteger.php | 0 .../Model/OuterEnumIntegerDefaultValue.php | 0 .../lib/Model/SpecialModelName.php | 2 +- .../petstore/php/OpenAPIClient-php/pom.xml | 4 +- .../test/Api/DefaultApiTest.php | 0 .../test/Api/FakeApiTest.php | 18 +- .../Model/AdditionalPropertiesClassTest.php | 71 +- .../test/Model/EnumTestTest.php | 21 + .../OpenAPIClient-php/test/Model/FooTest.php | 0 .../test/Model/FormatTestTest.php | 11 +- .../test/Model/HealthCheckResultTest.php | 0 .../test/Model/InlineObject1Test.php | 0 .../test/Model/InlineObject2Test.php | 0 .../test/Model/InlineObject3Test.php | 0 .../test/Model/InlineObject4Test.php | 0 .../test/Model/InlineObject5Test.php | 0 .../test/Model/InlineObjectTest.php | 0 .../test/Model/InlineResponseDefaultTest.php | 0 .../test/Model/NullableClassTest.php | 0 .../test/Model/OuterEnumDefaultValueTest.php | 0 .../OuterEnumIntegerDefaultValueTest.php | 0 .../test/Model/OuterEnumIntegerTest.php | 0 .../tests/ConfigurationTest.php | 0 .../php/OpenAPIClient-php/tests/DebugTest.php | 10 + .../OpenAPIClient-php/tests/PetApiTest.php | 2 +- .../OpenAPIClient-php/tests/RequestTest.php | 1 - .../tests/ResponseTypesTest.php | 4 +- .../petstore/php/OpenAPIClient-php/.gitignore | 14 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 124 - .../.openapi-generator/VERSION | 1 - .../petstore/php/OpenAPIClient-php/.php_cs | 23 - .../php/OpenAPIClient-php/.travis.yml | 10 - .../petstore/php/OpenAPIClient-php/README.md | 237 - .../php/OpenAPIClient-php/composer.json | 38 - .../docs/Api/AnotherFakeApi.md | 65 - .../OpenAPIClient-php/docs/Api/DefaultApi.md | 59 - .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 923 ---- .../docs/Api/FakeClassnameTags123Api.md | 72 - .../php/OpenAPIClient-php/docs/Api/PetApi.md | 566 --- .../OpenAPIClient-php/docs/Api/StoreApi.md | 236 - .../php/OpenAPIClient-php/docs/Api/UserApi.md | 448 -- .../docs/Model/AdditionalPropertiesClass.md | 12 - .../OpenAPIClient-php/docs/Model/Animal.md | 12 - .../docs/Model/ApiResponse.md | 13 - .../docs/Model/ArrayOfArrayOfNumberOnly.md | 11 - .../docs/Model/ArrayOfNumberOnly.md | 11 - .../OpenAPIClient-php/docs/Model/ArrayTest.md | 13 - .../docs/Model/Capitalization.md | 16 - .../php/OpenAPIClient-php/docs/Model/Cat.md | 11 - .../OpenAPIClient-php/docs/Model/CatAllOf.md | 11 - .../OpenAPIClient-php/docs/Model/Category.md | 12 - .../docs/Model/ClassModel.md | 11 - .../OpenAPIClient-php/docs/Model/Client.md | 11 - .../php/OpenAPIClient-php/docs/Model/Dog.md | 11 - .../OpenAPIClient-php/docs/Model/DogAllOf.md | 11 - .../docs/Model/EnumArrays.md | 12 - .../OpenAPIClient-php/docs/Model/EnumClass.md | 10 - .../OpenAPIClient-php/docs/Model/EnumTest.md | 18 - .../php/OpenAPIClient-php/docs/Model/File.md | 11 - .../docs/Model/FileSchemaTestClass.md | 12 - .../php/OpenAPIClient-php/docs/Model/Foo.md | 11 - .../docs/Model/FormatTest.md | 25 - .../docs/Model/HasOnlyReadOnly.md | 12 - .../docs/Model/InlineObject.md | 12 - .../docs/Model/InlineObject1.md | 12 - .../docs/Model/InlineObject2.md | 12 - .../docs/Model/InlineObject3.md | 24 - .../docs/Model/InlineObject4.md | 12 - .../docs/Model/InlineObject5.md | 12 - .../docs/Model/InlineResponseDefault.md | 11 - .../OpenAPIClient-php/docs/Model/MapTest.md | 14 - ...dPropertiesAndAdditionalPropertiesClass.md | 13 - .../docs/Model/Model200Response.md | 12 - .../OpenAPIClient-php/docs/Model/ModelList.md | 11 - .../docs/Model/ModelReturn.md | 11 - .../php/OpenAPIClient-php/docs/Model/Name.md | 14 - .../docs/Model/NumberOnly.md | 11 - .../php/OpenAPIClient-php/docs/Model/Order.md | 16 - .../docs/Model/OuterComposite.md | 13 - .../OpenAPIClient-php/docs/Model/OuterEnum.md | 10 - .../php/OpenAPIClient-php/docs/Model/Pet.md | 16 - .../docs/Model/ReadOnlyFirst.md | 12 - .../docs/Model/SpecialModelName.md | 11 - .../php/OpenAPIClient-php/docs/Model/Tag.md | 12 - .../php/OpenAPIClient-php/docs/Model/User.md | 18 - .../php/OpenAPIClient-php/git_push.sh | 58 - .../lib/Api/AnotherFakeApi.php | 404 -- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 4190 ----------------- .../lib/Api/FakeClassnameTags123Api.php | 409 -- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 2549 ---------- .../OpenAPIClient-php/lib/Api/StoreApi.php | 1168 ----- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 2037 -------- .../OpenAPIClient-php/lib/ApiException.php | 121 - .../OpenAPIClient-php/lib/Configuration.php | 517 -- .../OpenAPIClient-php/lib/HeaderSelector.php | 110 - .../lib/Model/AdditionalPropertiesClass.php | 337 -- .../OpenAPIClient-php/lib/Model/Animal.php | 343 -- .../lib/Model/ApiResponse.php | 367 -- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 307 -- .../lib/Model/ArrayOfNumberOnly.php | 307 -- .../OpenAPIClient-php/lib/Model/ArrayTest.php | 367 -- .../lib/Model/Capitalization.php | 457 -- .../php/OpenAPIClient-php/lib/Model/Cat.php | 301 -- .../OpenAPIClient-php/lib/Model/CatAllOf.php | 307 -- .../OpenAPIClient-php/lib/Model/Category.php | 340 -- .../lib/Model/ClassModel.php | 308 -- .../OpenAPIClient-php/lib/Model/Client.php | 307 -- .../php/OpenAPIClient-php/lib/Model/Dog.php | 301 -- .../OpenAPIClient-php/lib/Model/DogAllOf.php | 307 -- .../lib/Model/EnumArrays.php | 393 -- .../OpenAPIClient-php/lib/Model/EnumClass.php | 64 - .../OpenAPIClient-php/lib/Model/EnumTest.php | 652 --- .../php/OpenAPIClient-php/lib/Model/File.php | 308 -- .../lib/Model/FileSchemaTestClass.php | 337 -- .../lib/Model/FormatTest.php | 861 ---- .../lib/Model/HasOnlyReadOnly.php | 337 -- .../OpenAPIClient-php/lib/Model/MapTest.php | 421 -- ...PropertiesAndAdditionalPropertiesClass.php | 367 -- .../lib/Model/Model200Response.php | 338 -- .../lib/Model/ModelInterface.php | 96 - .../OpenAPIClient-php/lib/Model/ModelList.php | 307 -- .../lib/Model/ModelReturn.php | 308 -- .../php/OpenAPIClient-php/lib/Model/Name.php | 401 -- .../lib/Model/NumberOnly.php | 307 -- .../php/OpenAPIClient-php/lib/Model/Order.php | 491 -- .../lib/Model/OuterComposite.php | 367 -- .../OpenAPIClient-php/lib/Model/OuterEnum.php | 64 - .../php/OpenAPIClient-php/lib/Model/Pet.php | 497 -- .../lib/Model/ReadOnlyFirst.php | 337 -- .../lib/Model/SpecialModelName.php | 307 -- .../php/OpenAPIClient-php/lib/Model/Tag.php | 337 -- .../php/OpenAPIClient-php/lib/Model/User.php | 517 -- .../lib/ObjectSerializer.php | 352 -- .../php/OpenAPIClient-php/phpunit.xml.dist | 23 - .../petstore/php/OpenAPIClient-php/pom.xml | 59 - .../test/Api/AnotherFakeApiTest.php | 84 - .../test/Api/FakeApiTest.php | 224 - .../test/Api/FakeClassnameTags123ApiTest.php | 84 - .../OpenAPIClient-php/test/Api/PetApiTest.php | 164 - .../test/Api/StoreApiTest.php | 114 - .../test/Api/UserApiTest.php | 154 - .../Model/AdditionalPropertiesClassTest.php | 94 - .../test/Model/AnimalTest.php | 94 - .../test/Model/ApiResponseTest.php | 101 - .../Model/ArrayOfArrayOfNumberOnlyTest.php | 87 - .../test/Model/ArrayOfNumberOnlyTest.php | 87 - .../test/Model/ArrayTestTest.php | 101 - .../test/Model/CapitalizationTest.php | 122 - .../test/Model/CatAllOfTest.php | 87 - .../OpenAPIClient-php/test/Model/CatTest.php | 87 - .../test/Model/CategoryTest.php | 94 - .../test/Model/ClassModelTest.php | 87 - .../test/Model/ClientTest.php | 87 - .../test/Model/DogAllOfTest.php | 87 - .../OpenAPIClient-php/test/Model/DogTest.php | 87 - .../test/Model/EnumArraysTest.php | 94 - .../test/Model/EnumClassTest.php | 80 - .../test/Model/EnumTestTest.php | 136 - .../test/Model/FileSchemaTestClassTest.php | 94 - .../OpenAPIClient-php/test/Model/FileTest.php | 87 - .../test/Model/FormatTestTest.php | 185 - .../test/Model/HasOnlyReadOnlyTest.php | 94 - .../test/Model/MapTestTest.php | 108 - ...ertiesAndAdditionalPropertiesClassTest.php | 101 - .../test/Model/Model200ResponseTest.php | 94 - .../test/Model/ModelListTest.php | 87 - .../test/Model/ModelReturnTest.php | 87 - .../OpenAPIClient-php/test/Model/NameTest.php | 108 - .../test/Model/NumberOnlyTest.php | 87 - .../test/Model/OrderTest.php | 122 - .../test/Model/OuterCompositeTest.php | 101 - .../test/Model/OuterEnumTest.php | 80 - .../OpenAPIClient-php/test/Model/PetTest.php | 122 - .../test/Model/ReadOnlyFirstTest.php | 94 - .../test/Model/SpecialModelNameTest.php | 87 - .../OpenAPIClient-php/test/Model/TagTest.php | 94 - .../OpenAPIClient-php/test/Model/UserTest.php | 136 - .../php/OpenAPIClient-php/tests/AsyncTest.php | 87 - .../php/OpenAPIClient-php/tests/AuthTest.php | 63 - .../tests/DateTimeSerializerTest.php | 40 - .../php/OpenAPIClient-php/tests/DebugTest.php | 38 - .../OpenAPIClient-php/tests/EnumClassTest.php | 16 - .../OpenAPIClient-php/tests/EnumTestTest.php | 35 - .../OpenAPIClient-php/tests/ExceptionTest.php | 39 - .../tests/FakeHttpClient.php | 69 - .../tests/HeaderSelectorTest.php | 58 - .../OpenAPIClient-php/tests/HeadersTest.php | 33 - .../tests/ModelInheritanceTest.php | 96 - .../tests/ObjectSerializerTest.php | 27 - .../OpenAPIClient-php/tests/OrderApiTest.php | 133 - .../OpenAPIClient-php/tests/OuterEnumTest.php | 95 - .../tests/ParametersTest.php | 66 - .../OpenAPIClient-php/tests/PetApiTest.php | 390 -- .../php/OpenAPIClient-php/tests/PetTest.php | 19 - .../OpenAPIClient-php/tests/RequestTest.php | 36 - .../tests/ResponseTypesTest.php | 92 - .../OpenAPIClient-php/tests/StoreApiTest.php | 57 - .../OpenAPIClient-php/tests/UserApiTest.php | 37 - 249 files changed, 1279 insertions(+), 35337 deletions(-) delete mode 100644 bin/configs/php-OpenAPIClient-oas2.yaml rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/docs/Model/HealthCheckResult.md (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/docs/Model/NullableClass.md (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumDefaultValue.md (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumInteger.md (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumIntegerDefaultValue.md (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php (100%) rename samples/{openapi3 => }/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php (100%) delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.gitignore delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.php_cs delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.travis.yml delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/composer.json delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Animal.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Cat.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Category.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Client.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Dog.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumClass.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/File.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelList.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Name.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Order.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Pet.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Tag.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/User.md delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/pom.xml delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php delete mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php diff --git a/bin/configs/php-OpenAPIClient-oas2.yaml b/bin/configs/php-OpenAPIClient-oas2.yaml deleted file mode 100644 index d8cf9859d8f..00000000000 --- a/bin/configs/php-OpenAPIClient-oas2.yaml +++ /dev/null @@ -1,4 +0,0 @@ -generatorName: php -outputDir: samples/client/petstore/php/OpenAPIClient-php -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/php diff --git a/bin/configs/php-OpenAPIClient.yaml b/bin/configs/php-OpenAPIClient.yaml index a930b52a0c9..d3ce7bdae35 100644 --- a/bin/configs/php-OpenAPIClient.yaml +++ b/bin/configs/php-OpenAPIClient.yaml @@ -1,4 +1,4 @@ generatorName: php -outputDir: samples/openapi3/client/petstore/php/OpenAPIClient-php +outputDir: samples/client/petstore/php/OpenAPIClient-php inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/php diff --git a/pom.xml b/pom.xml index 20c82557cbf..966ef9caab4 100644 --- a/pom.xml +++ b/pom.xml @@ -1181,7 +1181,6 @@ samples/client/petstore/rust/reqwest/petstore samples/client/petstore/rust/reqwest/petstore-async samples/client/petstore/php/OpenAPIClient-php - samples/openapi3/client/petstore/php/OpenAPIClient-php samples/client/petstore/javascript-es6 samples/client/petstore/javascript-promise-es6 diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES index 72f2a6e7584..6c0c0f87b52 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -4,26 +4,18 @@ README.md composer.json docs/Api/AnotherFakeApi.md +docs/Api/DefaultApi.md docs/Api/FakeApi.md docs/Api/FakeClassnameTags123Api.md docs/Api/PetApi.md docs/Api/StoreApi.md docs/Api/UserApi.md -docs/Model/AdditionalPropertiesAnyType.md -docs/Model/AdditionalPropertiesArray.md -docs/Model/AdditionalPropertiesBoolean.md docs/Model/AdditionalPropertiesClass.md -docs/Model/AdditionalPropertiesInteger.md -docs/Model/AdditionalPropertiesNumber.md -docs/Model/AdditionalPropertiesObject.md -docs/Model/AdditionalPropertiesString.md docs/Model/Animal.md docs/Model/ApiResponse.md docs/Model/ArrayOfArrayOfNumberOnly.md docs/Model/ArrayOfNumberOnly.md docs/Model/ArrayTest.md -docs/Model/BigCat.md -docs/Model/BigCatAllOf.md docs/Model/Capitalization.md docs/Model/Cat.md docs/Model/CatAllOf.md @@ -37,28 +29,39 @@ docs/Model/EnumClass.md docs/Model/EnumTest.md docs/Model/File.md docs/Model/FileSchemaTestClass.md +docs/Model/Foo.md docs/Model/FormatTest.md docs/Model/HasOnlyReadOnly.md +docs/Model/HealthCheckResult.md +docs/Model/InlineObject.md +docs/Model/InlineObject1.md +docs/Model/InlineObject2.md +docs/Model/InlineObject3.md +docs/Model/InlineObject4.md +docs/Model/InlineObject5.md +docs/Model/InlineResponseDefault.md docs/Model/MapTest.md docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model/Model200Response.md docs/Model/ModelList.md docs/Model/ModelReturn.md docs/Model/Name.md +docs/Model/NullableClass.md docs/Model/NumberOnly.md docs/Model/Order.md docs/Model/OuterComposite.md docs/Model/OuterEnum.md +docs/Model/OuterEnumDefaultValue.md +docs/Model/OuterEnumInteger.md +docs/Model/OuterEnumIntegerDefaultValue.md docs/Model/Pet.md docs/Model/ReadOnlyFirst.md docs/Model/SpecialModelName.md docs/Model/Tag.md -docs/Model/TypeHolderDefault.md -docs/Model/TypeHolderExample.md docs/Model/User.md -docs/Model/XmlItem.md git_push.sh lib/Api/AnotherFakeApi.php +lib/Api/DefaultApi.php lib/Api/FakeApi.php lib/Api/FakeClassnameTags123Api.php lib/Api/PetApi.php @@ -67,21 +70,12 @@ lib/Api/UserApi.php lib/ApiException.php lib/Configuration.php lib/HeaderSelector.php -lib/Model/AdditionalPropertiesAnyType.php -lib/Model/AdditionalPropertiesArray.php -lib/Model/AdditionalPropertiesBoolean.php lib/Model/AdditionalPropertiesClass.php -lib/Model/AdditionalPropertiesInteger.php -lib/Model/AdditionalPropertiesNumber.php -lib/Model/AdditionalPropertiesObject.php -lib/Model/AdditionalPropertiesString.php lib/Model/Animal.php lib/Model/ApiResponse.php lib/Model/ArrayOfArrayOfNumberOnly.php lib/Model/ArrayOfNumberOnly.php lib/Model/ArrayTest.php -lib/Model/BigCat.php -lib/Model/BigCatAllOf.php lib/Model/Capitalization.php lib/Model/Cat.php lib/Model/CatAllOf.php @@ -95,8 +89,17 @@ lib/Model/EnumClass.php lib/Model/EnumTest.php lib/Model/File.php lib/Model/FileSchemaTestClass.php +lib/Model/Foo.php lib/Model/FormatTest.php lib/Model/HasOnlyReadOnly.php +lib/Model/HealthCheckResult.php +lib/Model/InlineObject.php +lib/Model/InlineObject1.php +lib/Model/InlineObject2.php +lib/Model/InlineObject3.php +lib/Model/InlineObject4.php +lib/Model/InlineObject5.php +lib/Model/InlineResponseDefault.php lib/Model/MapTest.php lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php lib/Model/Model200Response.php @@ -104,17 +107,18 @@ lib/Model/ModelInterface.php lib/Model/ModelList.php lib/Model/ModelReturn.php lib/Model/Name.php +lib/Model/NullableClass.php lib/Model/NumberOnly.php lib/Model/Order.php lib/Model/OuterComposite.php lib/Model/OuterEnum.php +lib/Model/OuterEnumDefaultValue.php +lib/Model/OuterEnumInteger.php +lib/Model/OuterEnumIntegerDefaultValue.php lib/Model/Pet.php lib/Model/ReadOnlyFirst.php lib/Model/SpecialModelName.php lib/Model/Tag.php -lib/Model/TypeHolderDefault.php -lib/Model/TypeHolderExample.php lib/Model/User.php -lib/Model/XmlItem.php lib/ObjectSerializer.php phpunit.xml.dist diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 123ca01e5bd..4a8f0287158 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -65,10 +65,10 @@ $apiInstance = new OpenAPI\Client\Api\AnotherFakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model +$client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->call123TestSpecialTags($body); + $result = $apiInstance->call123TestSpecialTags($client); print_r($result); } catch (Exception $e) { echo 'Exception when calling AnotherFakeApi->call123TestSpecialTags: ', $e->getMessage(), PHP_EOL; @@ -84,7 +84,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123TestSpecialTags**](docs/Api/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**createXmlItem**](docs/Api/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**fooGet**](docs/Api/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/Api/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/Api/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -92,7 +94,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testBodyWithFileSchema**](docs/Api/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/Api/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -124,21 +126,12 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [AdditionalPropertiesAnyType](docs/Model/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/Model/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/Model/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/Model/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/Model/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/Model/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/Model/AdditionalPropertiesString.md) - [Animal](docs/Model/Animal.md) - [ApiResponse](docs/Model/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) - [ArrayTest](docs/Model/ArrayTest.md) - - [BigCat](docs/Model/BigCat.md) - - [BigCatAllOf](docs/Model/BigCatAllOf.md) - [Capitalization](docs/Model/Capitalization.md) - [Cat](docs/Model/Cat.md) - [CatAllOf](docs/Model/CatAllOf.md) @@ -152,26 +145,36 @@ Class | Method | HTTP request | Description - [EnumTest](docs/Model/EnumTest.md) - [File](docs/Model/File.md) - [FileSchemaTestClass](docs/Model/FileSchemaTestClass.md) + - [Foo](docs/Model/Foo.md) - [FormatTest](docs/Model/FormatTest.md) - [HasOnlyReadOnly](docs/Model/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/Model/HealthCheckResult.md) + - [InlineObject](docs/Model/InlineObject.md) + - [InlineObject1](docs/Model/InlineObject1.md) + - [InlineObject2](docs/Model/InlineObject2.md) + - [InlineObject3](docs/Model/InlineObject3.md) + - [InlineObject4](docs/Model/InlineObject4.md) + - [InlineObject5](docs/Model/InlineObject5.md) + - [InlineResponseDefault](docs/Model/InlineResponseDefault.md) - [MapTest](docs/Model/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model/Model200Response.md) - [ModelList](docs/Model/ModelList.md) - [ModelReturn](docs/Model/ModelReturn.md) - [Name](docs/Model/Name.md) + - [NullableClass](docs/Model/NullableClass.md) - [NumberOnly](docs/Model/NumberOnly.md) - [Order](docs/Model/Order.md) - [OuterComposite](docs/Model/OuterComposite.md) - [OuterEnum](docs/Model/OuterEnum.md) + - [OuterEnumDefaultValue](docs/Model/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/Model/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/Model/OuterEnumIntegerDefaultValue.md) - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) - - [TypeHolderDefault](docs/Model/TypeHolderDefault.md) - - [TypeHolderExample](docs/Model/TypeHolderExample.md) - [User](docs/Model/User.md) - - [XmlItem](docs/Model/XmlItem.md) ## Documentation For Authorization @@ -198,6 +201,13 @@ Class | Method | HTTP request | Description +## bearer_test + + +- **Type**: Bearer authentication (JWT) + + + ## http_basic_test @@ -205,6 +215,11 @@ Class | Method | HTTP request | Description +## http_signature_test + + + + ## petstore_auth diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md index 1667501c465..1ff76b69457 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## call123TestSpecialTags -> \OpenAPI\Client\Model\Client call123TestSpecialTags($body) +> \OpenAPI\Client\Model\Client call123TestSpecialTags($client) To test special tags @@ -28,10 +28,10 @@ $apiInstance = new OpenAPI\Client\Api\AnotherFakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model +$client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->call123TestSpecialTags($body); + $result = $apiInstance->call123TestSpecialTags($client); print_r($result); } catch (Exception $e) { echo 'Exception when calling AnotherFakeApi->call123TestSpecialTags: ', $e->getMessage(), PHP_EOL; @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | + **client** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md index 6696bd33785..eff99ef159d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md @@ -7,16 +7,20 @@ Method | HTTP request | Description [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | -# **fooGet** + +## fooGet + > \OpenAPI\Client\Model\InlineResponseDefault fooGet() ### Example + ```php createXmlItem($xml_item) +> \OpenAPI\Client\Model\HealthCheckResult fakeHealthGet() -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example @@ -41,12 +40,67 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$xml_item = new \OpenAPI\Client\Model\XmlItem(); // \OpenAPI\Client\Model\XmlItem | XmlItem Body try { - $apiInstance->createXmlItem($xml_item); + $result = $apiInstance->fakeHealthGet(); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling FakeApi->createXmlItem: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FakeApi->fakeHealthGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OpenAPI\Client\Model\HealthCheckResult**](../Model/HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest($pet, $query_1, $header_1) + +test http signature authentication + +### Example + +```php +fakeHttpSignatureTest($pet, $query_1, $header_1); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeHttpSignatureTest: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -56,7 +110,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**\OpenAPI\Client\Model\XmlItem**](../Model/XmlItem.md)| XmlItem Body | + **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | + **query_1** | **string**| query parameter | [optional] + **header_1** | **string**| header parameter | [optional] ### Return type @@ -64,11 +120,11 @@ void (empty response body) ### Authorization -No authorization required +[http_signature_test](../../README.md#http_signature_test) ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Content-Type**: application/json, application/xml - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -124,7 +180,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -134,7 +190,7 @@ No authorization required ## fakeOuterCompositeSerialize -> \OpenAPI\Client\Model\OuterComposite fakeOuterCompositeSerialize($body) +> \OpenAPI\Client\Model\OuterComposite fakeOuterCompositeSerialize($outer_composite) @@ -152,10 +208,10 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\OuterComposite(); // \OpenAPI\Client\Model\OuterComposite | Input composite as post body +$outer_composite = new \OpenAPI\Client\Model\OuterComposite(); // \OpenAPI\Client\Model\OuterComposite | Input composite as post body try { - $result = $apiInstance->fakeOuterCompositeSerialize($body); + $result = $apiInstance->fakeOuterCompositeSerialize($outer_composite); print_r($result); } catch (Exception $e) { echo 'Exception when calling FakeApi->fakeOuterCompositeSerialize: ', $e->getMessage(), PHP_EOL; @@ -168,7 +224,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\OuterComposite**](../Model/OuterComposite.md)| Input composite as post body | [optional] + **outer_composite** | [**\OpenAPI\Client\Model\OuterComposite**](../Model/OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -180,7 +236,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -236,7 +292,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -292,7 +348,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -302,7 +358,7 @@ No authorization required ## testBodyWithFileSchema -> testBodyWithFileSchema($body) +> testBodyWithFileSchema($file_schema_test_class) @@ -320,10 +376,10 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\FileSchemaTestClass(); // \OpenAPI\Client\Model\FileSchemaTestClass | +$file_schema_test_class = new \OpenAPI\Client\Model\FileSchemaTestClass(); // \OpenAPI\Client\Model\FileSchemaTestClass | try { - $apiInstance->testBodyWithFileSchema($body); + $apiInstance->testBodyWithFileSchema($file_schema_test_class); } catch (Exception $e) { echo 'Exception when calling FakeApi->testBodyWithFileSchema: ', $e->getMessage(), PHP_EOL; } @@ -335,7 +391,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\FileSchemaTestClass**](../Model/FileSchemaTestClass.md)| | + **file_schema_test_class** | [**\OpenAPI\Client\Model\FileSchemaTestClass**](../Model/FileSchemaTestClass.md)| | ### Return type @@ -357,7 +413,7 @@ No authorization required ## testBodyWithQueryParams -> testBodyWithQueryParams($query, $body) +> testBodyWithQueryParams($query, $user) @@ -374,10 +430,10 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( new GuzzleHttp\Client() ); $query = 'query_example'; // string | -$body = new \OpenAPI\Client\Model\User(); // \OpenAPI\Client\Model\User | +$user = new \OpenAPI\Client\Model\User(); // \OpenAPI\Client\Model\User | try { - $apiInstance->testBodyWithQueryParams($query, $body); + $apiInstance->testBodyWithQueryParams($query, $user); } catch (Exception $e) { echo 'Exception when calling FakeApi->testBodyWithQueryParams: ', $e->getMessage(), PHP_EOL; } @@ -390,7 +446,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | - **body** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| | + **user** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| | ### Return type @@ -412,7 +468,7 @@ No authorization required ## testClientModel -> \OpenAPI\Client\Model\Client testClientModel($body) +> \OpenAPI\Client\Model\Client testClientModel($client) To test \"client\" model @@ -430,10 +486,10 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model +$client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->testClientModel($body); + $result = $apiInstance->testClientModel($client); print_r($result); } catch (Exception $e) { echo 'Exception when calling FakeApi->testClientModel: ', $e->getMessage(), PHP_EOL; @@ -446,7 +502,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | + **client** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | ### Return type @@ -470,9 +526,9 @@ No authorization required > testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -638,10 +694,15 @@ Fake endpoint to test group parameters (optional) require_once(__DIR__ . '/vendor/autoload.php'); +// Configure Bearer (JWT) authorization: bearer_test +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + + $apiInstance = new OpenAPI\Client\Api\FakeApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); $associate_array['required_string_group'] = 56; // int | Required String in group parameters $associate_array['required_boolean_group'] = True; // bool | Required Boolean in group parameters @@ -678,7 +739,7 @@ void (empty response body) ### Authorization -No authorization required +[bearer_test](../../README.md#bearer_test) ### HTTP request headers @@ -692,7 +753,7 @@ No authorization required ## testInlineAdditionalProperties -> testInlineAdditionalProperties($param) +> testInlineAdditionalProperties($request_body) test inline additionalProperties @@ -708,10 +769,10 @@ $apiInstance = new OpenAPI\Client\Api\FakeApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$param = array('key' => 'param_example'); // map[string,string] | request body +$request_body = array('key' => 'request_body_example'); // map[string,string] | request body try { - $apiInstance->testInlineAdditionalProperties($param); + $apiInstance->testInlineAdditionalProperties($request_body); } catch (Exception $e) { echo 'Exception when calling FakeApi->testInlineAdditionalProperties: ', $e->getMessage(), PHP_EOL; } @@ -723,7 +784,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**map[string,string]**](../Model/string.md)| request body | + **request_body** | [**map[string,string]**](../Model/string.md)| request body | ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md index 5a1316267b1..3faeaf3043a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## testClassname -> \OpenAPI\Client\Model\Client testClassname($body) +> \OpenAPI\Client\Model\Client testClassname($client) To test class name in snake case @@ -35,10 +35,10 @@ $apiInstance = new OpenAPI\Client\Api\FakeClassnameTags123Api( new GuzzleHttp\Client(), $config ); -$body = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model +$client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model try { - $result = $apiInstance->testClassname($body); + $result = $apiInstance->testClassname($client); print_r($result); } catch (Exception $e) { echo 'Exception when calling FakeClassnameTags123Api->testClassname: ', $e->getMessage(), PHP_EOL; @@ -51,7 +51,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | + **client** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md index 28f4103e52f..d96e2f2fb9b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description ## addPet -> addPet($body) +> addPet($pet) Add a new pet to the store @@ -39,10 +39,10 @@ $apiInstance = new OpenAPI\Client\Api\PetApi( new GuzzleHttp\Client(), $config ); -$body = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store +$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store try { - $apiInstance->addPet($body); + $apiInstance->addPet($pet); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } @@ -54,7 +54,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | + **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -321,7 +321,7 @@ Name | Type | Description | Notes ## updatePet -> updatePet($body) +> updatePet($pet) Update an existing pet @@ -342,10 +342,10 @@ $apiInstance = new OpenAPI\Client\Api\PetApi( new GuzzleHttp\Client(), $config ); -$body = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store +$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store try { - $apiInstance->updatePet($body); + $apiInstance->updatePet($pet); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } @@ -357,7 +357,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | + **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md index 8643062bd21..318f68c2c6a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md @@ -183,7 +183,7 @@ No authorization required ## placeOrder -> \OpenAPI\Client\Model\Order placeOrder($body) +> \OpenAPI\Client\Model\Order placeOrder($order) Place an order for a pet @@ -199,10 +199,10 @@ $apiInstance = new OpenAPI\Client\Api\StoreApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\Order(); // \OpenAPI\Client\Model\Order | order placed for purchasing the pet +$order = new \OpenAPI\Client\Model\Order(); // \OpenAPI\Client\Model\Order | order placed for purchasing the pet try { - $result = $apiInstance->placeOrder($body); + $result = $apiInstance->placeOrder($order); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; @@ -215,7 +215,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\Order**](../Model/Order.md)| order placed for purchasing the pet | + **order** | [**\OpenAPI\Client\Model\Order**](../Model/Order.md)| order placed for purchasing the pet | ### Return type @@ -227,7 +227,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md index 7cb382f9c17..0784a164518 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## createUser -> createUser($body) +> createUser($user) Create user @@ -35,10 +35,10 @@ $apiInstance = new OpenAPI\Client\Api\UserApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = new \OpenAPI\Client\Model\User(); // \OpenAPI\Client\Model\User | Created user object +$user = new \OpenAPI\Client\Model\User(); // \OpenAPI\Client\Model\User | Created user object try { - $apiInstance->createUser($body); + $apiInstance->createUser($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } @@ -50,7 +50,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| Created user object | + **user** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| Created user object | ### Return type @@ -62,7 +62,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -72,7 +72,7 @@ No authorization required ## createUsersWithArrayInput -> createUsersWithArrayInput($body) +> createUsersWithArrayInput($user) Creates list of users with given input array @@ -88,10 +88,10 @@ $apiInstance = new OpenAPI\Client\Api\UserApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object +$user = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object try { - $apiInstance->createUsersWithArrayInput($body); + $apiInstance->createUsersWithArrayInput($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } @@ -103,7 +103,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object | + **user** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object | ### Return type @@ -115,7 +115,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -125,7 +125,7 @@ No authorization required ## createUsersWithListInput -> createUsersWithListInput($body) +> createUsersWithListInput($user) Creates list of users with given input array @@ -141,10 +141,10 @@ $apiInstance = new OpenAPI\Client\Api\UserApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$body = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object +$user = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object try { - $apiInstance->createUsersWithListInput($body); + $apiInstance->createUsersWithListInput($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } @@ -156,7 +156,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object | + **user** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object | ### Return type @@ -168,7 +168,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) @@ -392,7 +392,7 @@ No authorization required ## updateUser -> updateUser($username, $body) +> updateUser($username, $user) Updated user @@ -411,10 +411,10 @@ $apiInstance = new OpenAPI\Client\Api\UserApi( new GuzzleHttp\Client() ); $username = 'username_example'; // string | name that need to be deleted -$body = new \OpenAPI\Client\Model\User(); // \OpenAPI\Client\Model\User | Updated user object +$user = new \OpenAPI\Client\Model\User(); // \OpenAPI\Client\Model\User | Updated user object try { - $apiInstance->updateUser($username, $body); + $apiInstance->updateUser($username, $user); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } @@ -427,7 +427,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| Updated user object | + **user** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| Updated user object | ### Return type @@ -439,7 +439,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md index fc9b2c66e81..8c2be69f694 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md @@ -4,17 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_string** | **map[string,string]** | | [optional] -**map_number** | **map[string,float]** | | [optional] -**map_integer** | **map[string,int]** | | [optional] -**map_boolean** | **map[string,bool]** | | [optional] -**map_array_integer** | [**map[string,int[]]**](array.md) | | [optional] -**map_array_anytype** | [**map[string,object[]]**](array.md) | | [optional] -**map_map_string** | [**map[string,map[string,string]]**](map.md) | | [optional] -**map_map_anytype** | [**map[string,map[string,object]]**](map.md) | | [optional] -**anytype_1** | **object** | | [optional] -**anytype_2** | **object** | | [optional] -**anytype_3** | **object** | | [optional] +**map_property** | **map[string,string]** | | [optional] +**map_of_map_property** | [**map[string,map[string,string]]**](map.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md index 5656aa6170c..9a1ffa8a7e3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md @@ -9,6 +9,9 @@ Name | Type | Description | Notes **enum_integer** | **int** | | [optional] **enum_number** | **double** | | [optional] **outer_enum** | [**\OpenAPI\Client\Model\OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**\OpenAPI\Client\Model\OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**\OpenAPI\Client\Model\OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**\OpenAPI\Client\Model\OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md index ee5ddff7206..9acc83cb6fa 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md @@ -1,10 +1,11 @@ -# Foo +# # Foo ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **string** | | [optional] [default to 'bar'] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md index 263f5b985cb..b0b8785234a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **date_time** | [**\DateTime**](\DateTime.md) | | [optional] **uuid** | **string** | | [optional] **password** | **string** | | -**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional] +**pattern_with_digits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/HealthCheckResult.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/HealthCheckResult.md rename to samples/client/petstore/php/OpenAPIClient-php/docs/Model/HealthCheckResult.md diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md index 101275879be..b21b3c6d887 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md @@ -1,11 +1,12 @@ -# InlineObject +# # InlineObject ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Updated name of the pet | [optional] **status** | **string** | Updated status of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md index dc428e8ea6c..25eb866417b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md @@ -1,11 +1,12 @@ -# InlineObject1 +# # InlineObject1 ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **additional_metadata** | **string** | Additional data to pass to server | [optional] **file** | [**\SplFileObject**](\SplFileObject.md) | file to upload | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md index 7e2ee7c9570..a862611a011 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md @@ -1,11 +1,12 @@ -# InlineObject2 +# # InlineObject2 ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_form_string_array** | **string[]** | Form parameter enum test (string array) | [optional] **enum_form_string** | **string** | Form parameter enum test (string) | [optional] [default to '-efg'] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md index cef75b28262..8cd0a80c044 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md @@ -1,6 +1,7 @@ -# InlineObject3 +# # InlineObject3 ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **integer** | **int** | None | [optional] @@ -18,6 +19,6 @@ Name | Type | Description | Notes **password** | **string** | None | [optional] **callback** | **string** | None | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md index 6675b7f47ce..6a940e80aca 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md @@ -1,11 +1,12 @@ -# InlineObject4 +# # InlineObject4 ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **param** | **string** | field1 | **param2** | **string** | field2 | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md index d1d27f7cc65..240eb36860c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md @@ -1,11 +1,12 @@ -# InlineObject5 +# # InlineObject5 ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **additional_metadata** | **string** | Additional data to pass to server | [optional] **required_file** | [**\SplFileObject**](\SplFileObject.md) | file to upload | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md index 9f25c169f64..a00c3247962 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md @@ -1,10 +1,11 @@ -# InlineResponseDefault +# # InlineResponseDefault ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string** | [**\OpenAPI\Client\Model\Foo**](Foo.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/NullableClass.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/NullableClass.md rename to samples/client/petstore/php/OpenAPIClient-php/docs/Model/NullableClass.md diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumDefaultValue.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumDefaultValue.md rename to samples/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumInteger.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumInteger.md rename to samples/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 2902a8e1c9f..ecceb4cdc12 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -120,15 +120,15 @@ class AnotherFakeApi * * To test special tags * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function call123TestSpecialTags($body) + public function call123TestSpecialTags($client) { - list($response) = $this->call123TestSpecialTagsWithHttpInfo($body); + list($response) = $this->call123TestSpecialTagsWithHttpInfo($client); return $response; } @@ -137,15 +137,15 @@ class AnotherFakeApi * * To test special tags * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function call123TestSpecialTagsWithHttpInfo($body) + public function call123TestSpecialTagsWithHttpInfo($client) { - $request = $this->call123TestSpecialTagsRequest($body); + $request = $this->call123TestSpecialTagsRequest($client); try { $options = $this->createHttpClientOption(); @@ -225,14 +225,14 @@ class AnotherFakeApi * * To test special tags * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function call123TestSpecialTagsAsync($body) + public function call123TestSpecialTagsAsync($client) { - return $this->call123TestSpecialTagsAsyncWithHttpInfo($body) + return $this->call123TestSpecialTagsAsyncWithHttpInfo($client) ->then( function ($response) { return $response[0]; @@ -245,15 +245,15 @@ class AnotherFakeApi * * To test special tags * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function call123TestSpecialTagsAsyncWithHttpInfo($body) + public function call123TestSpecialTagsAsyncWithHttpInfo($client) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->call123TestSpecialTagsRequest($body); + $request = $this->call123TestSpecialTagsRequest($client); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -292,17 +292,17 @@ class AnotherFakeApi /** * Create request for operation 'call123TestSpecialTags' * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function call123TestSpecialTagsRequest($body) + protected function call123TestSpecialTagsRequest($client) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'client' is set + if ($client === null || (is_array($client) && count($client) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling call123TestSpecialTags' + 'Missing the required parameter $client when calling call123TestSpecialTags' ); } @@ -318,8 +318,8 @@ class AnotherFakeApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($client)) { + $_tempBody = $client; } if ($multipart) { diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 8970a606e0a..5c6d9819d6d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -116,35 +116,34 @@ class FakeApi } /** - * Operation createXmlItem + * Operation fakeHealthGet * - * creates an XmlItem + * Health check endpoint * - * @param \OpenAPI\Client\Model\XmlItem $xml_item XmlItem Body (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \OpenAPI\Client\Model\HealthCheckResult */ - public function createXmlItem($xml_item) + public function fakeHealthGet() { - $this->createXmlItemWithHttpInfo($xml_item); + list($response) = $this->fakeHealthGetWithHttpInfo(); + return $response; } /** - * Operation createXmlItemWithHttpInfo + * Operation fakeHealthGetWithHttpInfo * - * creates an XmlItem + * Health check endpoint * - * @param \OpenAPI\Client\Model\XmlItem $xml_item XmlItem Body (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\HealthCheckResult, HTTP status code, HTTP response headers (array of strings) */ - public function createXmlItemWithHttpInfo($xml_item) + public function fakeHealthGetWithHttpInfo() { - $request = $this->createXmlItemRequest($xml_item); + $request = $this->fakeHealthGetRequest(); try { $options = $this->createHttpClientOption(); @@ -174,28 +173,63 @@ class FakeApi ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\HealthCheckResult' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\HealthCheckResult', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\HealthCheckResult'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\HealthCheckResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation createXmlItemAsync + * Operation fakeHealthGetAsync * - * creates an XmlItem + * Health check endpoint * - * @param \OpenAPI\Client\Model\XmlItem $xml_item XmlItem Body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createXmlItemAsync($xml_item) + public function fakeHealthGetAsync() { - return $this->createXmlItemAsyncWithHttpInfo($xml_item) + return $this->fakeHealthGetAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -204,25 +238,35 @@ class FakeApi } /** - * Operation createXmlItemAsyncWithHttpInfo + * Operation fakeHealthGetAsyncWithHttpInfo * - * creates an XmlItem + * Health check endpoint * - * @param \OpenAPI\Client\Model\XmlItem $xml_item XmlItem Body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createXmlItemAsyncWithHttpInfo($xml_item) + public function fakeHealthGetAsyncWithHttpInfo() { - $returnType = ''; - $request = $this->createXmlItemRequest($xml_item); + $returnType = '\OpenAPI\Client\Model\HealthCheckResult'; + $request = $this->fakeHealthGetRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -242,23 +286,16 @@ class FakeApi } /** - * Create request for operation 'createXmlItem' + * Create request for operation 'fakeHealthGet' * - * @param \OpenAPI\Client\Model\XmlItem $xml_item XmlItem Body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createXmlItemRequest($xml_item) + protected function fakeHealthGetRequest() { - // verify the required parameter 'xml_item' is set - if ($xml_item === null || (is_array($xml_item) && count($xml_item) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $xml_item when calling createXmlItem' - ); - } - $resourcePath = '/fake/create_xml_item'; + $resourcePath = '/fake/health'; $formParams = []; $queryParams = []; $headerParams = []; @@ -270,18 +307,15 @@ class FakeApi // body params $_tempBody = null; - if (isset($xml_item)) { - $_tempBody = $xml_item; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - [] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - [], - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16'] + ['application/json'], + [] ); } @@ -328,7 +362,252 @@ class FakeApi $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation fakeHttpSignatureTest + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null) + { + $this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1); + } + + /** + * Operation fakeHttpSignatureTestWithHttpInfo + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header_1 = null) + { + $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation fakeHttpSignatureTestAsync + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fakeHttpSignatureTestAsync($pet, $query_1 = null, $header_1 = null) + { + return $this->fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1, $header_1) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fakeHttpSignatureTestAsyncWithHttpInfo + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null) + { + $returnType = ''; + $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fakeHttpSignatureTest' + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null) + { + // verify the required parameter 'pet' is set + if ($pet === null || (is_array($pet) && count($pet) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pet when calling fakeHttpSignatureTest' + ); + } + + $resourcePath = '/fake/http-signature-test'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($query_1 !== null) { + if('form' === 'form' && is_array($query_1)) { + foreach($query_1 as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['query_1'] = $query_1; + } + } + + // header params + if ($header_1 !== null) { + $headerParams['header_1'] = ObjectSerializer::toHeaderValue($header_1); + } + + + // body params + $_tempBody = null; + if (isset($pet)) { + $_tempBody = $pet; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json', 'application/xml'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -539,7 +818,7 @@ class FakeApi } else { $headers = $this->headerSelector->selectHeaders( ['*/*'], - [] + ['application/json'] ); } @@ -596,30 +875,30 @@ class FakeApi /** * Operation fakeOuterCompositeSerialize * - * @param \OpenAPI\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OuterComposite */ - public function fakeOuterCompositeSerialize($body = null) + public function fakeOuterCompositeSerialize($outer_composite = null) { - list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($body); + list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($outer_composite); return $response; } /** * Operation fakeOuterCompositeSerializeWithHttpInfo * - * @param \OpenAPI\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterCompositeSerializeWithHttpInfo($body = null) + public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) { - $request = $this->fakeOuterCompositeSerializeRequest($body); + $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); try { $options = $this->createHttpClientOption(); @@ -699,14 +978,14 @@ class FakeApi * * * - * @param \OpenAPI\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterCompositeSerializeAsync($body = null) + public function fakeOuterCompositeSerializeAsync($outer_composite = null) { - return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($body) + return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite) ->then( function ($response) { return $response[0]; @@ -719,15 +998,15 @@ class FakeApi * * * - * @param \OpenAPI\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterCompositeSerializeAsyncWithHttpInfo($body = null) + public function fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite = null) { $returnType = '\OpenAPI\Client\Model\OuterComposite'; - $request = $this->fakeOuterCompositeSerializeRequest($body); + $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -766,12 +1045,12 @@ class FakeApi /** * Create request for operation 'fakeOuterCompositeSerialize' * - * @param \OpenAPI\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fakeOuterCompositeSerializeRequest($body = null) + protected function fakeOuterCompositeSerializeRequest($outer_composite = null) { $resourcePath = '/fake/outer/composite'; @@ -786,8 +1065,8 @@ class FakeApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($outer_composite)) { + $_tempBody = $outer_composite; } if ($multipart) { @@ -797,7 +1076,7 @@ class FakeApi } else { $headers = $this->headerSelector->selectHeaders( ['*/*'], - [] + ['application/json'] ); } @@ -1055,7 +1334,7 @@ class FakeApi } else { $headers = $this->headerSelector->selectHeaders( ['*/*'], - [] + ['application/json'] ); } @@ -1313,7 +1592,7 @@ class FakeApi } else { $headers = $this->headerSelector->selectHeaders( ['*/*'], - [] + ['application/json'] ); } @@ -1370,29 +1649,29 @@ class FakeApi /** * Operation testBodyWithFileSchema * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $body body (required) + * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class file_schema_test_class (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testBodyWithFileSchema($body) + public function testBodyWithFileSchema($file_schema_test_class) { - $this->testBodyWithFileSchemaWithHttpInfo($body); + $this->testBodyWithFileSchemaWithHttpInfo($file_schema_test_class); } /** * Operation testBodyWithFileSchemaWithHttpInfo * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $body (required) + * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testBodyWithFileSchemaWithHttpInfo($body) + public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) { - $request = $this->testBodyWithFileSchemaRequest($body); + $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); try { $options = $this->createHttpClientOption(); @@ -1436,14 +1715,14 @@ class FakeApi * * * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $body (required) + * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithFileSchemaAsync($body) + public function testBodyWithFileSchemaAsync($file_schema_test_class) { - return $this->testBodyWithFileSchemaAsyncWithHttpInfo($body) + return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) ->then( function ($response) { return $response[0]; @@ -1456,15 +1735,15 @@ class FakeApi * * * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $body (required) + * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithFileSchemaAsyncWithHttpInfo($body) + public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) { $returnType = ''; - $request = $this->testBodyWithFileSchemaRequest($body); + $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1492,17 +1771,17 @@ class FakeApi /** * Create request for operation 'testBodyWithFileSchema' * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $body (required) + * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testBodyWithFileSchemaRequest($body) + protected function testBodyWithFileSchemaRequest($file_schema_test_class) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'file_schema_test_class' is set + if ($file_schema_test_class === null || (is_array($file_schema_test_class) && count($file_schema_test_class) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling testBodyWithFileSchema' + 'Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema' ); } @@ -1518,8 +1797,8 @@ class FakeApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($file_schema_test_class)) { + $_tempBody = $file_schema_test_class; } if ($multipart) { @@ -1587,30 +1866,30 @@ class FakeApi * Operation testBodyWithQueryParams * * @param string $query query (required) - * @param \OpenAPI\Client\Model\User $body body (required) + * @param \OpenAPI\Client\Model\User $user user (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testBodyWithQueryParams($query, $body) + public function testBodyWithQueryParams($query, $user) { - $this->testBodyWithQueryParamsWithHttpInfo($query, $body); + $this->testBodyWithQueryParamsWithHttpInfo($query, $user); } /** * Operation testBodyWithQueryParamsWithHttpInfo * * @param string $query (required) - * @param \OpenAPI\Client\Model\User $body (required) + * @param \OpenAPI\Client\Model\User $user (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testBodyWithQueryParamsWithHttpInfo($query, $body) + public function testBodyWithQueryParamsWithHttpInfo($query, $user) { - $request = $this->testBodyWithQueryParamsRequest($query, $body); + $request = $this->testBodyWithQueryParamsRequest($query, $user); try { $options = $this->createHttpClientOption(); @@ -1655,14 +1934,14 @@ class FakeApi * * * @param string $query (required) - * @param \OpenAPI\Client\Model\User $body (required) + * @param \OpenAPI\Client\Model\User $user (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithQueryParamsAsync($query, $body) + public function testBodyWithQueryParamsAsync($query, $user) { - return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $body) + return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) ->then( function ($response) { return $response[0]; @@ -1676,15 +1955,15 @@ class FakeApi * * * @param string $query (required) - * @param \OpenAPI\Client\Model\User $body (required) + * @param \OpenAPI\Client\Model\User $user (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $body) + public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) { $returnType = ''; - $request = $this->testBodyWithQueryParamsRequest($query, $body); + $request = $this->testBodyWithQueryParamsRequest($query, $user); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1713,12 +1992,12 @@ class FakeApi * Create request for operation 'testBodyWithQueryParams' * * @param string $query (required) - * @param \OpenAPI\Client\Model\User $body (required) + * @param \OpenAPI\Client\Model\User $user (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testBodyWithQueryParamsRequest($query, $body) + protected function testBodyWithQueryParamsRequest($query, $user) { // verify the required parameter 'query' is set if ($query === null || (is_array($query) && count($query) === 0)) { @@ -1726,10 +2005,10 @@ class FakeApi 'Missing the required parameter $query when calling testBodyWithQueryParams' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'user' is set + if ($user === null || (is_array($user) && count($user) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling testBodyWithQueryParams' + 'Missing the required parameter $user when calling testBodyWithQueryParams' ); } @@ -1741,19 +2020,23 @@ class FakeApi $multipart = false; // query params - if (is_array($query)) { - $query = ObjectSerializer::serializeCollection($query, '', true); - } if ($query !== null) { - $queryParams['query'] = $query; + if('form' === 'form' && is_array($query)) { + foreach($query as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['query'] = $query; + } } // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($user)) { + $_tempBody = $user; } if ($multipart) { @@ -1822,15 +2105,15 @@ class FakeApi * * To test \"client\" model * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function testClientModel($body) + public function testClientModel($client) { - list($response) = $this->testClientModelWithHttpInfo($body); + list($response) = $this->testClientModelWithHttpInfo($client); return $response; } @@ -1839,15 +2122,15 @@ class FakeApi * * To test \"client\" model * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function testClientModelWithHttpInfo($body) + public function testClientModelWithHttpInfo($client) { - $request = $this->testClientModelRequest($body); + $request = $this->testClientModelRequest($client); try { $options = $this->createHttpClientOption(); @@ -1927,14 +2210,14 @@ class FakeApi * * To test \"client\" model * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClientModelAsync($body) + public function testClientModelAsync($client) { - return $this->testClientModelAsyncWithHttpInfo($body) + return $this->testClientModelAsyncWithHttpInfo($client) ->then( function ($response) { return $response[0]; @@ -1947,15 +2230,15 @@ class FakeApi * * To test \"client\" model * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClientModelAsyncWithHttpInfo($body) + public function testClientModelAsyncWithHttpInfo($client) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testClientModelRequest($body); + $request = $this->testClientModelRequest($client); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1994,17 +2277,17 @@ class FakeApi /** * Create request for operation 'testClientModel' * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testClientModelRequest($body) + protected function testClientModelRequest($client) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'client' is set + if ($client === null || (is_array($client) && count($client) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling testClientModel' + 'Missing the required parameter $client when calling testClientModel' ); } @@ -2020,8 +2303,8 @@ class FakeApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($client)) { + $_tempBody = $client; } if ($multipart) { @@ -2088,7 +2371,7 @@ class FakeApi /** * Operation testEndpointParameters * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * * @param float $number None (required) * @param double $double None (required) @@ -2117,7 +2400,7 @@ class FakeApi /** * Operation testEndpointParametersWithHttpInfo * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * * @param float $number None (required) * @param double $double None (required) @@ -2182,7 +2465,7 @@ class FakeApi /** * Operation testEndpointParametersAsync * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * * @param float $number None (required) * @param double $double None (required) @@ -2215,7 +2498,7 @@ class FakeApi /** * Operation testEndpointParametersAsyncWithHttpInfo * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * * @param float $number None (required) * @param double $double None (required) @@ -2673,32 +2956,48 @@ class FakeApi $multipart = false; // query params - if (is_array($enum_query_string_array)) { - $enum_query_string_array = ObjectSerializer::serializeCollection($enum_query_string_array, 'form', true); - } if ($enum_query_string_array !== null) { - $queryParams['enum_query_string_array'] = $enum_query_string_array; + if('form' === 'form' && is_array($enum_query_string_array)) { + foreach($enum_query_string_array as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['enum_query_string_array'] = $enum_query_string_array; + } } // query params - if (is_array($enum_query_string)) { - $enum_query_string = ObjectSerializer::serializeCollection($enum_query_string, '', true); - } if ($enum_query_string !== null) { - $queryParams['enum_query_string'] = $enum_query_string; + if('form' === 'form' && is_array($enum_query_string)) { + foreach($enum_query_string as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['enum_query_string'] = $enum_query_string; + } } // query params - if (is_array($enum_query_integer)) { - $enum_query_integer = ObjectSerializer::serializeCollection($enum_query_integer, '', true); - } if ($enum_query_integer !== null) { - $queryParams['enum_query_integer'] = $enum_query_integer; + if('form' === 'form' && is_array($enum_query_integer)) { + foreach($enum_query_integer as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['enum_query_integer'] = $enum_query_integer; + } } // query params - if (is_array($enum_query_double)) { - $enum_query_double = ObjectSerializer::serializeCollection($enum_query_double, '', true); - } if ($enum_query_double !== null) { - $queryParams['enum_query_double'] = $enum_query_double; + if('form' === 'form' && is_array($enum_query_double)) { + foreach($enum_query_double as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['enum_query_double'] = $enum_query_double; + } } // header params @@ -2992,32 +3291,48 @@ class FakeApi $multipart = false; // query params - if (is_array($required_string_group)) { - $required_string_group = ObjectSerializer::serializeCollection($required_string_group, '', true); - } if ($required_string_group !== null) { - $queryParams['required_string_group'] = $required_string_group; + if('form' === 'form' && is_array($required_string_group)) { + foreach($required_string_group as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['required_string_group'] = $required_string_group; + } } // query params - if (is_array($required_int64_group)) { - $required_int64_group = ObjectSerializer::serializeCollection($required_int64_group, '', true); - } if ($required_int64_group !== null) { - $queryParams['required_int64_group'] = $required_int64_group; + if('form' === 'form' && is_array($required_int64_group)) { + foreach($required_int64_group as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['required_int64_group'] = $required_int64_group; + } } // query params - if (is_array($string_group)) { - $string_group = ObjectSerializer::serializeCollection($string_group, '', true); - } if ($string_group !== null) { - $queryParams['string_group'] = $string_group; + if('form' === 'form' && is_array($string_group)) { + foreach($string_group as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['string_group'] = $string_group; + } } // query params - if (is_array($int64_group)) { - $int64_group = ObjectSerializer::serializeCollection($int64_group, '', true); - } if ($int64_group !== null) { - $queryParams['int64_group'] = $int64_group; + if('form' === 'form' && is_array($int64_group)) { + foreach($int64_group as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['int64_group'] = $int64_group; + } } // header params @@ -3073,6 +3388,10 @@ class FakeApi } } + // this endpoint requires Bearer (JWT) authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3099,15 +3418,15 @@ class FakeApi * * test inline additionalProperties * - * @param map[string,string] $param request body (required) + * @param map[string,string] $request_body request body (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testInlineAdditionalProperties($param) + public function testInlineAdditionalProperties($request_body) { - $this->testInlineAdditionalPropertiesWithHttpInfo($param); + $this->testInlineAdditionalPropertiesWithHttpInfo($request_body); } /** @@ -3115,15 +3434,15 @@ class FakeApi * * test inline additionalProperties * - * @param map[string,string] $param request body (required) + * @param map[string,string] $request_body request body (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testInlineAdditionalPropertiesWithHttpInfo($param) + public function testInlineAdditionalPropertiesWithHttpInfo($request_body) { - $request = $this->testInlineAdditionalPropertiesRequest($param); + $request = $this->testInlineAdditionalPropertiesRequest($request_body); try { $options = $this->createHttpClientOption(); @@ -3167,14 +3486,14 @@ class FakeApi * * test inline additionalProperties * - * @param map[string,string] $param request body (required) + * @param map[string,string] $request_body request body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testInlineAdditionalPropertiesAsync($param) + public function testInlineAdditionalPropertiesAsync($request_body) { - return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($param) + return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) ->then( function ($response) { return $response[0]; @@ -3187,15 +3506,15 @@ class FakeApi * * test inline additionalProperties * - * @param map[string,string] $param request body (required) + * @param map[string,string] $request_body request body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testInlineAdditionalPropertiesAsyncWithHttpInfo($param) + public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) { $returnType = ''; - $request = $this->testInlineAdditionalPropertiesRequest($param); + $request = $this->testInlineAdditionalPropertiesRequest($request_body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3223,17 +3542,17 @@ class FakeApi /** * Create request for operation 'testInlineAdditionalProperties' * - * @param map[string,string] $param request body (required) + * @param map[string,string] $request_body request body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testInlineAdditionalPropertiesRequest($param) + protected function testInlineAdditionalPropertiesRequest($request_body) { - // verify the required parameter 'param' is set - if ($param === null || (is_array($param) && count($param) === 0)) { + // verify the required parameter 'request_body' is set + if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $param when calling testInlineAdditionalProperties' + 'Missing the required parameter $request_body when calling testInlineAdditionalProperties' ); } @@ -3249,8 +3568,8 @@ class FakeApi // body params $_tempBody = null; - if (isset($param)) { - $_tempBody = $param; + if (isset($request_body)) { + $_tempBody = $request_body; } if ($multipart) { @@ -3741,15 +4060,19 @@ class FakeApi $multipart = false; // query params - if (is_array($pipe)) { - $pipe = ObjectSerializer::serializeCollection($pipe, 'form', true); - } if ($pipe !== null) { - $queryParams['pipe'] = $pipe; + if('form' === 'form' && is_array($pipe)) { + foreach($pipe as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['pipe'] = $pipe; + } } // query params if (is_array($ioutil)) { - $ioutil = ObjectSerializer::serializeCollection($ioutil, 'csv', true); + $ioutil = ObjectSerializer::serializeCollection($ioutil, 'form', true); } if ($ioutil !== null) { $queryParams['ioutil'] = $ioutil; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 461343190a4..cc37aa252bc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -120,15 +120,15 @@ class FakeClassnameTags123Api * * To test class name in snake case * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function testClassname($body) + public function testClassname($client) { - list($response) = $this->testClassnameWithHttpInfo($body); + list($response) = $this->testClassnameWithHttpInfo($client); return $response; } @@ -137,15 +137,15 @@ class FakeClassnameTags123Api * * To test class name in snake case * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function testClassnameWithHttpInfo($body) + public function testClassnameWithHttpInfo($client) { - $request = $this->testClassnameRequest($body); + $request = $this->testClassnameRequest($client); try { $options = $this->createHttpClientOption(); @@ -225,14 +225,14 @@ class FakeClassnameTags123Api * * To test class name in snake case * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClassnameAsync($body) + public function testClassnameAsync($client) { - return $this->testClassnameAsyncWithHttpInfo($body) + return $this->testClassnameAsyncWithHttpInfo($client) ->then( function ($response) { return $response[0]; @@ -245,15 +245,15 @@ class FakeClassnameTags123Api * * To test class name in snake case * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClassnameAsyncWithHttpInfo($body) + public function testClassnameAsyncWithHttpInfo($client) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testClassnameRequest($body); + $request = $this->testClassnameRequest($client); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -292,17 +292,17 @@ class FakeClassnameTags123Api /** * Create request for operation 'testClassname' * - * @param \OpenAPI\Client\Model\Client $body client model (required) + * @param \OpenAPI\Client\Model\Client $client client model (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testClassnameRequest($body) + protected function testClassnameRequest($client) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'client' is set + if ($client === null || (is_array($client) && count($client) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling testClassname' + 'Missing the required parameter $client when calling testClassname' ); } @@ -318,8 +318,8 @@ class FakeClassnameTags123Api // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($client)) { + $_tempBody = $client; } if ($multipart) { diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index a3c7aa24586..de4bc86849f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -120,15 +120,19 @@ class PetApi * * Add a new pet to the store * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function addPet($body) + public function addPet($pet) { - $this->addPetWithHttpInfo($body); + $this->addPetWithHttpInfo($pet); } /** @@ -136,15 +140,19 @@ class PetApi * * Add a new pet to the store * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function addPetWithHttpInfo($body) + public function addPetWithHttpInfo($pet) { - $request = $this->addPetRequest($body); + $request = $this->addPetRequest($pet); try { $options = $this->createHttpClientOption(); @@ -188,14 +196,18 @@ class PetApi * * Add a new pet to the store * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addPetAsync($body) + public function addPetAsync($pet) { - return $this->addPetAsyncWithHttpInfo($body) + return $this->addPetAsyncWithHttpInfo($pet) ->then( function ($response) { return $response[0]; @@ -208,15 +220,19 @@ class PetApi * * Add a new pet to the store * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addPetAsyncWithHttpInfo($body) + public function addPetAsyncWithHttpInfo($pet) { $returnType = ''; - $request = $this->addPetRequest($body); + $request = $this->addPetRequest($pet); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -244,17 +260,21 @@ class PetApi /** * Create request for operation 'addPet' * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function addPetRequest($body) + protected function addPetRequest($pet) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'pet' is set + if ($pet === null || (is_array($pet) && count($pet) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling addPet' + 'Missing the required parameter $pet when calling addPet' ); } @@ -270,8 +290,8 @@ class PetApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($pet)) { + $_tempBody = $pet; } if ($multipart) { @@ -330,10 +350,16 @@ class PetApi $headers ); + $operationHosts = ["http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1412,15 +1438,19 @@ class PetApi * * Update an existing pet * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updatePet($body) + public function updatePet($pet) { - $this->updatePetWithHttpInfo($body); + $this->updatePetWithHttpInfo($pet); } /** @@ -1428,15 +1458,19 @@ class PetApi * * Update an existing pet * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updatePetWithHttpInfo($body) + public function updatePetWithHttpInfo($pet) { - $request = $this->updatePetRequest($body); + $request = $this->updatePetRequest($pet); try { $options = $this->createHttpClientOption(); @@ -1480,14 +1514,18 @@ class PetApi * * Update an existing pet * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetAsync($body) + public function updatePetAsync($pet) { - return $this->updatePetAsyncWithHttpInfo($body) + return $this->updatePetAsyncWithHttpInfo($pet) ->then( function ($response) { return $response[0]; @@ -1500,15 +1538,19 @@ class PetApi * * Update an existing pet * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetAsyncWithHttpInfo($body) + public function updatePetAsyncWithHttpInfo($pet) { $returnType = ''; - $request = $this->updatePetRequest($body); + $request = $this->updatePetRequest($pet); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1536,17 +1578,21 @@ class PetApi /** * Create request for operation 'updatePet' * - * @param \OpenAPI\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * URL: http://petstore.swagger.io/v2 + * URL: http://path-server-test.petstore.local/v2 + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updatePetRequest($body) + protected function updatePetRequest($pet) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'pet' is set + if ($pet === null || (is_array($pet) && count($pet) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling updatePet' + 'Missing the required parameter $pet when calling updatePet' ); } @@ -1562,8 +1608,8 @@ class PetApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($pet)) { + $_tempBody = $pet; } if ($multipart) { @@ -1622,10 +1668,16 @@ class PetApi $headers ); + $operationHosts = ["http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2"]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 497cc740500..92a01910698 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -884,15 +884,15 @@ class StoreApi * * Place an order for a pet * - * @param \OpenAPI\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Order */ - public function placeOrder($body) + public function placeOrder($order) { - list($response) = $this->placeOrderWithHttpInfo($body); + list($response) = $this->placeOrderWithHttpInfo($order); return $response; } @@ -901,15 +901,15 @@ class StoreApi * * Place an order for a pet * - * @param \OpenAPI\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) */ - public function placeOrderWithHttpInfo($body) + public function placeOrderWithHttpInfo($order) { - $request = $this->placeOrderRequest($body); + $request = $this->placeOrderRequest($order); try { $options = $this->createHttpClientOption(); @@ -989,14 +989,14 @@ class StoreApi * * Place an order for a pet * - * @param \OpenAPI\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function placeOrderAsync($body) + public function placeOrderAsync($order) { - return $this->placeOrderAsyncWithHttpInfo($body) + return $this->placeOrderAsyncWithHttpInfo($order) ->then( function ($response) { return $response[0]; @@ -1009,15 +1009,15 @@ class StoreApi * * Place an order for a pet * - * @param \OpenAPI\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function placeOrderAsyncWithHttpInfo($body) + public function placeOrderAsyncWithHttpInfo($order) { $returnType = '\OpenAPI\Client\Model\Order'; - $request = $this->placeOrderRequest($body); + $request = $this->placeOrderRequest($order); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1056,17 +1056,17 @@ class StoreApi /** * Create request for operation 'placeOrder' * - * @param \OpenAPI\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function placeOrderRequest($body) + protected function placeOrderRequest($order) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'order' is set + if ($order === null || (is_array($order) && count($order) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling placeOrder' + 'Missing the required parameter $order when calling placeOrder' ); } @@ -1082,8 +1082,8 @@ class StoreApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($order)) { + $_tempBody = $order; } if ($multipart) { @@ -1093,7 +1093,7 @@ class StoreApi } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], - [] + ['application/json'] ); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 35c82b5341a..9c5ff0a7610 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -120,15 +120,15 @@ class UserApi * * Create user * - * @param \OpenAPI\Client\Model\User $body Created user object (required) + * @param \OpenAPI\Client\Model\User $user Created user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createUser($body) + public function createUser($user) { - $this->createUserWithHttpInfo($body); + $this->createUserWithHttpInfo($user); } /** @@ -136,15 +136,15 @@ class UserApi * * Create user * - * @param \OpenAPI\Client\Model\User $body Created user object (required) + * @param \OpenAPI\Client\Model\User $user Created user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createUserWithHttpInfo($body) + public function createUserWithHttpInfo($user) { - $request = $this->createUserRequest($body); + $request = $this->createUserRequest($user); try { $options = $this->createHttpClientOption(); @@ -188,14 +188,14 @@ class UserApi * * Create user * - * @param \OpenAPI\Client\Model\User $body Created user object (required) + * @param \OpenAPI\Client\Model\User $user Created user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUserAsync($body) + public function createUserAsync($user) { - return $this->createUserAsyncWithHttpInfo($body) + return $this->createUserAsyncWithHttpInfo($user) ->then( function ($response) { return $response[0]; @@ -208,15 +208,15 @@ class UserApi * * Create user * - * @param \OpenAPI\Client\Model\User $body Created user object (required) + * @param \OpenAPI\Client\Model\User $user Created user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUserAsyncWithHttpInfo($body) + public function createUserAsyncWithHttpInfo($user) { $returnType = ''; - $request = $this->createUserRequest($body); + $request = $this->createUserRequest($user); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -244,17 +244,17 @@ class UserApi /** * Create request for operation 'createUser' * - * @param \OpenAPI\Client\Model\User $body Created user object (required) + * @param \OpenAPI\Client\Model\User $user Created user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createUserRequest($body) + protected function createUserRequest($user) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'user' is set + if ($user === null || (is_array($user) && count($user) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createUser' + 'Missing the required parameter $user when calling createUser' ); } @@ -270,8 +270,8 @@ class UserApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($user)) { + $_tempBody = $user; } if ($multipart) { @@ -281,7 +281,7 @@ class UserApi } else { $headers = $this->headerSelector->selectHeaders( [], - [] + ['application/json'] ); } @@ -340,15 +340,15 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createUsersWithArrayInput($body) + public function createUsersWithArrayInput($user) { - $this->createUsersWithArrayInputWithHttpInfo($body); + $this->createUsersWithArrayInputWithHttpInfo($user); } /** @@ -356,15 +356,15 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createUsersWithArrayInputWithHttpInfo($body) + public function createUsersWithArrayInputWithHttpInfo($user) { - $request = $this->createUsersWithArrayInputRequest($body); + $request = $this->createUsersWithArrayInputRequest($user); try { $options = $this->createHttpClientOption(); @@ -408,14 +408,14 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithArrayInputAsync($body) + public function createUsersWithArrayInputAsync($user) { - return $this->createUsersWithArrayInputAsyncWithHttpInfo($body) + return $this->createUsersWithArrayInputAsyncWithHttpInfo($user) ->then( function ($response) { return $response[0]; @@ -428,15 +428,15 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithArrayInputAsyncWithHttpInfo($body) + public function createUsersWithArrayInputAsyncWithHttpInfo($user) { $returnType = ''; - $request = $this->createUsersWithArrayInputRequest($body); + $request = $this->createUsersWithArrayInputRequest($user); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -464,17 +464,17 @@ class UserApi /** * Create request for operation 'createUsersWithArrayInput' * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createUsersWithArrayInputRequest($body) + protected function createUsersWithArrayInputRequest($user) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'user' is set + if ($user === null || (is_array($user) && count($user) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createUsersWithArrayInput' + 'Missing the required parameter $user when calling createUsersWithArrayInput' ); } @@ -490,8 +490,8 @@ class UserApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($user)) { + $_tempBody = $user; } if ($multipart) { @@ -501,7 +501,7 @@ class UserApi } else { $headers = $this->headerSelector->selectHeaders( [], - [] + ['application/json'] ); } @@ -560,15 +560,15 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createUsersWithListInput($body) + public function createUsersWithListInput($user) { - $this->createUsersWithListInputWithHttpInfo($body); + $this->createUsersWithListInputWithHttpInfo($user); } /** @@ -576,15 +576,15 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createUsersWithListInputWithHttpInfo($body) + public function createUsersWithListInputWithHttpInfo($user) { - $request = $this->createUsersWithListInputRequest($body); + $request = $this->createUsersWithListInputRequest($user); try { $options = $this->createHttpClientOption(); @@ -628,14 +628,14 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithListInputAsync($body) + public function createUsersWithListInputAsync($user) { - return $this->createUsersWithListInputAsyncWithHttpInfo($body) + return $this->createUsersWithListInputAsyncWithHttpInfo($user) ->then( function ($response) { return $response[0]; @@ -648,15 +648,15 @@ class UserApi * * Creates list of users with given input array * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithListInputAsyncWithHttpInfo($body) + public function createUsersWithListInputAsyncWithHttpInfo($user) { $returnType = ''; - $request = $this->createUsersWithListInputRequest($body); + $request = $this->createUsersWithListInputRequest($user); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -684,17 +684,17 @@ class UserApi /** * Create request for operation 'createUsersWithListInput' * - * @param \OpenAPI\Client\Model\User[] $body List of user object (required) + * @param \OpenAPI\Client\Model\User[] $user List of user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createUsersWithListInputRequest($body) + protected function createUsersWithListInputRequest($user) { - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'user' is set + if ($user === null || (is_array($user) && count($user) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling createUsersWithListInput' + 'Missing the required parameter $user when calling createUsersWithListInput' ); } @@ -710,8 +710,8 @@ class UserApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($user)) { + $_tempBody = $user; } if ($multipart) { @@ -721,7 +721,7 @@ class UserApi } else { $headers = $this->headerSelector->selectHeaders( [], - [] + ['application/json'] ); } @@ -1483,18 +1483,26 @@ class UserApi $multipart = false; // query params - if (is_array($username)) { - $username = ObjectSerializer::serializeCollection($username, '', true); - } if ($username !== null) { - $queryParams['username'] = $username; + if('form' === 'form' && is_array($username)) { + foreach($username as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['username'] = $username; + } } // query params - if (is_array($password)) { - $password = ObjectSerializer::serializeCollection($password, '', true); - } if ($password !== null) { - $queryParams['password'] = $password; + if('form' === 'form' && is_array($password)) { + foreach($password as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['password'] = $password; + } } @@ -1775,15 +1783,15 @@ class UserApi * Updated user * * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $body Updated user object (required) + * @param \OpenAPI\Client\Model\User $user Updated user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateUser($username, $body) + public function updateUser($username, $user) { - $this->updateUserWithHttpInfo($username, $body); + $this->updateUserWithHttpInfo($username, $user); } /** @@ -1792,15 +1800,15 @@ class UserApi * Updated user * * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $body Updated user object (required) + * @param \OpenAPI\Client\Model\User $user Updated user object (required) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateUserWithHttpInfo($username, $body) + public function updateUserWithHttpInfo($username, $user) { - $request = $this->updateUserRequest($username, $body); + $request = $this->updateUserRequest($username, $user); try { $options = $this->createHttpClientOption(); @@ -1845,14 +1853,14 @@ class UserApi * Updated user * * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $body Updated user object (required) + * @param \OpenAPI\Client\Model\User $user Updated user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateUserAsync($username, $body) + public function updateUserAsync($username, $user) { - return $this->updateUserAsyncWithHttpInfo($username, $body) + return $this->updateUserAsyncWithHttpInfo($username, $user) ->then( function ($response) { return $response[0]; @@ -1866,15 +1874,15 @@ class UserApi * Updated user * * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $body Updated user object (required) + * @param \OpenAPI\Client\Model\User $user Updated user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateUserAsyncWithHttpInfo($username, $body) + public function updateUserAsyncWithHttpInfo($username, $user) { $returnType = ''; - $request = $this->updateUserRequest($username, $body); + $request = $this->updateUserRequest($username, $user); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1903,12 +1911,12 @@ class UserApi * Create request for operation 'updateUser' * * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $body Updated user object (required) + * @param \OpenAPI\Client\Model\User $user Updated user object (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateUserRequest($username, $body) + protected function updateUserRequest($username, $user) { // verify the required parameter 'username' is set if ($username === null || (is_array($username) && count($username) === 0)) { @@ -1916,10 +1924,10 @@ class UserApi 'Missing the required parameter $username when calling updateUser' ); } - // verify the required parameter 'body' is set - if ($body === null || (is_array($body) && count($body) === 0)) { + // verify the required parameter 'user' is set + if ($user === null || (is_array($user) && count($user) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $body when calling updateUser' + 'Missing the required parameter $user when calling updateUser' ); } @@ -1943,8 +1951,8 @@ class UserApi // body params $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; + if (isset($user)) { + $_tempBody = $user; } if ($multipart) { @@ -1954,7 +1962,7 @@ class UserApi } else { $headers = $this->headerSelector->selectHeaders( [], - [] + ['application/json'] ); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index dd22a65f375..3ab5eda04ec 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -436,8 +436,41 @@ class Configuration { return [ [ - "url" => "http://petstore.swagger.io:80/v2", - "description" => "No description provided", + "url" => "http://{server}.swagger.io:{port}/v2", + "description" => "petstore server", + "variables" => [ + "server" => [ + "description" => "No description provided", + "default_value" => "petstore", + "enum_values" => [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + ], + "port" => [ + "description" => "No description provided", + "default_value" => "80", + "enum_values" => [ + "80", + "8080" + ] + ] + ] + ], + [ + "url" => "https://localhost:8080/{version}", + "description" => "The local server", + "variables" => [ + "version" => [ + "description" => "No description provided", + "default_value" => "v2", + "enum_values" => [ + "v1", + "v2" + ] + ] + ] ] ]; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index f4ef9ac60fb..2811e834099 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -57,17 +57,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'map_string' => 'map[string,string]', - 'map_number' => 'map[string,float]', - 'map_integer' => 'map[string,int]', - 'map_boolean' => 'map[string,bool]', - 'map_array_integer' => 'map[string,int[]]', - 'map_array_anytype' => 'map[string,object[]]', - 'map_map_string' => 'map[string,map[string,string]]', - 'map_map_anytype' => 'map[string,map[string,object]]', - 'anytype_1' => 'object', - 'anytype_2' => 'object', - 'anytype_3' => 'object' + 'map_property' => 'map[string,string]', + 'map_of_map_property' => 'map[string,map[string,string]]' ]; /** @@ -76,17 +67,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'map_string' => null, - 'map_number' => null, - 'map_integer' => null, - 'map_boolean' => null, - 'map_array_integer' => null, - 'map_array_anytype' => null, - 'map_map_string' => null, - 'map_map_anytype' => null, - 'anytype_1' => null, - 'anytype_2' => null, - 'anytype_3' => null + 'map_property' => null, + 'map_of_map_property' => null ]; /** @@ -116,17 +98,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'map_string' => 'map_string', - 'map_number' => 'map_number', - 'map_integer' => 'map_integer', - 'map_boolean' => 'map_boolean', - 'map_array_integer' => 'map_array_integer', - 'map_array_anytype' => 'map_array_anytype', - 'map_map_string' => 'map_map_string', - 'map_map_anytype' => 'map_map_anytype', - 'anytype_1' => 'anytype_1', - 'anytype_2' => 'anytype_2', - 'anytype_3' => 'anytype_3' + 'map_property' => 'map_property', + 'map_of_map_property' => 'map_of_map_property' ]; /** @@ -135,17 +108,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'map_string' => 'setMapString', - 'map_number' => 'setMapNumber', - 'map_integer' => 'setMapInteger', - 'map_boolean' => 'setMapBoolean', - 'map_array_integer' => 'setMapArrayInteger', - 'map_array_anytype' => 'setMapArrayAnytype', - 'map_map_string' => 'setMapMapString', - 'map_map_anytype' => 'setMapMapAnytype', - 'anytype_1' => 'setAnytype1', - 'anytype_2' => 'setAnytype2', - 'anytype_3' => 'setAnytype3' + 'map_property' => 'setMapProperty', + 'map_of_map_property' => 'setMapOfMapProperty' ]; /** @@ -154,17 +118,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'map_string' => 'getMapString', - 'map_number' => 'getMapNumber', - 'map_integer' => 'getMapInteger', - 'map_boolean' => 'getMapBoolean', - 'map_array_integer' => 'getMapArrayInteger', - 'map_array_anytype' => 'getMapArrayAnytype', - 'map_map_string' => 'getMapMapString', - 'map_map_anytype' => 'getMapMapAnytype', - 'anytype_1' => 'getAnytype1', - 'anytype_2' => 'getAnytype2', - 'anytype_3' => 'getAnytype3' + 'map_property' => 'getMapProperty', + 'map_of_map_property' => 'getMapOfMapProperty' ]; /** @@ -227,17 +182,8 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess */ public function __construct(array $data = null) { - $this->container['map_string'] = isset($data['map_string']) ? $data['map_string'] : null; - $this->container['map_number'] = isset($data['map_number']) ? $data['map_number'] : null; - $this->container['map_integer'] = isset($data['map_integer']) ? $data['map_integer'] : null; - $this->container['map_boolean'] = isset($data['map_boolean']) ? $data['map_boolean'] : null; - $this->container['map_array_integer'] = isset($data['map_array_integer']) ? $data['map_array_integer'] : null; - $this->container['map_array_anytype'] = isset($data['map_array_anytype']) ? $data['map_array_anytype'] : null; - $this->container['map_map_string'] = isset($data['map_map_string']) ? $data['map_map_string'] : null; - $this->container['map_map_anytype'] = isset($data['map_map_anytype']) ? $data['map_map_anytype'] : null; - $this->container['anytype_1'] = isset($data['anytype_1']) ? $data['anytype_1'] : null; - $this->container['anytype_2'] = isset($data['anytype_2']) ? $data['anytype_2'] : null; - $this->container['anytype_3'] = isset($data['anytype_3']) ? $data['anytype_3'] : null; + $this->container['map_property'] = isset($data['map_property']) ? $data['map_property'] : null; + $this->container['map_of_map_property'] = isset($data['map_of_map_property']) ? $data['map_of_map_property'] : null; } /** @@ -265,265 +211,49 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess /** - * Gets map_string + * Gets map_property * * @return map[string,string]|null */ - public function getMapString() + public function getMapProperty() { - return $this->container['map_string']; + return $this->container['map_property']; } /** - * Sets map_string + * Sets map_property * - * @param map[string,string]|null $map_string map_string + * @param map[string,string]|null $map_property map_property * * @return $this */ - public function setMapString($map_string) + public function setMapProperty($map_property) { - $this->container['map_string'] = $map_string; + $this->container['map_property'] = $map_property; return $this; } /** - * Gets map_number - * - * @return map[string,float]|null - */ - public function getMapNumber() - { - return $this->container['map_number']; - } - - /** - * Sets map_number - * - * @param map[string,float]|null $map_number map_number - * - * @return $this - */ - public function setMapNumber($map_number) - { - $this->container['map_number'] = $map_number; - - return $this; - } - - /** - * Gets map_integer - * - * @return map[string,int]|null - */ - public function getMapInteger() - { - return $this->container['map_integer']; - } - - /** - * Sets map_integer - * - * @param map[string,int]|null $map_integer map_integer - * - * @return $this - */ - public function setMapInteger($map_integer) - { - $this->container['map_integer'] = $map_integer; - - return $this; - } - - /** - * Gets map_boolean - * - * @return map[string,bool]|null - */ - public function getMapBoolean() - { - return $this->container['map_boolean']; - } - - /** - * Sets map_boolean - * - * @param map[string,bool]|null $map_boolean map_boolean - * - * @return $this - */ - public function setMapBoolean($map_boolean) - { - $this->container['map_boolean'] = $map_boolean; - - return $this; - } - - /** - * Gets map_array_integer - * - * @return map[string,int[]]|null - */ - public function getMapArrayInteger() - { - return $this->container['map_array_integer']; - } - - /** - * Sets map_array_integer - * - * @param map[string,int[]]|null $map_array_integer map_array_integer - * - * @return $this - */ - public function setMapArrayInteger($map_array_integer) - { - $this->container['map_array_integer'] = $map_array_integer; - - return $this; - } - - /** - * Gets map_array_anytype - * - * @return map[string,object[]]|null - */ - public function getMapArrayAnytype() - { - return $this->container['map_array_anytype']; - } - - /** - * Sets map_array_anytype - * - * @param map[string,object[]]|null $map_array_anytype map_array_anytype - * - * @return $this - */ - public function setMapArrayAnytype($map_array_anytype) - { - $this->container['map_array_anytype'] = $map_array_anytype; - - return $this; - } - - /** - * Gets map_map_string + * Gets map_of_map_property * * @return map[string,map[string,string]]|null */ - public function getMapMapString() + public function getMapOfMapProperty() { - return $this->container['map_map_string']; + return $this->container['map_of_map_property']; } /** - * Sets map_map_string + * Sets map_of_map_property * - * @param map[string,map[string,string]]|null $map_map_string map_map_string + * @param map[string,map[string,string]]|null $map_of_map_property map_of_map_property * * @return $this */ - public function setMapMapString($map_map_string) + public function setMapOfMapProperty($map_of_map_property) { - $this->container['map_map_string'] = $map_map_string; - - return $this; - } - - /** - * Gets map_map_anytype - * - * @return map[string,map[string,object]]|null - */ - public function getMapMapAnytype() - { - return $this->container['map_map_anytype']; - } - - /** - * Sets map_map_anytype - * - * @param map[string,map[string,object]]|null $map_map_anytype map_map_anytype - * - * @return $this - */ - public function setMapMapAnytype($map_map_anytype) - { - $this->container['map_map_anytype'] = $map_map_anytype; - - return $this; - } - - /** - * Gets anytype_1 - * - * @return object|null - */ - public function getAnytype1() - { - return $this->container['anytype_1']; - } - - /** - * Sets anytype_1 - * - * @param object|null $anytype_1 anytype_1 - * - * @return $this - */ - public function setAnytype1($anytype_1) - { - $this->container['anytype_1'] = $anytype_1; - - return $this; - } - - /** - * Gets anytype_2 - * - * @return object|null - */ - public function getAnytype2() - { - return $this->container['anytype_2']; - } - - /** - * Sets anytype_2 - * - * @param object|null $anytype_2 anytype_2 - * - * @return $this - */ - public function setAnytype2($anytype_2) - { - $this->container['anytype_2'] = $anytype_2; - - return $this; - } - - /** - * Gets anytype_3 - * - * @return object|null - */ - public function getAnytype3() - { - return $this->container['anytype_3']; - } - - /** - * Sets anytype_3 - * - * @param object|null $anytype_3 anytype_3 - * - * @return $this - */ - public function setAnytype3($anytype_3) - { - $this->container['anytype_3'] = $anytype_3; + $this->container['map_of_map_property'] = $map_of_map_property; return $this; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index a2fe5a44968..005a3fea0b3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -61,7 +61,10 @@ class EnumTest implements ModelInterface, ArrayAccess 'enum_string_required' => 'string', 'enum_integer' => 'int', 'enum_number' => 'double', - 'outer_enum' => '\OpenAPI\Client\Model\OuterEnum' + 'outer_enum' => '\OpenAPI\Client\Model\OuterEnum', + 'outer_enum_integer' => '\OpenAPI\Client\Model\OuterEnumInteger', + 'outer_enum_default_value' => '\OpenAPI\Client\Model\OuterEnumDefaultValue', + 'outer_enum_integer_default_value' => '\OpenAPI\Client\Model\OuterEnumIntegerDefaultValue' ]; /** @@ -74,7 +77,10 @@ class EnumTest implements ModelInterface, ArrayAccess 'enum_string_required' => null, 'enum_integer' => 'int32', 'enum_number' => 'double', - 'outer_enum' => null + 'outer_enum' => null, + 'outer_enum_integer' => null, + 'outer_enum_default_value' => null, + 'outer_enum_integer_default_value' => null ]; /** @@ -108,7 +114,10 @@ class EnumTest implements ModelInterface, ArrayAccess 'enum_string_required' => 'enum_string_required', 'enum_integer' => 'enum_integer', 'enum_number' => 'enum_number', - 'outer_enum' => 'outerEnum' + 'outer_enum' => 'outerEnum', + 'outer_enum_integer' => 'outerEnumInteger', + 'outer_enum_default_value' => 'outerEnumDefaultValue', + 'outer_enum_integer_default_value' => 'outerEnumIntegerDefaultValue' ]; /** @@ -121,7 +130,10 @@ class EnumTest implements ModelInterface, ArrayAccess 'enum_string_required' => 'setEnumStringRequired', 'enum_integer' => 'setEnumInteger', 'enum_number' => 'setEnumNumber', - 'outer_enum' => 'setOuterEnum' + 'outer_enum' => 'setOuterEnum', + 'outer_enum_integer' => 'setOuterEnumInteger', + 'outer_enum_default_value' => 'setOuterEnumDefaultValue', + 'outer_enum_integer_default_value' => 'setOuterEnumIntegerDefaultValue' ]; /** @@ -134,7 +146,10 @@ class EnumTest implements ModelInterface, ArrayAccess 'enum_string_required' => 'getEnumStringRequired', 'enum_integer' => 'getEnumInteger', 'enum_number' => 'getEnumNumber', - 'outer_enum' => 'getOuterEnum' + 'outer_enum' => 'getOuterEnum', + 'outer_enum_integer' => 'getOuterEnumInteger', + 'outer_enum_default_value' => 'getOuterEnumDefaultValue', + 'outer_enum_integer_default_value' => 'getOuterEnumIntegerDefaultValue' ]; /** @@ -266,6 +281,9 @@ class EnumTest implements ModelInterface, ArrayAccess $this->container['enum_integer'] = isset($data['enum_integer']) ? $data['enum_integer'] : null; $this->container['enum_number'] = isset($data['enum_number']) ? $data['enum_number'] : null; $this->container['outer_enum'] = isset($data['outer_enum']) ? $data['outer_enum'] : null; + $this->container['outer_enum_integer'] = isset($data['outer_enum_integer']) ? $data['outer_enum_integer'] : null; + $this->container['outer_enum_default_value'] = isset($data['outer_enum_default_value']) ? $data['outer_enum_default_value'] : null; + $this->container['outer_enum_integer_default_value'] = isset($data['outer_enum_integer_default_value']) ? $data['outer_enum_integer_default_value'] : null; } /** @@ -482,6 +500,78 @@ class EnumTest implements ModelInterface, ArrayAccess return $this; } + + /** + * Gets outer_enum_integer + * + * @return \OpenAPI\Client\Model\OuterEnumInteger|null + */ + public function getOuterEnumInteger() + { + return $this->container['outer_enum_integer']; + } + + /** + * Sets outer_enum_integer + * + * @param \OpenAPI\Client\Model\OuterEnumInteger|null $outer_enum_integer outer_enum_integer + * + * @return $this + */ + public function setOuterEnumInteger($outer_enum_integer) + { + $this->container['outer_enum_integer'] = $outer_enum_integer; + + return $this; + } + + /** + * Gets outer_enum_default_value + * + * @return \OpenAPI\Client\Model\OuterEnumDefaultValue|null + */ + public function getOuterEnumDefaultValue() + { + return $this->container['outer_enum_default_value']; + } + + /** + * Sets outer_enum_default_value + * + * @param \OpenAPI\Client\Model\OuterEnumDefaultValue|null $outer_enum_default_value outer_enum_default_value + * + * @return $this + */ + public function setOuterEnumDefaultValue($outer_enum_default_value) + { + $this->container['outer_enum_default_value'] = $outer_enum_default_value; + + return $this; + } + + /** + * Gets outer_enum_integer_default_value + * + * @return \OpenAPI\Client\Model\OuterEnumIntegerDefaultValue|null + */ + public function getOuterEnumIntegerDefaultValue() + { + return $this->container['outer_enum_integer_default_value']; + } + + /** + * Sets outer_enum_integer_default_value + * + * @param \OpenAPI\Client\Model\OuterEnumIntegerDefaultValue|null $outer_enum_integer_default_value outer_enum_integer_default_value + * + * @return $this + */ + public function setOuterEnumIntegerDefaultValue($outer_enum_integer_default_value) + { + $this->container['outer_enum_integer_default_value'] = $outer_enum_integer_default_value; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index a2203455b32..0394d187aca 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -70,7 +70,8 @@ class FormatTest implements ModelInterface, ArrayAccess 'date_time' => '\DateTime', 'uuid' => 'string', 'password' => 'string', - 'big_decimal' => 'BigDecimal' + 'pattern_with_digits' => 'string', + 'pattern_with_digits_and_delimiter' => 'string' ]; /** @@ -92,7 +93,8 @@ class FormatTest implements ModelInterface, ArrayAccess 'date_time' => 'date-time', 'uuid' => 'uuid', 'password' => 'password', - 'big_decimal' => 'number' + 'pattern_with_digits' => null, + 'pattern_with_digits_and_delimiter' => null ]; /** @@ -135,7 +137,8 @@ class FormatTest implements ModelInterface, ArrayAccess 'date_time' => 'dateTime', 'uuid' => 'uuid', 'password' => 'password', - 'big_decimal' => 'BigDecimal' + 'pattern_with_digits' => 'pattern_with_digits', + 'pattern_with_digits_and_delimiter' => 'pattern_with_digits_and_delimiter' ]; /** @@ -157,7 +160,8 @@ class FormatTest implements ModelInterface, ArrayAccess 'date_time' => 'setDateTime', 'uuid' => 'setUuid', 'password' => 'setPassword', - 'big_decimal' => 'setBigDecimal' + 'pattern_with_digits' => 'setPatternWithDigits', + 'pattern_with_digits_and_delimiter' => 'setPatternWithDigitsAndDelimiter' ]; /** @@ -179,7 +183,8 @@ class FormatTest implements ModelInterface, ArrayAccess 'date_time' => 'getDateTime', 'uuid' => 'getUuid', 'password' => 'getPassword', - 'big_decimal' => 'getBigDecimal' + 'pattern_with_digits' => 'getPatternWithDigits', + 'pattern_with_digits_and_delimiter' => 'getPatternWithDigitsAndDelimiter' ]; /** @@ -255,7 +260,8 @@ class FormatTest implements ModelInterface, ArrayAccess $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['big_decimal'] = isset($data['big_decimal']) ? $data['big_decimal'] : null; + $this->container['pattern_with_digits'] = isset($data['pattern_with_digits']) ? $data['pattern_with_digits'] : null; + $this->container['pattern_with_digits_and_delimiter'] = isset($data['pattern_with_digits_and_delimiter']) ? $data['pattern_with_digits_and_delimiter'] : null; } /** @@ -317,10 +323,6 @@ class FormatTest implements ModelInterface, ArrayAccess if ($this->container['byte'] === null) { $invalidProperties[] = "'byte' can't be null"; } - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { - $invalidProperties[] = "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; - } - if ($this->container['date'] === null) { $invalidProperties[] = "'date' can't be null"; } @@ -335,6 +337,14 @@ class FormatTest implements ModelInterface, ArrayAccess $invalidProperties[] = "invalid value for 'password', the character length must be bigger than or equal to 10."; } + if (!is_null($this->container['pattern_with_digits']) && !preg_match("/^\\d{10}$/", $this->container['pattern_with_digits'])) { + $invalidProperties[] = "invalid value for 'pattern_with_digits', must be conform to the pattern /^\\d{10}$/."; + } + + if (!is_null($this->container['pattern_with_digits_and_delimiter']) && !preg_match("/^image_\\d{1,3}$/i", $this->container['pattern_with_digits_and_delimiter'])) { + $invalidProperties[] = "invalid value for 'pattern_with_digits_and_delimiter', must be conform to the pattern /^image_\\d{1,3}$/i."; + } + return $invalidProperties; } @@ -582,11 +592,6 @@ class FormatTest implements ModelInterface, ArrayAccess */ public function setByte($byte) { - - if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $byte))) { - throw new \InvalidArgumentException("invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); - } - $this->container['byte'] = $byte; return $this; @@ -720,25 +725,59 @@ class FormatTest implements ModelInterface, ArrayAccess } /** - * Gets big_decimal + * Gets pattern_with_digits * - * @return BigDecimal|null + * @return string|null */ - public function getBigDecimal() + public function getPatternWithDigits() { - return $this->container['big_decimal']; + return $this->container['pattern_with_digits']; } /** - * Sets big_decimal + * Sets pattern_with_digits * - * @param BigDecimal|null $big_decimal big_decimal + * @param string|null $pattern_with_digits A string that is a 10 digit number. Can have leading zeros. * * @return $this */ - public function setBigDecimal($big_decimal) + public function setPatternWithDigits($pattern_with_digits) { - $this->container['big_decimal'] = $big_decimal; + + if (!is_null($pattern_with_digits) && (!preg_match("/^\\d{10}$/", $pattern_with_digits))) { + throw new \InvalidArgumentException("invalid value for $pattern_with_digits when calling FormatTest., must conform to the pattern /^\\d{10}$/."); + } + + $this->container['pattern_with_digits'] = $pattern_with_digits; + + return $this; + } + + /** + * Gets pattern_with_digits_and_delimiter + * + * @return string|null + */ + public function getPatternWithDigitsAndDelimiter() + { + return $this->container['pattern_with_digits_and_delimiter']; + } + + /** + * Sets pattern_with_digits_and_delimiter + * + * @param string|null $pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * + * @return $this + */ + public function setPatternWithDigitsAndDelimiter($pattern_with_digits_and_delimiter) + { + + if (!is_null($pattern_with_digits_and_delimiter) && (!preg_match("/^image_\\d{1,3}$/i", $pattern_with_digits_and_delimiter))) { + throw new \InvalidArgumentException("invalid value for $pattern_with_digits_and_delimiter when calling FormatTest., must conform to the pattern /^image_\\d{1,3}$/i."); + } + + $this->container['pattern_with_digits_and_delimiter'] = $pattern_with_digits_and_delimiter; return $this; } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php rename to samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 9e0ca1118bd..b58e8fcff1e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -49,7 +49,7 @@ class SpecialModelName implements ModelInterface, ArrayAccess * * @var string */ - protected static $openAPIModelName = '$special[model.name]'; + protected static $openAPIModelName = '_special_model.name_'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/samples/client/petstore/php/OpenAPIClient-php/pom.xml b/samples/client/petstore/php/OpenAPIClient-php/pom.xml index da15e1c4096..d5d32c3bd1b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/pom.xml +++ b/samples/client/petstore/php/OpenAPIClient-php/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.openapitools - PhpPetstoreOAS2Tests + PhpPetstoreOAS3Tests pom 1.0-SNAPSHOT - PHP OpenAPI OAS2 Client + PHP OpenAPI OAS3 Client diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index 933751953ac..fbd7182acd4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -73,12 +73,22 @@ class FakeApiTest extends TestCase } /** - * Test case for createXmlItem + * Test case for fakeHealthGet * - * creates an XmlItem. + * Health check endpoint. * */ - public function testCreateXmlItem() + public function testFakeHealthGet() + { + } + + /** + * Test case for fakeHttpSignatureTest + * + * test http signature authentication. + * + */ + public function testFakeHttpSignatureTest() { } @@ -155,7 +165,7 @@ class FakeApiTest extends TestCase /** * Test case for testEndpointParameters * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. * */ public function testTestEndpointParameters() diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index cc0490ca238..a0dd868d418 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -79,79 +79,16 @@ class AdditionalPropertiesClassTest extends TestCase } /** - * Test attribute "map_string" + * Test attribute "map_property" */ - public function testPropertyMapString() + public function testPropertyMapProperty() { } /** - * Test attribute "map_number" + * Test attribute "map_of_map_property" */ - public function testPropertyMapNumber() - { - } - - /** - * Test attribute "map_integer" - */ - public function testPropertyMapInteger() - { - } - - /** - * Test attribute "map_boolean" - */ - public function testPropertyMapBoolean() - { - } - - /** - * Test attribute "map_array_integer" - */ - public function testPropertyMapArrayInteger() - { - } - - /** - * Test attribute "map_array_anytype" - */ - public function testPropertyMapArrayAnytype() - { - } - - /** - * Test attribute "map_map_string" - */ - public function testPropertyMapMapString() - { - } - - /** - * Test attribute "map_map_anytype" - */ - public function testPropertyMapMapAnytype() - { - } - - /** - * Test attribute "anytype_1" - */ - public function testPropertyAnytype1() - { - } - - /** - * Test attribute "anytype_2" - */ - public function testPropertyAnytype2() - { - } - - /** - * Test attribute "anytype_3" - */ - public function testPropertyAnytype3() + public function testPropertyMapOfMapProperty() { } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 040335bd931..479fc3e598c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -112,4 +112,25 @@ class EnumTestTest extends TestCase public function testPropertyOuterEnum() { } + + /** + * Test attribute "outer_enum_integer" + */ + public function testPropertyOuterEnumInteger() + { + } + + /** + * Test attribute "outer_enum_default_value" + */ + public function testPropertyOuterEnumDefaultValue() + { + } + + /** + * Test attribute "outer_enum_integer_default_value" + */ + public function testPropertyOuterEnumIntegerDefaultValue() + { + } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 565bf4c1d77..5514496b67e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -170,9 +170,16 @@ class FormatTestTest extends TestCase } /** - * Test attribute "big_decimal" + * Test attribute "pattern_with_digits" */ - public function testPropertyBigDecimal() + public function testPropertyPatternWithDigits() + { + } + + /** + * Test attribute "pattern_with_digits_and_delimiter" + */ + public function testPropertyPatternWithDigitsAndDelimiter() { } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php rename to samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php similarity index 100% rename from samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php rename to samples/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php index 375b054b479..b14dd018df0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php @@ -5,6 +5,16 @@ use PHPUnit\Framework\TestCase; class DebugTest extends TestCase { + + public static function setUpBeforeClass(): void + { + parent::setUpBeforeClass(); + $newPet = new Model\Pet; + $newPet->setId(1); + $newPet->setName("PHP Unit Test"); + (new Api\PetApi())->addPetWithHttpInfo($newPet); + } + public function testEnableDebugOutput() { $this->expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#'); diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php index a6645a0226d..2a5bb49caa7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php @@ -5,8 +5,8 @@ namespace OpenAPI\Client; use OpenAPI\Client\Api\PetApi; use OpenAPI\Client\Model\ApiResponse; use OpenAPI\Client\Model\Pet; -use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\Assert; class PetApiTest extends TestCase { diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php index e833151d1de..834e27588a7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php @@ -9,7 +9,6 @@ require_once __DIR__ . '/FakeHttpClient.php'; class RequestTest extends TestCase { - /** @var FakeApi */ private $api; /** @var FakeHttpClient */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php index 5f09b4b0145..8d65396ccbc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php @@ -40,8 +40,8 @@ class ResponseTypesTest extends TestCase public function testDefinedErrorException() { - $this->expectException(\OpenAPI\Client\ApiException::class); $this->expectExceptionCode(400); + $this->expectException(\OpenAPI\Client\ApiException::class); $statusCode = 400; $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); @@ -69,8 +69,8 @@ class ResponseTypesTest extends TestCase public function testDefaultErrorException() { - $this->expectException(\OpenAPI\Client\ApiException::class); $this->expectExceptionCode(404); + $this->expectException(\OpenAPI\Client\ApiException::class); $statusCode = 404; $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.gitignore b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.gitignore deleted file mode 100644 index e2316dd486c..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore - -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock - -# php-cs-fixer cache -.php_cs.cache - -# PHPUnit cache -.phpunit.result.cache diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator-ignore b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES deleted file mode 100644 index 6c0c0f87b52..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ /dev/null @@ -1,124 +0,0 @@ -.gitignore -.php_cs -.travis.yml -README.md -composer.json -docs/Api/AnotherFakeApi.md -docs/Api/DefaultApi.md -docs/Api/FakeApi.md -docs/Api/FakeClassnameTags123Api.md -docs/Api/PetApi.md -docs/Api/StoreApi.md -docs/Api/UserApi.md -docs/Model/AdditionalPropertiesClass.md -docs/Model/Animal.md -docs/Model/ApiResponse.md -docs/Model/ArrayOfArrayOfNumberOnly.md -docs/Model/ArrayOfNumberOnly.md -docs/Model/ArrayTest.md -docs/Model/Capitalization.md -docs/Model/Cat.md -docs/Model/CatAllOf.md -docs/Model/Category.md -docs/Model/ClassModel.md -docs/Model/Client.md -docs/Model/Dog.md -docs/Model/DogAllOf.md -docs/Model/EnumArrays.md -docs/Model/EnumClass.md -docs/Model/EnumTest.md -docs/Model/File.md -docs/Model/FileSchemaTestClass.md -docs/Model/Foo.md -docs/Model/FormatTest.md -docs/Model/HasOnlyReadOnly.md -docs/Model/HealthCheckResult.md -docs/Model/InlineObject.md -docs/Model/InlineObject1.md -docs/Model/InlineObject2.md -docs/Model/InlineObject3.md -docs/Model/InlineObject4.md -docs/Model/InlineObject5.md -docs/Model/InlineResponseDefault.md -docs/Model/MapTest.md -docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model/Model200Response.md -docs/Model/ModelList.md -docs/Model/ModelReturn.md -docs/Model/Name.md -docs/Model/NullableClass.md -docs/Model/NumberOnly.md -docs/Model/Order.md -docs/Model/OuterComposite.md -docs/Model/OuterEnum.md -docs/Model/OuterEnumDefaultValue.md -docs/Model/OuterEnumInteger.md -docs/Model/OuterEnumIntegerDefaultValue.md -docs/Model/Pet.md -docs/Model/ReadOnlyFirst.md -docs/Model/SpecialModelName.md -docs/Model/Tag.md -docs/Model/User.md -git_push.sh -lib/Api/AnotherFakeApi.php -lib/Api/DefaultApi.php -lib/Api/FakeApi.php -lib/Api/FakeClassnameTags123Api.php -lib/Api/PetApi.php -lib/Api/StoreApi.php -lib/Api/UserApi.php -lib/ApiException.php -lib/Configuration.php -lib/HeaderSelector.php -lib/Model/AdditionalPropertiesClass.php -lib/Model/Animal.php -lib/Model/ApiResponse.php -lib/Model/ArrayOfArrayOfNumberOnly.php -lib/Model/ArrayOfNumberOnly.php -lib/Model/ArrayTest.php -lib/Model/Capitalization.php -lib/Model/Cat.php -lib/Model/CatAllOf.php -lib/Model/Category.php -lib/Model/ClassModel.php -lib/Model/Client.php -lib/Model/Dog.php -lib/Model/DogAllOf.php -lib/Model/EnumArrays.php -lib/Model/EnumClass.php -lib/Model/EnumTest.php -lib/Model/File.php -lib/Model/FileSchemaTestClass.php -lib/Model/Foo.php -lib/Model/FormatTest.php -lib/Model/HasOnlyReadOnly.php -lib/Model/HealthCheckResult.php -lib/Model/InlineObject.php -lib/Model/InlineObject1.php -lib/Model/InlineObject2.php -lib/Model/InlineObject3.php -lib/Model/InlineObject4.php -lib/Model/InlineObject5.php -lib/Model/InlineResponseDefault.php -lib/Model/MapTest.php -lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php -lib/Model/Model200Response.php -lib/Model/ModelInterface.php -lib/Model/ModelList.php -lib/Model/ModelReturn.php -lib/Model/Name.php -lib/Model/NullableClass.php -lib/Model/NumberOnly.php -lib/Model/Order.php -lib/Model/OuterComposite.php -lib/Model/OuterEnum.php -lib/Model/OuterEnumDefaultValue.php -lib/Model/OuterEnumInteger.php -lib/Model/OuterEnumIntegerDefaultValue.php -lib/Model/Pet.php -lib/Model/ReadOnlyFirst.php -lib/Model/SpecialModelName.php -lib/Model/Tag.php -lib/Model/User.php -lib/ObjectSerializer.php -phpunit.xml.dist diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.php_cs b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.php_cs deleted file mode 100644 index 4fbe53ec5ff..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.php_cs +++ /dev/null @@ -1,23 +0,0 @@ -setUsingCache(true) - ->setRules([ - '@PSR2' => true, - 'ordered_imports' => true, - 'phpdoc_order' => true, - 'array_syntax' => [ 'syntax' => 'short' ], - 'strict_comparison' => true, - 'strict_param' => true, - 'no_trailing_whitespace' => false, - 'no_trailing_whitespace_in_comment' => false, - 'braces' => false, - 'single_blank_line_at_eof' => false, - 'blank_line_after_namespace' => false, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('test') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.travis.yml b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.travis.yml deleted file mode 100644 index b4b1d0a6b5a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php -# Bionic environment has preinstalled PHP from 7.1 to 7.4 -# https://docs.travis-ci.com/user/reference/bionic/#php-support -dist: bionic -php: - - 7.2 - - 7.3 - - 7.4 -before_install: "composer install" -script: "vendor/bin/phpunit" diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md deleted file mode 100644 index 4a8f0287158..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ /dev/null @@ -1,237 +0,0 @@ -# OpenAPIClient-php - -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 PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PhpClientCodegen - -## Requirements - -PHP 7.2 and later - -## Installation & Usage - -### Composer - -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: - -```json -{ - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" - } - ], - "require": { - "GIT_USER_ID/GIT_REPO_ID": "*@dev" - } -} -``` - -Then run `composer install` - -### Manual Installation - -Download the files and include `autoload.php`: - -```php - require_once('/path/to/OpenAPIClient-php/vendor/autoload.php'); -``` - -## Tests - -To run the unit tests: - -```bash -composer install -./vendor/bin/phpunit -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```php -call123TestSpecialTags($client); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->call123TestSpecialTags: ', $e->getMessage(), PHP_EOL; -} - -?> -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call123TestSpecialTags**](docs/Api/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**fooGet**](docs/Api/DefaultApi.md#fooget) | **GET** /foo | -*FakeApi* | [**fakeHealthGet**](docs/Api/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeHttpSignatureTest**](docs/Api/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -*FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeApi* | [**testBodyWithFileSchema**](docs/Api/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**testBodyWithQueryParams**](docs/Api/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | -*FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/Api/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/Api/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**uploadFileWithRequiredFile**](docs/Api/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/Api/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/Api/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/Api/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/Api/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/Api/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/Api/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md) - - [Animal](docs/Model/Animal.md) - - [ApiResponse](docs/Model/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) - - [ArrayTest](docs/Model/ArrayTest.md) - - [Capitalization](docs/Model/Capitalization.md) - - [Cat](docs/Model/Cat.md) - - [CatAllOf](docs/Model/CatAllOf.md) - - [Category](docs/Model/Category.md) - - [ClassModel](docs/Model/ClassModel.md) - - [Client](docs/Model/Client.md) - - [Dog](docs/Model/Dog.md) - - [DogAllOf](docs/Model/DogAllOf.md) - - [EnumArrays](docs/Model/EnumArrays.md) - - [EnumClass](docs/Model/EnumClass.md) - - [EnumTest](docs/Model/EnumTest.md) - - [File](docs/Model/File.md) - - [FileSchemaTestClass](docs/Model/FileSchemaTestClass.md) - - [Foo](docs/Model/Foo.md) - - [FormatTest](docs/Model/FormatTest.md) - - [HasOnlyReadOnly](docs/Model/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/Model/HealthCheckResult.md) - - [InlineObject](docs/Model/InlineObject.md) - - [InlineObject1](docs/Model/InlineObject1.md) - - [InlineObject2](docs/Model/InlineObject2.md) - - [InlineObject3](docs/Model/InlineObject3.md) - - [InlineObject4](docs/Model/InlineObject4.md) - - [InlineObject5](docs/Model/InlineObject5.md) - - [InlineResponseDefault](docs/Model/InlineResponseDefault.md) - - [MapTest](docs/Model/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model/Model200Response.md) - - [ModelList](docs/Model/ModelList.md) - - [ModelReturn](docs/Model/ModelReturn.md) - - [Name](docs/Model/Name.md) - - [NullableClass](docs/Model/NullableClass.md) - - [NumberOnly](docs/Model/NumberOnly.md) - - [Order](docs/Model/Order.md) - - [OuterComposite](docs/Model/OuterComposite.md) - - [OuterEnum](docs/Model/OuterEnum.md) - - [OuterEnumDefaultValue](docs/Model/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/Model/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/Model/OuterEnumIntegerDefaultValue.md) - - [Pet](docs/Model/Pet.md) - - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - - [SpecialModelName](docs/Model/SpecialModelName.md) - - [Tag](docs/Model/Tag.md) - - [User](docs/Model/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**: Bearer authentication (JWT) - - - -## http_basic_test - - -- **Type**: HTTP basic authentication - - - -## http_signature_test - - - - -## 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 - - -## Author - - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/composer.json b/samples/openapi3/client/petstore/php/OpenAPIClient-php/composer.json deleted file mode 100644 index 823e9f92a7b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "GIT_USER_ID/GIT_REPO_ID", - "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", - "keywords": [ - "openapitools", - "openapi-generator", - "openapi", - "php", - "sdk", - "rest", - "api" - ], - "homepage": "https://openapi-generator.tech", - "license": "unlicense", - "authors": [ - { - "name": "OpenAPI-Generator contributors", - "homepage": "https://openapi-generator.tech" - } - ], - "require": { - "php": ">=7.2", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", - "friendsofphp/php-cs-fixer": "^2.12" - }, - "autoload": { - "psr-4": { "OpenAPI\\Client\\" : "lib/" } - }, - "autoload-dev": { - "psr-4": { "OpenAPI\\Client\\" : "test/" } - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md deleted file mode 100644 index 1ff76b69457..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/AnotherFakeApi.md +++ /dev/null @@ -1,65 +0,0 @@ -# OpenAPI\Client\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 - -> \OpenAPI\Client\Model\Client call123TestSpecialTags($client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```php -call123TestSpecialTags($client); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->call123TestSpecialTags: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | - -### Return type - -[**\OpenAPI\Client\Model\Client**](../Model/Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md deleted file mode 100644 index eff99ef159d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/DefaultApi.md +++ /dev/null @@ -1,59 +0,0 @@ -# OpenAPI\Client\DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | - - - -## fooGet - -> \OpenAPI\Client\Model\InlineResponseDefault fooGet() - - - -### Example - -```php -fooGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DefaultApi->fooGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\OpenAPI\Client\Model\InlineResponseDefault**](../Model/InlineResponseDefault.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md deleted file mode 100644 index 5046a502e19..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ /dev/null @@ -1,923 +0,0 @@ -# OpenAPI\Client\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 - -> \OpenAPI\Client\Model\HealthCheckResult fakeHealthGet() - -Health check endpoint - -### Example - -```php -fakeHealthGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeHealthGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\OpenAPI\Client\Model\HealthCheckResult**](../Model/HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## fakeHttpSignatureTest - -> fakeHttpSignatureTest($pet, $query_1, $header_1) - -test http signature authentication - -### Example - -```php -fakeHttpSignatureTest($pet, $query_1, $header_1); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeHttpSignatureTest: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | - **query_1** | **string**| query parameter | [optional] - **header_1** | **string**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## fakeOuterBooleanSerialize - -> bool fakeOuterBooleanSerialize($body) - - - -Test serialization of outer boolean types - -### Example - -```php -fakeOuterBooleanSerialize($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## fakeOuterCompositeSerialize - -> \OpenAPI\Client\Model\OuterComposite fakeOuterCompositeSerialize($outer_composite) - - - -Test serialization of object with outer number type - -### Example - -```php -fakeOuterCompositeSerialize($outer_composite); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterCompositeSerialize: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outer_composite** | [**\OpenAPI\Client\Model\OuterComposite**](../Model/OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**\OpenAPI\Client\Model\OuterComposite**](../Model/OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## fakeOuterNumberSerialize - -> float fakeOuterNumberSerialize($body) - - - -Test serialization of outer number types - -### Example - -```php -fakeOuterNumberSerialize($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterNumberSerialize: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] - -### Return type - -**float** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## fakeOuterStringSerialize - -> string fakeOuterStringSerialize($body) - - - -Test serialization of outer string types - -### Example - -```php -fakeOuterStringSerialize($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterStringSerialize: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **string**| Input string as post body | [optional] - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testBodyWithFileSchema - -> testBodyWithFileSchema($file_schema_test_class) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```php -testBodyWithFileSchema($file_schema_test_class); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testBodyWithFileSchema: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**\OpenAPI\Client\Model\FileSchemaTestClass**](../Model/FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testBodyWithQueryParams - -> testBodyWithQueryParams($query, $user) - - - -### Example - -```php -testBodyWithQueryParams($query, $user); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testBodyWithQueryParams: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **string**| | - **user** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testClientModel - -> \OpenAPI\Client\Model\Client testClientModel($client) - -To test \"client\" model - -To test \"client\" model - -### Example - -```php -testClientModel($client); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testClientModel: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | - -### Return type - -[**\OpenAPI\Client\Model\Client**](../Model/Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testEndpointParameters - -> testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -```php -setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - - -$apiInstance = new OpenAPI\Client\Api\FakeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$number = 3.4; // float | None -$double = 3.4; // double | None -$pattern_without_delimiter = 'pattern_without_delimiter_example'; // string | None -$byte = 'byte_example'; // string | None -$integer = 56; // int | None -$int32 = 56; // int | None -$int64 = 56; // int | None -$float = 3.4; // float | None -$string = 'string_example'; // string | None -$binary = "/path/to/file.txt"; // \SplFileObject | None -$date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | None -$date_time = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | None -$password = 'password_example'; // string | None -$callback = 'callback_example'; // string | None - -try { - $apiInstance->testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **double**| None | - **pattern_without_delimiter** | **string**| None | - **byte** | **string**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **string**| None | [optional] - **binary** | **\SplFileObject****\SplFileObject**| None | [optional] - **date** | **\DateTime**| None | [optional] - **date_time** | **\DateTime**| None | [optional] - **password** | **string**| None | [optional] - **callback** | **string**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../../README.md#http_basic_test) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testEnumParameters - -> testEnumParameters($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string) - -To test enum parameters - -To test enum parameters - -### Example - -```php -testEnumParameters($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testEnumParameters: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**string[]**](../Model/string.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **string**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_string_array** | [**string[]**](../Model/string.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **string**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **double**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**string[]**](../Model/string.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **string**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testGroupParameters - -> testGroupParameters($required_string_group, $required_boolean_group, $required_int64_group, $string_group, $boolean_group, $int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\FakeApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$associate_array['required_string_group'] = 56; // int | Required String in group parameters -$associate_array['required_boolean_group'] = True; // bool | Required Boolean in group parameters -$associate_array['required_int64_group'] = 56; // int | Required Integer in group parameters -$associate_array['string_group'] = 56; // int | String in group parameters -$associate_array['boolean_group'] = True; // bool | Boolean in group parameters -$associate_array['int64_group'] = 56; // int | Integer in group parameters - -try { - $apiInstance->testGroupParameters($associate_array); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testGroupParameters: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Note: the input parameter is an associative array with the keys listed as the parameter name below. - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../../README.md#bearer_test) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testInlineAdditionalProperties - -> testInlineAdditionalProperties($request_body) - -test inline additionalProperties - -### Example - -```php - 'request_body_example'); // map[string,string] | request body - -try { - $apiInstance->testInlineAdditionalProperties($request_body); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testInlineAdditionalProperties: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_body** | [**map[string,string]**](../Model/string.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testJsonFormData - -> testJsonFormData($param, $param2) - -test json serialization of form data - -### Example - -```php -testJsonFormData($param, $param2); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testJsonFormData: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **string**| field1 | - **param2** | **string**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## testQueryParameterCollectionFormat - -> testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) - - - -To test the collection format in query parameters - -### Example - -```php -testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context); -} catch (Exception $e) { - echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**string[]**](../Model/string.md)| | - **ioutil** | [**string[]**](../Model/string.md)| | - **http** | [**string[]**](../Model/string.md)| | - **url** | [**string[]**](../Model/string.md)| | - **context** | [**string[]**](../Model/string.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md deleted file mode 100644 index 3faeaf3043a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeClassnameTags123Api.md +++ /dev/null @@ -1,72 +0,0 @@ -# OpenAPI\Client\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 - -> \OpenAPI\Client\Model\Client testClassname($client) - -To test class name in snake case - -To test class name in snake case - -### Example - -```php -setApiKey('api_key_query', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key_query', 'Bearer'); - - -$apiInstance = new OpenAPI\Client\Api\FakeClassnameTags123Api( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$client = new \OpenAPI\Client\Model\Client(); // \OpenAPI\Client\Model\Client | client model - -try { - $result = $apiInstance->testClassname($client); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FakeClassnameTags123Api->testClassname: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**\OpenAPI\Client\Model\Client**](../Model/Client.md)| client model | - -### Return type - -[**\OpenAPI\Client\Model\Client**](../Model/Client.md) - -### Authorization - -[api_key_query](../../README.md#api_key_query) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md deleted file mode 100644 index d96e2f2fb9b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/PetApi.md +++ /dev/null @@ -1,566 +0,0 @@ -# OpenAPI\Client\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 - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store - -try { - $apiInstance->addPet($pet); -} catch (Exception $e) { - echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## deletePet - -> deletePet($pet_id, $api_key) - -Deletes a pet - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet_id = 56; // int | Pet id to delete -$api_key = 'api_key_example'; // string | - -try { - $apiInstance->deletePet($pet_id, $api_key); -} catch (Exception $e) { - echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **string**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## findPetsByStatus - -> \OpenAPI\Client\Model\Pet[] findPetsByStatus($status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$status = array('status_example'); // string[] | Status values that need to be considered for filter - -try { - $result = $apiInstance->findPetsByStatus($status); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**string[]**](../Model/string.md)| Status values that need to be considered for filter | - -### Return type - -[**\OpenAPI\Client\Model\Pet[]**](../Model/Pet.md) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## findPetsByTags - -> \OpenAPI\Client\Model\Pet[] findPetsByTags($tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$tags = array('tags_example'); // string[] | Tags to filter by - -try { - $result = $apiInstance->findPetsByTags($tags); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**string[]**](../Model/string.md)| Tags to filter by | - -### Return type - -[**\OpenAPI\Client\Model\Pet[]**](../Model/Pet.md) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## getPetById - -> \OpenAPI\Client\Model\Pet getPetById($pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -```php -setApiKey('api_key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet_id = 56; // int | ID of pet to return - -try { - $result = $apiInstance->getPetById($pet_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**\OpenAPI\Client\Model\Pet**](../Model/Pet.md) - -### Authorization - -[api_key](../../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## updatePet - -> updatePet($pet) - -Update an existing pet - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store - -try { - $apiInstance->updatePet($pet); -} catch (Exception $e) { - echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## updatePetWithForm - -> updatePetWithForm($pet_id, $name, $status) - -Updates a pet in the store with form data - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet_id = 56; // int | ID of pet that needs to be updated -$name = 'name_example'; // string | Updated name of the pet -$status = 'status_example'; // string | Updated status of the pet - -try { - $apiInstance->updatePetWithForm($pet_id, $name, $status); -} catch (Exception $e) { - echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **string**| Updated name of the pet | [optional] - **status** | **string**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## uploadFile - -> \OpenAPI\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file) - -uploads an image - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet_id = 56; // int | ID of pet to update -$additional_metadata = 'additional_metadata_example'; // string | Additional data to pass to server -$file = "/path/to/file.txt"; // \SplFileObject | file to upload - -try { - $result = $apiInstance->uploadFile($pet_id, $additional_metadata, $file); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **string**| Additional data to pass to server | [optional] - **file** | **\SplFileObject****\SplFileObject**| file to upload | [optional] - -### Return type - -[**\OpenAPI\Client\Model\ApiResponse**](../Model/ApiResponse.md) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## uploadFileWithRequiredFile - -> \OpenAPI\Client\Model\ApiResponse uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata) - -uploads an image (required) - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new OpenAPI\Client\Api\PetApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$pet_id = 56; // int | ID of pet to update -$required_file = "/path/to/file.txt"; // \SplFileObject | file to upload -$additional_metadata = 'additional_metadata_example'; // string | Additional data to pass to server - -try { - $result = $apiInstance->uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PetApi->uploadFileWithRequiredFile: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **\SplFileObject****\SplFileObject**| file to upload | - **additional_metadata** | **string**| Additional data to pass to server | [optional] - -### Return type - -[**\OpenAPI\Client\Model\ApiResponse**](../Model/ApiResponse.md) - -### Authorization - -[petstore_auth](../../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md deleted file mode 100644 index 318f68c2c6a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/StoreApi.md +++ /dev/null @@ -1,236 +0,0 @@ -# OpenAPI\Client\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($order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```php -deleteOrder($order_id); -} catch (Exception $e) { - echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **string**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## getInventory - -> map[string,int] getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -```php -setApiKey('api_key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer'); - - -$apiInstance = new OpenAPI\Client\Api\StoreApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->getInventory(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**map[string,int]** - -### Authorization - -[api_key](../../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## getOrderById - -> \OpenAPI\Client\Model\Order getOrderById($order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example - -```php -getOrderById($order_id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**\OpenAPI\Client\Model\Order**](../Model/Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## placeOrder - -> \OpenAPI\Client\Model\Order placeOrder($order) - -Place an order for a pet - -### Example - -```php -placeOrder($order); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**\OpenAPI\Client\Model\Order**](../Model/Order.md)| order placed for purchasing the pet | - -### Return type - -[**\OpenAPI\Client\Model\Order**](../Model/Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md deleted file mode 100644 index 0784a164518..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md +++ /dev/null @@ -1,448 +0,0 @@ -# OpenAPI\Client\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 - -```php -createUser($user); -} catch (Exception $e) { - echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## createUsersWithArrayInput - -> createUsersWithArrayInput($user) - -Creates list of users with given input array - -### Example - -```php -createUsersWithArrayInput($user); -} catch (Exception $e) { - echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## createUsersWithListInput - -> createUsersWithListInput($user) - -Creates list of users with given input array - -### Example - -```php -createUsersWithListInput($user); -} catch (Exception $e) { - echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## deleteUser - -> deleteUser($username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```php -deleteUser($username); -} catch (Exception $e) { - echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## getUserByName - -> \OpenAPI\Client\Model\User getUserByName($username) - -Get user by user name - -### Example - -```php -getUserByName($username); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**\OpenAPI\Client\Model\User**](../Model/User.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## loginUser - -> string loginUser($username, $password) - -Logs user into the system - -### Example - -```php -loginUser($username, $password); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The user name for login | - **password** | **string**| The password for login in clear text | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## logoutUser - -> logoutUser() - -Logs out current logged in user session - -### Example - -```php -logoutUser(); -} catch (Exception $e) { - echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - -## updateUser - -> updateUser($username, $user) - -Updated user - -This can only be done by the logged in user. - -### Example - -```php -updateUser($username, $user); -} catch (Exception $e) { - echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| name that need to be deleted | - **user** | [**\OpenAPI\Client\Model\User**](../Model/User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md deleted file mode 100644 index 8c2be69f694..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/AdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# # AdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_property** | **map[string,string]** | | [optional] -**map_of_map_property** | [**map[string,map[string,string]]**](map.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Animal.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Animal.md deleted file mode 100644 index 026fdd6a1d3..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# # Animal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **string** | | -**color** | **string** | | [optional] [default to 'red'] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ApiResponse.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ApiResponse.md deleted file mode 100644 index ad7e93b6f0a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **string** | | [optional] -**message** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 1b76031a82a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# # ArrayOfArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | [**float[][]**](array.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfNumberOnly.md deleted file mode 100644 index 294930cb2b6..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# # ArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **float[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayTest.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayTest.md deleted file mode 100644 index a150d9cea0d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# # ArrayTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **string[]** | | [optional] -**array_array_of_integer** | [**int[][]**](array.md) | | [optional] -**array_array_of_model** | [**\OpenAPI\Client\Model\ReadOnlyFirst[][]**](array.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Capitalization.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Capitalization.md deleted file mode 100644 index 4166caadef9..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# # Capitalization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **string** | | [optional] -**capital_camel** | **string** | | [optional] -**small_snake** | **string** | | [optional] -**capital_snake** | **string** | | [optional] -**sca_eth_flow_points** | **string** | | [optional] -**att_name** | **string** | Name of the pet | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Cat.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Cat.md deleted file mode 100644 index f9652f72ae1..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Cat.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Cat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/CatAllOf.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/CatAllOf.md deleted file mode 100644 index 0c5312a6144..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# # CatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Category.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Category.md deleted file mode 100644 index eb71223a787..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# # Category - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **string** | | [default to 'default-name'] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ClassModel.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ClassModel.md deleted file mode 100644 index b56b2fa26f6..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ClassModel.md +++ /dev/null @@ -1,11 +0,0 @@ -# # ClassModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Client.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Client.md deleted file mode 100644 index c0f76ca86f2..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Dog.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Dog.md deleted file mode 100644 index d3a9f50ef63..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Dog.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Dog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/DogAllOf.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/DogAllOf.md deleted file mode 100644 index 82f34a6e6c8..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# # DogAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumArrays.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumArrays.md deleted file mode 100644 index 231f4afc15f..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# # EnumArrays - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **string** | | [optional] -**array_enum** | **string[]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumClass.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumClass.md deleted file mode 100644 index dd38a0f0837..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# # EnumClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md deleted file mode 100644 index 9a1ffa8a7e3..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/EnumTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# # EnumTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **string** | | [optional] -**enum_string_required** | **string** | | -**enum_integer** | **int** | | [optional] -**enum_number** | **double** | | [optional] -**outer_enum** | [**\OpenAPI\Client\Model\OuterEnum**](OuterEnum.md) | | [optional] -**outer_enum_integer** | [**\OpenAPI\Client\Model\OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outer_enum_default_value** | [**\OpenAPI\Client\Model\OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outer_enum_integer_default_value** | [**\OpenAPI\Client\Model\OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/File.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/File.md deleted file mode 100644 index 77c48da8031..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/File.md +++ /dev/null @@ -1,11 +0,0 @@ -# # File - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **string** | Test capitalization | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FileSchemaTestClass.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FileSchemaTestClass.md deleted file mode 100644 index b8c5ea236b0..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# # FileSchemaTestClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**\OpenAPI\Client\Model\File**](File.md) | | [optional] -**files** | [**\OpenAPI\Client\Model\File[]**](File.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md deleted file mode 100644 index 9acc83cb6fa..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Foo.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Foo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **string** | | [optional] [default to 'bar'] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md deleted file mode 100644 index b0b8785234a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/FormatTest.md +++ /dev/null @@ -1,25 +0,0 @@ -# # FormatTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **float** | | -**float** | **float** | | [optional] -**double** | **double** | | [optional] -**string** | **string** | | [optional] -**byte** | **string** | | -**binary** | [**\SplFileObject**](\SplFileObject.md) | | [optional] -**date** | [**\DateTime**](\DateTime.md) | | -**date_time** | [**\DateTime**](\DateTime.md) | | [optional] -**uuid** | **string** | | [optional] -**password** | **string** | | -**pattern_with_digits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/HasOnlyReadOnly.md deleted file mode 100644 index 3f4d729d562..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# # HasOnlyReadOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **string** | | [optional] [readonly] -**foo** | **string** | | [optional] [readonly] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md deleted file mode 100644 index b21b3c6d887..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject.md +++ /dev/null @@ -1,12 +0,0 @@ -# # InlineObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | Updated name of the pet | [optional] -**status** | **string** | Updated status of the pet | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md deleted file mode 100644 index 25eb866417b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject1.md +++ /dev/null @@ -1,12 +0,0 @@ -# # InlineObject1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **string** | Additional data to pass to server | [optional] -**file** | [**\SplFileObject**](\SplFileObject.md) | file to upload | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md deleted file mode 100644 index a862611a011..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject2.md +++ /dev/null @@ -1,12 +0,0 @@ -# # InlineObject2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_form_string_array** | **string[]** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **string** | Form parameter enum test (string) | [optional] [default to '-efg'] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md deleted file mode 100644 index 8cd0a80c044..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject3.md +++ /dev/null @@ -1,24 +0,0 @@ -# # InlineObject3 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | None | [optional] -**int32** | **int** | None | [optional] -**int64** | **int** | None | [optional] -**number** | **float** | None | -**float** | **float** | None | [optional] -**double** | **double** | None | -**string** | **string** | None | [optional] -**pattern_without_delimiter** | **string** | None | -**byte** | **string** | None | -**binary** | [**\SplFileObject**](\SplFileObject.md) | None | [optional] -**date** | [**\DateTime**](\DateTime.md) | None | [optional] -**date_time** | [**\DateTime**](\DateTime.md) | None | [optional] -**password** | **string** | None | [optional] -**callback** | **string** | None | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md deleted file mode 100644 index 6a940e80aca..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject4.md +++ /dev/null @@ -1,12 +0,0 @@ -# # InlineObject4 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **string** | field1 | -**param2** | **string** | field2 | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md deleted file mode 100644 index 240eb36860c..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineObject5.md +++ /dev/null @@ -1,12 +0,0 @@ -# # InlineObject5 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **string** | Additional data to pass to server | [optional] -**required_file** | [**\SplFileObject**](\SplFileObject.md) | file to upload | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md deleted file mode 100644 index a00c3247962..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/InlineResponseDefault.md +++ /dev/null @@ -1,11 +0,0 @@ -# # InlineResponseDefault - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**\OpenAPI\Client\Model\Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md deleted file mode 100644 index 221e7ce7139..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# # MapTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | [**map[string,map[string,string]]**](map.md) | | [optional] -**map_of_enum_string** | **map[string,string]** | | [optional] -**direct_map** | **map[string,bool]** | | [optional] -**indirect_map** | **map[string,bool]** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index a8ea4f7a193..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# # MixedPropertiesAndAdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **string** | | [optional] -**date_time** | [**\DateTime**](\DateTime.md) | | [optional] -**map** | [**map[string,\OpenAPI\Client\Model\Animal]**](Animal.md) | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Model200Response.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Model200Response.md deleted file mode 100644 index 7e2a475f327..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Model200Response.md +++ /dev/null @@ -1,12 +0,0 @@ -# # Model200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**class** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelList.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelList.md deleted file mode 100644 index 5c8d3be7d08..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelList.md +++ /dev/null @@ -1,11 +0,0 @@ -# # ModelList - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelReturn.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelReturn.md deleted file mode 100644 index a1b0105d3a9..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ModelReturn.md +++ /dev/null @@ -1,11 +0,0 @@ -# # ModelReturn - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**return** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Name.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Name.md deleted file mode 100644 index a501f9bb0d5..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Name.md +++ /dev/null @@ -1,14 +0,0 @@ -# # Name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**property** | **string** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/NumberOnly.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/NumberOnly.md deleted file mode 100644 index 9495c7bafb8..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# # NumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Order.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Order.md deleted file mode 100644 index 78509578e21..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# # Order - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | [**\DateTime**](\DateTime.md) | | [optional] -**status** | **string** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterComposite.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterComposite.md deleted file mode 100644 index e17e22f1c5c..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterComposite.md +++ /dev/null @@ -1,13 +0,0 @@ -# # OuterComposite - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] -**my_string** | **string** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnum.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnum.md deleted file mode 100644 index 8e65cbf70bb..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# # OuterEnum - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Pet.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Pet.md deleted file mode 100644 index bb2421ea9d6..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# # Pet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**\OpenAPI\Client\Model\Category**](Category.md) | | [optional] -**name** | **string** | | -**photo_urls** | **string[]** | | -**tags** | [**\OpenAPI\Client\Model\Tag[]**](Tag.md) | | [optional] -**status** | **string** | pet status in the store | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ReadOnlyFirst.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ReadOnlyFirst.md deleted file mode 100644 index 40bf46c3ed8..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# # ReadOnlyFirst - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **string** | | [optional] [readonly] -**baz** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialModelName.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialModelName.md deleted file mode 100644 index 55e145b79f0..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# # SpecialModelName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Tag.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Tag.md deleted file mode 100644 index b564d27f748..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/Tag.md +++ /dev/null @@ -1,12 +0,0 @@ -# # Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **string** | | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/User.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/User.md deleted file mode 100644 index 22ca738723b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Model/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# # User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **string** | | [optional] -**first_name** | **string** | | [optional] -**last_name** | **string** | | [optional] -**email** | **string** | | [optional] -**password** | **string** | | [optional] -**phone** | **string** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh b/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh deleted file mode 100644 index ced3be2b0c7..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php deleted file mode 100644 index ecceb4cdc12..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ /dev/null @@ -1,404 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; - } - - /** - * Set the host index - * - * @param int Host index (required) - */ - public function setHostIndex($host_index) - { - $this->hostIndex = $host_index; - } - - /** - * Get the host index - * - * @return Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation call123TestSpecialTags - * - * To test special tags - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Client - */ - public function call123TestSpecialTags($client) - { - list($response) = $this->call123TestSpecialTagsWithHttpInfo($client); - return $response; - } - - /** - * Operation call123TestSpecialTagsWithHttpInfo - * - * To test special tags - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) - */ - public function call123TestSpecialTagsWithHttpInfo($client) - { - $request = $this->call123TestSpecialTagsRequest($client); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Client'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Client', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation call123TestSpecialTagsAsync - * - * To test special tags - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function call123TestSpecialTagsAsync($client) - { - return $this->call123TestSpecialTagsAsyncWithHttpInfo($client) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation call123TestSpecialTagsAsyncWithHttpInfo - * - * To test special tags - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function call123TestSpecialTagsAsyncWithHttpInfo($client) - { - $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->call123TestSpecialTagsRequest($client); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'call123TestSpecialTags' - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function call123TestSpecialTagsRequest($client) - { - // verify the required parameter 'client' is set - if ($client === null || (is_array($client) && count($client) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $client when calling call123TestSpecialTags' - ); - } - - $resourcePath = '/another-fake/dummy'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($client)) { - $_tempBody = $client; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php deleted file mode 100644 index 5c6d9819d6d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ /dev/null @@ -1,4190 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; - } - - /** - * Set the host index - * - * @param int Host index (required) - */ - public function setHostIndex($host_index) - { - $this->hostIndex = $host_index; - } - - /** - * Get the host index - * - * @return Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation fakeHealthGet - * - * Health check endpoint - * - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\HealthCheckResult - */ - public function fakeHealthGet() - { - list($response) = $this->fakeHealthGetWithHttpInfo(); - return $response; - } - - /** - * Operation fakeHealthGetWithHttpInfo - * - * Health check endpoint - * - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\HealthCheckResult, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeHealthGetWithHttpInfo() - { - $request = $this->fakeHealthGetRequest(); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\HealthCheckResult' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\HealthCheckResult', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\HealthCheckResult'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\HealthCheckResult', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation fakeHealthGetAsync - * - * Health check endpoint - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeHealthGetAsync() - { - return $this->fakeHealthGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeHealthGetAsyncWithHttpInfo - * - * Health check endpoint - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeHealthGetAsyncWithHttpInfo() - { - $returnType = '\OpenAPI\Client\Model\HealthCheckResult'; - $request = $this->fakeHealthGetRequest(); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeHealthGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function fakeHealthGetRequest() - { - - $resourcePath = '/fake/health'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation fakeHttpSignatureTest - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null) - { - $this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1); - } - - /** - * Operation fakeHttpSignatureTestWithHttpInfo - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header_1 = null) - { - $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation fakeHttpSignatureTestAsync - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeHttpSignatureTestAsync($pet, $query_1 = null, $header_1 = null) - { - return $this->fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1, $header_1) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeHttpSignatureTestAsyncWithHttpInfo - * - * test http signature authentication - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null) - { - $returnType = ''; - $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeHttpSignatureTest' - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * @param string $query_1 query parameter (optional) - * @param string $header_1 header parameter (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null) - { - // verify the required parameter 'pet' is set - if ($pet === null || (is_array($pet) && count($pet) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet when calling fakeHttpSignatureTest' - ); - } - - $resourcePath = '/fake/http-signature-test'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($query_1 !== null) { - if('form' === 'form' && is_array($query_1)) { - foreach($query_1 as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['query_1'] = $query_1; - } - } - - // header params - if ($header_1 !== null) { - $headerParams['header_1'] = ObjectSerializer::toHeaderValue($header_1); - } - - - // body params - $_tempBody = null; - if (isset($pet)) { - $_tempBody = $pet; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json', 'application/xml'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation fakeOuterBooleanSerialize - * - * @param bool $body Input boolean as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return bool - */ - public function fakeOuterBooleanSerialize($body = null) - { - list($response) = $this->fakeOuterBooleanSerializeWithHttpInfo($body); - return $response; - } - - /** - * Operation fakeOuterBooleanSerializeWithHttpInfo - * - * @param bool $body Input boolean as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of bool, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeOuterBooleanSerializeWithHttpInfo($body = null) - { - $request = $this->fakeOuterBooleanSerializeRequest($body); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('bool' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, 'bool', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'bool'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'bool', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation fakeOuterBooleanSerializeAsync - * - * - * - * @param bool $body Input boolean as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterBooleanSerializeAsync($body = null) - { - return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeOuterBooleanSerializeAsyncWithHttpInfo - * - * - * - * @param bool $body Input boolean as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterBooleanSerializeAsyncWithHttpInfo($body = null) - { - $returnType = 'bool'; - $request = $this->fakeOuterBooleanSerializeRequest($body); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeOuterBooleanSerialize' - * - * @param bool $body Input boolean as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function fakeOuterBooleanSerializeRequest($body = null) - { - - $resourcePath = '/fake/outer/boolean'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation fakeOuterCompositeSerialize - * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\OuterComposite - */ - public function fakeOuterCompositeSerialize($outer_composite = null) - { - list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($outer_composite); - return $response; - } - - /** - * Operation fakeOuterCompositeSerializeWithHttpInfo - * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) - { - $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OuterComposite', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\OuterComposite'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\OuterComposite', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation fakeOuterCompositeSerializeAsync - * - * - * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterCompositeSerializeAsync($outer_composite = null) - { - return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeOuterCompositeSerializeAsyncWithHttpInfo - * - * - * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite = null) - { - $returnType = '\OpenAPI\Client\Model\OuterComposite'; - $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeOuterCompositeSerialize' - * - * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function fakeOuterCompositeSerializeRequest($outer_composite = null) - { - - $resourcePath = '/fake/outer/composite'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($outer_composite)) { - $_tempBody = $outer_composite; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation fakeOuterNumberSerialize - * - * @param float $body Input number as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return float - */ - public function fakeOuterNumberSerialize($body = null) - { - list($response) = $this->fakeOuterNumberSerializeWithHttpInfo($body); - return $response; - } - - /** - * Operation fakeOuterNumberSerializeWithHttpInfo - * - * @param float $body Input number as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of float, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeOuterNumberSerializeWithHttpInfo($body = null) - { - $request = $this->fakeOuterNumberSerializeRequest($body); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('float' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, 'float', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'float'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'float', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation fakeOuterNumberSerializeAsync - * - * - * - * @param float $body Input number as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterNumberSerializeAsync($body = null) - { - return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeOuterNumberSerializeAsyncWithHttpInfo - * - * - * - * @param float $body Input number as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterNumberSerializeAsyncWithHttpInfo($body = null) - { - $returnType = 'float'; - $request = $this->fakeOuterNumberSerializeRequest($body); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeOuterNumberSerialize' - * - * @param float $body Input number as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function fakeOuterNumberSerializeRequest($body = null) - { - - $resourcePath = '/fake/outer/number'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation fakeOuterStringSerialize - * - * @param string $body Input string as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function fakeOuterStringSerialize($body = null) - { - list($response) = $this->fakeOuterStringSerializeWithHttpInfo($body); - return $response; - } - - /** - * Operation fakeOuterStringSerializeWithHttpInfo - * - * @param string $body Input string as post body (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) - */ - public function fakeOuterStringSerializeWithHttpInfo($body = null) - { - $request = $this->fakeOuterStringSerializeRequest($body); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('string' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, 'string', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'string'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'string', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation fakeOuterStringSerializeAsync - * - * - * - * @param string $body Input string as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterStringSerializeAsync($body = null) - { - return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation fakeOuterStringSerializeAsyncWithHttpInfo - * - * - * - * @param string $body Input string as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function fakeOuterStringSerializeAsyncWithHttpInfo($body = null) - { - $returnType = 'string'; - $request = $this->fakeOuterStringSerializeRequest($body); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'fakeOuterStringSerialize' - * - * @param string $body Input string as post body (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function fakeOuterStringSerializeRequest($body = null) - { - - $resourcePath = '/fake/outer/string'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testBodyWithFileSchema - * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class file_schema_test_class (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testBodyWithFileSchema($file_schema_test_class) - { - $this->testBodyWithFileSchemaWithHttpInfo($file_schema_test_class); - } - - /** - * Operation testBodyWithFileSchemaWithHttpInfo - * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) - { - $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testBodyWithFileSchemaAsync - * - * - * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testBodyWithFileSchemaAsync($file_schema_test_class) - { - return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testBodyWithFileSchemaAsyncWithHttpInfo - * - * - * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) - { - $returnType = ''; - $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testBodyWithFileSchema' - * - * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testBodyWithFileSchemaRequest($file_schema_test_class) - { - // verify the required parameter 'file_schema_test_class' is set - if ($file_schema_test_class === null || (is_array($file_schema_test_class) && count($file_schema_test_class) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema' - ); - } - - $resourcePath = '/fake/body-with-file-schema'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($file_schema_test_class)) { - $_tempBody = $file_schema_test_class; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testBodyWithQueryParams - * - * @param string $query query (required) - * @param \OpenAPI\Client\Model\User $user user (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testBodyWithQueryParams($query, $user) - { - $this->testBodyWithQueryParamsWithHttpInfo($query, $user); - } - - /** - * Operation testBodyWithQueryParamsWithHttpInfo - * - * @param string $query (required) - * @param \OpenAPI\Client\Model\User $user (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testBodyWithQueryParamsWithHttpInfo($query, $user) - { - $request = $this->testBodyWithQueryParamsRequest($query, $user); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testBodyWithQueryParamsAsync - * - * - * - * @param string $query (required) - * @param \OpenAPI\Client\Model\User $user (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testBodyWithQueryParamsAsync($query, $user) - { - return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testBodyWithQueryParamsAsyncWithHttpInfo - * - * - * - * @param string $query (required) - * @param \OpenAPI\Client\Model\User $user (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) - { - $returnType = ''; - $request = $this->testBodyWithQueryParamsRequest($query, $user); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testBodyWithQueryParams' - * - * @param string $query (required) - * @param \OpenAPI\Client\Model\User $user (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testBodyWithQueryParamsRequest($query, $user) - { - // verify the required parameter 'query' is set - if ($query === null || (is_array($query) && count($query) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $query when calling testBodyWithQueryParams' - ); - } - // verify the required parameter 'user' is set - if ($user === null || (is_array($user) && count($user) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user when calling testBodyWithQueryParams' - ); - } - - $resourcePath = '/fake/body-with-query-params'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($query !== null) { - if('form' === 'form' && is_array($query)) { - foreach($query as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['query'] = $query; - } - } - - - - // body params - $_tempBody = null; - if (isset($user)) { - $_tempBody = $user; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testClientModel - * - * To test \"client\" model - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Client - */ - public function testClientModel($client) - { - list($response) = $this->testClientModelWithHttpInfo($client); - return $response; - } - - /** - * Operation testClientModelWithHttpInfo - * - * To test \"client\" model - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) - */ - public function testClientModelWithHttpInfo($client) - { - $request = $this->testClientModelRequest($client); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Client'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Client', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation testClientModelAsync - * - * To test \"client\" model - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testClientModelAsync($client) - { - return $this->testClientModelAsyncWithHttpInfo($client) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testClientModelAsyncWithHttpInfo - * - * To test \"client\" model - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testClientModelAsyncWithHttpInfo($client) - { - $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testClientModelRequest($client); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testClientModel' - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testClientModelRequest($client) - { - // verify the required parameter 'client' is set - if ($client === null || (is_array($client) && count($client) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $client when calling testClientModel' - ); - } - - $resourcePath = '/fake'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($client)) { - $_tempBody = $client; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testEndpointParameters - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - $this->testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); - } - - /** - * Operation testEndpointParametersWithHttpInfo - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testEndpointParametersAsync - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testEndpointParametersAsyncWithHttpInfo - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - $returnType = ''; - $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testEndpointParameters' - * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param \SplFileObject $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - // verify the required parameter 'number' is set - if ($number === null || (is_array($number) && count($number) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $number when calling testEndpointParameters' - ); - } - if ($number > 543.2) { - throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.'); - } - if ($number < 32.1) { - throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.'); - } - - // verify the required parameter 'double' is set - if ($double === null || (is_array($double) && count($double) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $double when calling testEndpointParameters' - ); - } - if ($double > 123.4) { - throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.'); - } - if ($double < 67.8) { - throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.'); - } - - // verify the required parameter 'pattern_without_delimiter' is set - if ($pattern_without_delimiter === null || (is_array($pattern_without_delimiter) && count($pattern_without_delimiter) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters' - ); - } - if (!preg_match("/^[A-Z].*/", $pattern_without_delimiter)) { - throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/."); - } - - // verify the required parameter 'byte' is set - if ($byte === null || (is_array($byte) && count($byte) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $byte when calling testEndpointParameters' - ); - } - if ($integer !== null && $integer > 100) { - throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.'); - } - if ($integer !== null && $integer < 10) { - throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); - } - - if ($int32 !== null && $int32 > 200) { - throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.'); - } - if ($int32 !== null && $int32 < 20) { - throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.'); - } - - if ($float !== null && $float > 987.6) { - throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.'); - } - - if ($string !== null && !preg_match("/[a-z]/i", $string)) { - throw new \InvalidArgumentException("invalid value for \"string\" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i."); - } - - if ($password !== null && strlen($password) > 64) { - throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.'); - } - if ($password !== null && strlen($password) < 10) { - throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); - } - - - $resourcePath = '/fake'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // form params - if ($integer !== null) { - $formParams['integer'] = ObjectSerializer::toFormValue($integer); - } - // form params - if ($int32 !== null) { - $formParams['int32'] = ObjectSerializer::toFormValue($int32); - } - // form params - if ($int64 !== null) { - $formParams['int64'] = ObjectSerializer::toFormValue($int64); - } - // form params - if ($number !== null) { - $formParams['number'] = ObjectSerializer::toFormValue($number); - } - // form params - if ($float !== null) { - $formParams['float'] = ObjectSerializer::toFormValue($float); - } - // form params - if ($double !== null) { - $formParams['double'] = ObjectSerializer::toFormValue($double); - } - // form params - if ($string !== null) { - $formParams['string'] = ObjectSerializer::toFormValue($string); - } - // form params - if ($pattern_without_delimiter !== null) { - $formParams['pattern_without_delimiter'] = ObjectSerializer::toFormValue($pattern_without_delimiter); - } - // form params - if ($byte !== null) { - $formParams['byte'] = ObjectSerializer::toFormValue($byte); - } - // form params - if ($binary !== null) { - $multipart = true; - $formParams['binary'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($binary), 'rb'); - } - // form params - if ($date !== null) { - $formParams['date'] = ObjectSerializer::toFormValue($date); - } - // form params - if ($date_time !== null) { - $formParams['dateTime'] = ObjectSerializer::toFormValue($date_time); - } - // form params - if ($password !== null) { - $formParams['password'] = ObjectSerializer::toFormValue($password); - } - // form params - if ($callback !== null) { - $formParams['callback'] = ObjectSerializer::toFormValue($callback); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testEnumParameters - * - * To test enum parameters - * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testEnumParameters($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - $this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); - } - - /** - * Operation testEnumParametersWithHttpInfo - * - * To test enum parameters - * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testEnumParametersAsync - * - * To test enum parameters - * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testEnumParametersAsyncWithHttpInfo - * - * To test enum parameters - * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - $returnType = ''; - $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testEnumParameters' - * - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to '-efg') - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to '-efg') - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') - * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - - $resourcePath = '/fake'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($enum_query_string_array !== null) { - if('form' === 'form' && is_array($enum_query_string_array)) { - foreach($enum_query_string_array as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['enum_query_string_array'] = $enum_query_string_array; - } - } - // query params - if ($enum_query_string !== null) { - if('form' === 'form' && is_array($enum_query_string)) { - foreach($enum_query_string as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['enum_query_string'] = $enum_query_string; - } - } - // query params - if ($enum_query_integer !== null) { - if('form' === 'form' && is_array($enum_query_integer)) { - foreach($enum_query_integer as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['enum_query_integer'] = $enum_query_integer; - } - } - // query params - if ($enum_query_double !== null) { - if('form' === 'form' && is_array($enum_query_double)) { - foreach($enum_query_double as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['enum_query_double'] = $enum_query_double; - } - } - - // header params - if (is_array($enum_header_string_array)) { - $enum_header_string_array = ObjectSerializer::serializeCollection($enum_header_string_array, 'csv'); - } - if ($enum_header_string_array !== null) { - $headerParams['enum_header_string_array'] = ObjectSerializer::toHeaderValue($enum_header_string_array); - } - // header params - if ($enum_header_string !== null) { - $headerParams['enum_header_string'] = ObjectSerializer::toHeaderValue($enum_header_string); - } - - - // form params - if ($enum_form_string_array !== null) { - $formParams['enum_form_string_array'] = ObjectSerializer::toFormValue($enum_form_string_array); - } - // form params - if ($enum_form_string !== null) { - $formParams['enum_form_string'] = ObjectSerializer::toFormValue($enum_form_string); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testGroupParameters - * - * Fake endpoint to test group parameters (optional) - * - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * - * @param int $required_string_group Required String in group parameters (required) - * @param bool $required_boolean_group Required Boolean in group parameters (required) - * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testGroupParameters($associative_array) - { - $this->testGroupParametersWithHttpInfo($associative_array); - } - - /** - * Operation testGroupParametersWithHttpInfo - * - * Fake endpoint to test group parameters (optional) - * - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * - * @param int $required_string_group Required String in group parameters (required) - * @param bool $required_boolean_group Required Boolean in group parameters (required) - * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testGroupParametersWithHttpInfo($associative_array) - { - $request = $this->testGroupParametersRequest($associative_array); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testGroupParametersAsync - * - * Fake endpoint to test group parameters (optional) - * - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * - * @param int $required_string_group Required String in group parameters (required) - * @param bool $required_boolean_group Required Boolean in group parameters (required) - * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testGroupParametersAsync($associative_array) - { - return $this->testGroupParametersAsyncWithHttpInfo($associative_array) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testGroupParametersAsyncWithHttpInfo - * - * Fake endpoint to test group parameters (optional) - * - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * - * @param int $required_string_group Required String in group parameters (required) - * @param bool $required_boolean_group Required Boolean in group parameters (required) - * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testGroupParametersAsyncWithHttpInfo($associative_array) - { - $returnType = ''; - $request = $this->testGroupParametersRequest($associative_array); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testGroupParameters' - * - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * - * @param int $required_string_group Required String in group parameters (required) - * @param bool $required_boolean_group Required Boolean in group parameters (required) - * @param int $required_int64_group Required Integer in group parameters (required) - * @param int $string_group String in group parameters (optional) - * @param bool $boolean_group Boolean in group parameters (optional) - * @param int $int64_group Integer in group parameters (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testGroupParametersRequest($associative_array) - { - // unbox the parameters from the associative array - $required_string_group = array_key_exists('required_string_group', $associative_array) ? $associative_array['required_string_group'] : null; - $required_boolean_group = array_key_exists('required_boolean_group', $associative_array) ? $associative_array['required_boolean_group'] : null; - $required_int64_group = array_key_exists('required_int64_group', $associative_array) ? $associative_array['required_int64_group'] : null; - $string_group = array_key_exists('string_group', $associative_array) ? $associative_array['string_group'] : null; - $boolean_group = array_key_exists('boolean_group', $associative_array) ? $associative_array['boolean_group'] : null; - $int64_group = array_key_exists('int64_group', $associative_array) ? $associative_array['int64_group'] : null; - - // verify the required parameter 'required_string_group' is set - if ($required_string_group === null || (is_array($required_string_group) && count($required_string_group) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $required_string_group when calling testGroupParameters' - ); - } - // verify the required parameter 'required_boolean_group' is set - if ($required_boolean_group === null || (is_array($required_boolean_group) && count($required_boolean_group) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $required_boolean_group when calling testGroupParameters' - ); - } - // verify the required parameter 'required_int64_group' is set - if ($required_int64_group === null || (is_array($required_int64_group) && count($required_int64_group) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $required_int64_group when calling testGroupParameters' - ); - } - - $resourcePath = '/fake'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($required_string_group !== null) { - if('form' === 'form' && is_array($required_string_group)) { - foreach($required_string_group as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['required_string_group'] = $required_string_group; - } - } - // query params - if ($required_int64_group !== null) { - if('form' === 'form' && is_array($required_int64_group)) { - foreach($required_int64_group as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['required_int64_group'] = $required_int64_group; - } - } - // query params - if ($string_group !== null) { - if('form' === 'form' && is_array($string_group)) { - foreach($string_group as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['string_group'] = $string_group; - } - } - // query params - if ($int64_group !== null) { - if('form' === 'form' && is_array($int64_group)) { - foreach($int64_group as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['int64_group'] = $int64_group; - } - } - - // header params - if ($required_boolean_group !== null) { - $headerParams['required_boolean_group'] = ObjectSerializer::toHeaderValue($required_boolean_group); - } - // header params - if ($boolean_group !== null) { - $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue($boolean_group); - } - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires Bearer (JWT) authentication (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testInlineAdditionalProperties - * - * test inline additionalProperties - * - * @param map[string,string] $request_body request body (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testInlineAdditionalProperties($request_body) - { - $this->testInlineAdditionalPropertiesWithHttpInfo($request_body); - } - - /** - * Operation testInlineAdditionalPropertiesWithHttpInfo - * - * test inline additionalProperties - * - * @param map[string,string] $request_body request body (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testInlineAdditionalPropertiesWithHttpInfo($request_body) - { - $request = $this->testInlineAdditionalPropertiesRequest($request_body); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testInlineAdditionalPropertiesAsync - * - * test inline additionalProperties - * - * @param map[string,string] $request_body request body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testInlineAdditionalPropertiesAsync($request_body) - { - return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testInlineAdditionalPropertiesAsyncWithHttpInfo - * - * test inline additionalProperties - * - * @param map[string,string] $request_body request body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) - { - $returnType = ''; - $request = $this->testInlineAdditionalPropertiesRequest($request_body); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testInlineAdditionalProperties' - * - * @param map[string,string] $request_body request body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testInlineAdditionalPropertiesRequest($request_body) - { - // verify the required parameter 'request_body' is set - if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $request_body when calling testInlineAdditionalProperties' - ); - } - - $resourcePath = '/fake/inline-additionalProperties'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($request_body)) { - $_tempBody = $request_body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testJsonFormData - * - * test json serialization of form data - * - * @param string $param field1 (required) - * @param string $param2 field2 (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testJsonFormData($param, $param2) - { - $this->testJsonFormDataWithHttpInfo($param, $param2); - } - - /** - * Operation testJsonFormDataWithHttpInfo - * - * test json serialization of form data - * - * @param string $param field1 (required) - * @param string $param2 field2 (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testJsonFormDataWithHttpInfo($param, $param2) - { - $request = $this->testJsonFormDataRequest($param, $param2); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testJsonFormDataAsync - * - * test json serialization of form data - * - * @param string $param field1 (required) - * @param string $param2 field2 (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testJsonFormDataAsync($param, $param2) - { - return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testJsonFormDataAsyncWithHttpInfo - * - * test json serialization of form data - * - * @param string $param field1 (required) - * @param string $param2 field2 (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testJsonFormDataAsyncWithHttpInfo($param, $param2) - { - $returnType = ''; - $request = $this->testJsonFormDataRequest($param, $param2); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testJsonFormData' - * - * @param string $param field1 (required) - * @param string $param2 field2 (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testJsonFormDataRequest($param, $param2) - { - // verify the required parameter 'param' is set - if ($param === null || (is_array($param) && count($param) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $param when calling testJsonFormData' - ); - } - // verify the required parameter 'param2' is set - if ($param2 === null || (is_array($param2) && count($param2) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $param2 when calling testJsonFormData' - ); - } - - $resourcePath = '/fake/jsonFormData'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // form params - if ($param !== null) { - $formParams['param'] = ObjectSerializer::toFormValue($param); - } - // form params - if ($param2 !== null) { - $formParams['param2'] = ObjectSerializer::toFormValue($param2); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation testQueryParameterCollectionFormat - * - * @param string[] $pipe pipe (required) - * @param string[] $ioutil ioutil (required) - * @param string[] $http http (required) - * @param string[] $url url (required) - * @param string[] $context context (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) - { - $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context); - } - - /** - * Operation testQueryParameterCollectionFormatWithHttpInfo - * - * @param string[] $pipe (required) - * @param string[] $ioutil (required) - * @param string[] $http (required) - * @param string[] $url (required) - * @param string[] $context (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context) - { - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation testQueryParameterCollectionFormatAsync - * - * - * - * @param string[] $pipe (required) - * @param string[] $ioutil (required) - * @param string[] $http (required) - * @param string[] $url (required) - * @param string[] $context (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context) - { - return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testQueryParameterCollectionFormatAsyncWithHttpInfo - * - * - * - * @param string[] $pipe (required) - * @param string[] $ioutil (required) - * @param string[] $http (required) - * @param string[] $url (required) - * @param string[] $context (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) - { - $returnType = ''; - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testQueryParameterCollectionFormat' - * - * @param string[] $pipe (required) - * @param string[] $ioutil (required) - * @param string[] $http (required) - * @param string[] $url (required) - * @param string[] $context (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context) - { - // verify the required parameter 'pipe' is set - if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pipe when calling testQueryParameterCollectionFormat' - ); - } - // verify the required parameter 'ioutil' is set - if ($ioutil === null || (is_array($ioutil) && count($ioutil) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat' - ); - } - // verify the required parameter 'http' is set - if ($http === null || (is_array($http) && count($http) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $http when calling testQueryParameterCollectionFormat' - ); - } - // verify the required parameter 'url' is set - if ($url === null || (is_array($url) && count($url) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $url when calling testQueryParameterCollectionFormat' - ); - } - // verify the required parameter 'context' is set - if ($context === null || (is_array($context) && count($context) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' - ); - } - - $resourcePath = '/fake/test-query-paramters'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($pipe !== null) { - if('form' === 'form' && is_array($pipe)) { - foreach($pipe as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pipe'] = $pipe; - } - } - // query params - if (is_array($ioutil)) { - $ioutil = ObjectSerializer::serializeCollection($ioutil, 'form', true); - } - if ($ioutil !== null) { - $queryParams['ioutil'] = $ioutil; - } - // query params - if (is_array($http)) { - $http = ObjectSerializer::serializeCollection($http, 'spaceDelimited', true); - } - if ($http !== null) { - $queryParams['http'] = $http; - } - // query params - if (is_array($url)) { - $url = ObjectSerializer::serializeCollection($url, 'form', true); - } - if ($url !== null) { - $queryParams['url'] = $url; - } - // query params - if ($context !== null) { - if('form' === 'form' && is_array($context)) { - foreach($context as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['context'] = $context; - } - } - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php deleted file mode 100644 index cc37aa252bc..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ /dev/null @@ -1,409 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; - } - - /** - * Set the host index - * - * @param int Host index (required) - */ - public function setHostIndex($host_index) - { - $this->hostIndex = $host_index; - } - - /** - * Get the host index - * - * @return Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation testClassname - * - * To test class name in snake case - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Client - */ - public function testClassname($client) - { - list($response) = $this->testClassnameWithHttpInfo($client); - return $response; - } - - /** - * Operation testClassnameWithHttpInfo - * - * To test class name in snake case - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) - */ - public function testClassnameWithHttpInfo($client) - { - $request = $this->testClassnameRequest($client); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Client'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Client', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation testClassnameAsync - * - * To test class name in snake case - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testClassnameAsync($client) - { - return $this->testClassnameAsyncWithHttpInfo($client) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation testClassnameAsyncWithHttpInfo - * - * To test class name in snake case - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function testClassnameAsyncWithHttpInfo($client) - { - $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testClassnameRequest($client); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'testClassname' - * - * @param \OpenAPI\Client\Model\Client $client client model (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function testClassnameRequest($client) - { - // verify the required parameter 'client' is set - if ($client === null || (is_array($client) && count($client) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $client when calling testClassname' - ); - } - - $resourcePath = '/fake_classname_test'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($client)) { - $_tempBody = $client; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('api_key_query'); - if ($apiKey !== null) { - $queryParams['api_key_query'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php deleted file mode 100644 index de4bc86849f..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ /dev/null @@ -1,2549 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; - } - - /** - * Set the host index - * - * @param int Host index (required) - */ - public function setHostIndex($host_index) - { - $this->hostIndex = $host_index; - } - - /** - * Get the host index - * - * @return Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation addPet - * - * Add a new pet to the store - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function addPet($pet) - { - $this->addPetWithHttpInfo($pet); - } - - /** - * Operation addPetWithHttpInfo - * - * Add a new pet to the store - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function addPetWithHttpInfo($pet) - { - $request = $this->addPetRequest($pet); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation addPetAsync - * - * Add a new pet to the store - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function addPetAsync($pet) - { - return $this->addPetAsyncWithHttpInfo($pet) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation addPetAsyncWithHttpInfo - * - * Add a new pet to the store - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function addPetAsyncWithHttpInfo($pet) - { - $returnType = ''; - $request = $this->addPetRequest($pet); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'addPet' - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function addPetRequest($pet) - { - // verify the required parameter 'pet' is set - if ($pet === null || (is_array($pet) && count($pet) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet when calling addPet' - ); - } - - $resourcePath = '/pet'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($pet)) { - $_tempBody = $pet; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json', 'application/xml'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHosts = ["http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2"]; - if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { - throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); - } - $operationHost = $operationHosts[$this->hostIndex]; - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deletePet - * - * Deletes a pet - * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key api_key (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function deletePet($pet_id, $api_key = null) - { - $this->deletePetWithHttpInfo($pet_id, $api_key); - } - - /** - * Operation deletePetWithHttpInfo - * - * Deletes a pet - * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deletePetWithHttpInfo($pet_id, $api_key = null) - { - $request = $this->deletePetRequest($pet_id, $api_key); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation deletePetAsync - * - * Deletes a pet - * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deletePetAsync($pet_id, $api_key = null) - { - return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deletePetAsyncWithHttpInfo - * - * Deletes a pet - * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null) - { - $returnType = ''; - $request = $this->deletePetRequest($pet_id, $api_key); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deletePet' - * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function deletePetRequest($pet_id, $api_key = null) - { - // verify the required parameter 'pet_id' is set - if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet_id when calling deletePet' - ); - } - - $resourcePath = '/pet/{petId}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // header params - if ($api_key !== null) { - $headerParams['api_key'] = ObjectSerializer::toHeaderValue($api_key); - } - - // path params - if ($pet_id !== null) { - $resourcePath = str_replace( - '{' . 'petId' . '}', - ObjectSerializer::toPathValue($pet_id), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation findPetsByStatus - * - * Finds Pets by status - * - * @param string[] $status Status values that need to be considered for filter (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Pet[] - */ - public function findPetsByStatus($status) - { - list($response) = $this->findPetsByStatusWithHttpInfo($status); - return $response; - } - - /** - * Operation findPetsByStatusWithHttpInfo - * - * Finds Pets by status - * - * @param string[] $status Status values that need to be considered for filter (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) - */ - public function findPetsByStatusWithHttpInfo($status) - { - $request = $this->findPetsByStatusRequest($status); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Pet[]'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Pet[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation findPetsByStatusAsync - * - * Finds Pets by status - * - * @param string[] $status Status values that need to be considered for filter (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function findPetsByStatusAsync($status) - { - return $this->findPetsByStatusAsyncWithHttpInfo($status) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation findPetsByStatusAsyncWithHttpInfo - * - * Finds Pets by status - * - * @param string[] $status Status values that need to be considered for filter (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function findPetsByStatusAsyncWithHttpInfo($status) - { - $returnType = '\OpenAPI\Client\Model\Pet[]'; - $request = $this->findPetsByStatusRequest($status); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'findPetsByStatus' - * - * @param string[] $status Status values that need to be considered for filter (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function findPetsByStatusRequest($status) - { - // verify the required parameter 'status' is set - if ($status === null || (is_array($status) && count($status) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $status when calling findPetsByStatus' - ); - } - - $resourcePath = '/pet/findByStatus'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if (is_array($status)) { - $status = ObjectSerializer::serializeCollection($status, 'form', true); - } - if ($status !== null) { - $queryParams['status'] = $status; - } - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation findPetsByTags - * - * Finds Pets by tags - * - * @param string[] $tags Tags to filter by (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Pet[] - */ - public function findPetsByTags($tags) - { - list($response) = $this->findPetsByTagsWithHttpInfo($tags); - return $response; - } - - /** - * Operation findPetsByTagsWithHttpInfo - * - * Finds Pets by tags - * - * @param string[] $tags Tags to filter by (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) - */ - public function findPetsByTagsWithHttpInfo($tags) - { - $request = $this->findPetsByTagsRequest($tags); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Pet[]'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Pet[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation findPetsByTagsAsync - * - * Finds Pets by tags - * - * @param string[] $tags Tags to filter by (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function findPetsByTagsAsync($tags) - { - return $this->findPetsByTagsAsyncWithHttpInfo($tags) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation findPetsByTagsAsyncWithHttpInfo - * - * Finds Pets by tags - * - * @param string[] $tags Tags to filter by (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function findPetsByTagsAsyncWithHttpInfo($tags) - { - $returnType = '\OpenAPI\Client\Model\Pet[]'; - $request = $this->findPetsByTagsRequest($tags); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'findPetsByTags' - * - * @param string[] $tags Tags to filter by (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function findPetsByTagsRequest($tags) - { - // verify the required parameter 'tags' is set - if ($tags === null || (is_array($tags) && count($tags) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tags when calling findPetsByTags' - ); - } - - $resourcePath = '/pet/findByTags'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, 'form', true); - } - if ($tags !== null) { - $queryParams['tags'] = $tags; - } - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getPetById - * - * Find pet by ID - * - * @param int $pet_id ID of pet to return (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Pet - */ - public function getPetById($pet_id) - { - list($response) = $this->getPetByIdWithHttpInfo($pet_id); - return $response; - } - - /** - * Operation getPetByIdWithHttpInfo - * - * Find pet by ID - * - * @param int $pet_id ID of pet to return (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings) - */ - public function getPetByIdWithHttpInfo($pet_id) - { - $request = $this->getPetByIdRequest($pet_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Pet'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Pet', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getPetByIdAsync - * - * Find pet by ID - * - * @param int $pet_id ID of pet to return (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getPetByIdAsync($pet_id) - { - return $this->getPetByIdAsyncWithHttpInfo($pet_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getPetByIdAsyncWithHttpInfo - * - * Find pet by ID - * - * @param int $pet_id ID of pet to return (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getPetByIdAsyncWithHttpInfo($pet_id) - { - $returnType = '\OpenAPI\Client\Model\Pet'; - $request = $this->getPetByIdRequest($pet_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getPetById' - * - * @param int $pet_id ID of pet to return (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function getPetByIdRequest($pet_id) - { - // verify the required parameter 'pet_id' is set - if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet_id when calling getPetById' - ); - } - - $resourcePath = '/pet/{petId}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($pet_id !== null) { - $resourcePath = str_replace( - '{' . 'petId' . '}', - ObjectSerializer::toPathValue($pet_id), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('api_key'); - if ($apiKey !== null) { - $headers['api_key'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation updatePet - * - * Update an existing pet - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function updatePet($pet) - { - $this->updatePetWithHttpInfo($pet); - } - - /** - * Operation updatePetWithHttpInfo - * - * Update an existing pet - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function updatePetWithHttpInfo($pet) - { - $request = $this->updatePetRequest($pet); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation updatePetAsync - * - * Update an existing pet - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updatePetAsync($pet) - { - return $this->updatePetAsyncWithHttpInfo($pet) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation updatePetAsyncWithHttpInfo - * - * Update an existing pet - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updatePetAsyncWithHttpInfo($pet) - { - $returnType = ''; - $request = $this->updatePetRequest($pet); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'updatePet' - * - * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. - * URL: http://petstore.swagger.io/v2 - * URL: http://path-server-test.petstore.local/v2 - * - * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function updatePetRequest($pet) - { - // verify the required parameter 'pet' is set - if ($pet === null || (is_array($pet) && count($pet) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet when calling updatePet' - ); - } - - $resourcePath = '/pet'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($pet)) { - $_tempBody = $pet; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json', 'application/xml'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHosts = ["http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2"]; - if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { - throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); - } - $operationHost = $operationHosts[$this->hostIndex]; - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PUT', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation updatePetWithForm - * - * Updates a pet in the store with form data - * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function updatePetWithForm($pet_id, $name = null, $status = null) - { - $this->updatePetWithFormWithHttpInfo($pet_id, $name, $status); - } - - /** - * Operation updatePetWithFormWithHttpInfo - * - * Updates a pet in the store with form data - * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) - { - $request = $this->updatePetWithFormRequest($pet_id, $name, $status); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation updatePetWithFormAsync - * - * Updates a pet in the store with form data - * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updatePetWithFormAsync($pet_id, $name = null, $status = null) - { - return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation updatePetWithFormAsyncWithHttpInfo - * - * Updates a pet in the store with form data - * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null) - { - $returnType = ''; - $request = $this->updatePetWithFormRequest($pet_id, $name, $status); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'updatePetWithForm' - * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function updatePetWithFormRequest($pet_id, $name = null, $status = null) - { - // verify the required parameter 'pet_id' is set - if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet_id when calling updatePetWithForm' - ); - } - - $resourcePath = '/pet/{petId}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($pet_id !== null) { - $resourcePath = str_replace( - '{' . 'petId' . '}', - ObjectSerializer::toPathValue($pet_id), - $resourcePath - ); - } - - // form params - if ($name !== null) { - $formParams['name'] = ObjectSerializer::toFormValue($name); - } - // form params - if ($status !== null) { - $formParams['status'] = ObjectSerializer::toFormValue($status); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation uploadFile - * - * uploads an image - * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\ApiResponse - */ - public function uploadFile($pet_id, $additional_metadata = null, $file = null) - { - list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file); - return $response; - } - - /** - * Operation uploadFileWithHttpInfo - * - * uploads an image - * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) - { - $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation uploadFileAsync - * - * uploads an image - * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null) - { - return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation uploadFileAsyncWithHttpInfo - * - * uploads an image - * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null) - { - $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'uploadFile' - * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function uploadFileRequest($pet_id, $additional_metadata = null, $file = null) - { - // verify the required parameter 'pet_id' is set - if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet_id when calling uploadFile' - ); - } - - $resourcePath = '/pet/{petId}/uploadImage'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($pet_id !== null) { - $resourcePath = str_replace( - '{' . 'petId' . '}', - ObjectSerializer::toPathValue($pet_id), - $resourcePath - ); - } - - // form params - if ($additional_metadata !== null) { - $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); - } - // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation uploadFileWithRequiredFile - * - * uploads an image (required) - * - * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\ApiResponse - */ - public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null) - { - list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata); - return $response; - } - - /** - * Operation uploadFileWithRequiredFileWithHttpInfo - * - * uploads an image (required) - * - * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null) - { - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\ApiResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation uploadFileWithRequiredFileAsync - * - * uploads an image (required) - * - * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null) - { - return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation uploadFileWithRequiredFileAsyncWithHttpInfo - * - * uploads an image (required) - * - * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null) - { - $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'uploadFileWithRequiredFile' - * - * @param int $pet_id ID of pet to update (required) - * @param \SplFileObject $required_file file to upload (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null) - { - // verify the required parameter 'pet_id' is set - if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pet_id when calling uploadFileWithRequiredFile' - ); - } - // verify the required parameter 'required_file' is set - if ($required_file === null || (is_array($required_file) && count($required_file) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $required_file when calling uploadFileWithRequiredFile' - ); - } - - $resourcePath = '/fake/{petId}/uploadImageWithRequiredFile'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($pet_id !== null) { - $resourcePath = str_replace( - '{' . 'petId' . '}', - ObjectSerializer::toPathValue($pet_id), - $resourcePath - ); - } - - // form params - if ($additional_metadata !== null) { - $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); - } - // form params - if ($required_file !== null) { - $multipart = true; - $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($required_file), 'rb'); - } - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires OAuth (access token) - if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php deleted file mode 100644 index 92a01910698..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ /dev/null @@ -1,1168 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; - } - - /** - * Set the host index - * - * @param int Host index (required) - */ - public function setHostIndex($host_index) - { - $this->hostIndex = $host_index; - } - - /** - * Get the host index - * - * @return Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation deleteOrder - * - * Delete purchase order by ID - * - * @param string $order_id ID of the order that needs to be deleted (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function deleteOrder($order_id) - { - $this->deleteOrderWithHttpInfo($order_id); - } - - /** - * Operation deleteOrderWithHttpInfo - * - * Delete purchase order by ID - * - * @param string $order_id ID of the order that needs to be deleted (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteOrderWithHttpInfo($order_id) - { - $request = $this->deleteOrderRequest($order_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation deleteOrderAsync - * - * Delete purchase order by ID - * - * @param string $order_id ID of the order that needs to be deleted (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteOrderAsync($order_id) - { - return $this->deleteOrderAsyncWithHttpInfo($order_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteOrderAsyncWithHttpInfo - * - * Delete purchase order by ID - * - * @param string $order_id ID of the order that needs to be deleted (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteOrderAsyncWithHttpInfo($order_id) - { - $returnType = ''; - $request = $this->deleteOrderRequest($order_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteOrder' - * - * @param string $order_id ID of the order that needs to be deleted (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function deleteOrderRequest($order_id) - { - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling deleteOrder' - ); - } - - $resourcePath = '/store/order/{order_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'order_id' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getInventory - * - * Returns pet inventories by status - * - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return map[string,int] - */ - public function getInventory() - { - list($response) = $this->getInventoryWithHttpInfo(); - return $response; - } - - /** - * Operation getInventoryWithHttpInfo - * - * Returns pet inventories by status - * - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of map[string,int], HTTP status code, HTTP response headers (array of strings) - */ - public function getInventoryWithHttpInfo() - { - $request = $this->getInventoryRequest(); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('map[string,int]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, 'map[string,int]', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'map[string,int]'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'map[string,int]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getInventoryAsync - * - * Returns pet inventories by status - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getInventoryAsync() - { - return $this->getInventoryAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getInventoryAsyncWithHttpInfo - * - * Returns pet inventories by status - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getInventoryAsyncWithHttpInfo() - { - $returnType = 'map[string,int]'; - $request = $this->getInventoryRequest(); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getInventory' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function getInventoryRequest() - { - - $resourcePath = '/store/inventory'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('api_key'); - if ($apiKey !== null) { - $headers['api_key'] = $apiKey; - } - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getOrderById - * - * Find purchase order by ID - * - * @param int $order_id ID of pet that needs to be fetched (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Order - */ - public function getOrderById($order_id) - { - list($response) = $this->getOrderByIdWithHttpInfo($order_id); - return $response; - } - - /** - * Operation getOrderByIdWithHttpInfo - * - * Find purchase order by ID - * - * @param int $order_id ID of pet that needs to be fetched (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) - */ - public function getOrderByIdWithHttpInfo($order_id) - { - $request = $this->getOrderByIdRequest($order_id); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Order'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Order', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getOrderByIdAsync - * - * Find purchase order by ID - * - * @param int $order_id ID of pet that needs to be fetched (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getOrderByIdAsync($order_id) - { - return $this->getOrderByIdAsyncWithHttpInfo($order_id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getOrderByIdAsyncWithHttpInfo - * - * Find purchase order by ID - * - * @param int $order_id ID of pet that needs to be fetched (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getOrderByIdAsyncWithHttpInfo($order_id) - { - $returnType = '\OpenAPI\Client\Model\Order'; - $request = $this->getOrderByIdRequest($order_id); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getOrderById' - * - * @param int $order_id ID of pet that needs to be fetched (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function getOrderByIdRequest($order_id) - { - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling getOrderById' - ); - } - if ($order_id > 5) { - throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.'); - } - if ($order_id < 1) { - throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/store/order/{order_id}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'order_id' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation placeOrder - * - * Place an order for a pet - * - * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\Order - */ - public function placeOrder($order) - { - list($response) = $this->placeOrderWithHttpInfo($order); - return $response; - } - - /** - * Operation placeOrderWithHttpInfo - * - * Place an order for a pet - * - * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) - */ - public function placeOrderWithHttpInfo($order) - { - $request = $this->placeOrderRequest($order); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\Order'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\Order', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation placeOrderAsync - * - * Place an order for a pet - * - * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function placeOrderAsync($order) - { - return $this->placeOrderAsyncWithHttpInfo($order) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation placeOrderAsyncWithHttpInfo - * - * Place an order for a pet - * - * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function placeOrderAsyncWithHttpInfo($order) - { - $returnType = '\OpenAPI\Client\Model\Order'; - $request = $this->placeOrderRequest($order); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'placeOrder' - * - * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function placeOrderRequest($order) - { - // verify the required parameter 'order' is set - if ($order === null || (is_array($order) && count($order) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order when calling placeOrder' - ); - } - - $resourcePath = '/store/order'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($order)) { - $_tempBody = $order; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php deleted file mode 100644 index 9c5ff0a7610..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ /dev/null @@ -1,2037 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $host_index; - } - - /** - * Set the host index - * - * @param int Host index (required) - */ - public function setHostIndex($host_index) - { - $this->hostIndex = $host_index; - } - - /** - * Get the host index - * - * @return Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation createUser - * - * Create user - * - * @param \OpenAPI\Client\Model\User $user Created user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function createUser($user) - { - $this->createUserWithHttpInfo($user); - } - - /** - * Operation createUserWithHttpInfo - * - * Create user - * - * @param \OpenAPI\Client\Model\User $user Created user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function createUserWithHttpInfo($user) - { - $request = $this->createUserRequest($user); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation createUserAsync - * - * Create user - * - * @param \OpenAPI\Client\Model\User $user Created user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createUserAsync($user) - { - return $this->createUserAsyncWithHttpInfo($user) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation createUserAsyncWithHttpInfo - * - * Create user - * - * @param \OpenAPI\Client\Model\User $user Created user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createUserAsyncWithHttpInfo($user) - { - $returnType = ''; - $request = $this->createUserRequest($user); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'createUser' - * - * @param \OpenAPI\Client\Model\User $user Created user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function createUserRequest($user) - { - // verify the required parameter 'user' is set - if ($user === null || (is_array($user) && count($user) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user when calling createUser' - ); - } - - $resourcePath = '/user'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($user)) { - $_tempBody = $user; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation createUsersWithArrayInput - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function createUsersWithArrayInput($user) - { - $this->createUsersWithArrayInputWithHttpInfo($user); - } - - /** - * Operation createUsersWithArrayInputWithHttpInfo - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function createUsersWithArrayInputWithHttpInfo($user) - { - $request = $this->createUsersWithArrayInputRequest($user); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation createUsersWithArrayInputAsync - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createUsersWithArrayInputAsync($user) - { - return $this->createUsersWithArrayInputAsyncWithHttpInfo($user) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation createUsersWithArrayInputAsyncWithHttpInfo - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createUsersWithArrayInputAsyncWithHttpInfo($user) - { - $returnType = ''; - $request = $this->createUsersWithArrayInputRequest($user); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'createUsersWithArrayInput' - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function createUsersWithArrayInputRequest($user) - { - // verify the required parameter 'user' is set - if ($user === null || (is_array($user) && count($user) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user when calling createUsersWithArrayInput' - ); - } - - $resourcePath = '/user/createWithArray'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($user)) { - $_tempBody = $user; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation createUsersWithListInput - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function createUsersWithListInput($user) - { - $this->createUsersWithListInputWithHttpInfo($user); - } - - /** - * Operation createUsersWithListInputWithHttpInfo - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function createUsersWithListInputWithHttpInfo($user) - { - $request = $this->createUsersWithListInputRequest($user); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation createUsersWithListInputAsync - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createUsersWithListInputAsync($user) - { - return $this->createUsersWithListInputAsyncWithHttpInfo($user) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation createUsersWithListInputAsyncWithHttpInfo - * - * Creates list of users with given input array - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function createUsersWithListInputAsyncWithHttpInfo($user) - { - $returnType = ''; - $request = $this->createUsersWithListInputRequest($user); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'createUsersWithListInput' - * - * @param \OpenAPI\Client\Model\User[] $user List of user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function createUsersWithListInputRequest($user) - { - // verify the required parameter 'user' is set - if ($user === null || (is_array($user) && count($user) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user when calling createUsersWithListInput' - ); - } - - $resourcePath = '/user/createWithList'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - if (isset($user)) { - $_tempBody = $user; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation deleteUser - * - * Delete user - * - * @param string $username The name that needs to be deleted (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function deleteUser($username) - { - $this->deleteUserWithHttpInfo($username); - } - - /** - * Operation deleteUserWithHttpInfo - * - * Delete user - * - * @param string $username The name that needs to be deleted (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function deleteUserWithHttpInfo($username) - { - $request = $this->deleteUserRequest($username); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation deleteUserAsync - * - * Delete user - * - * @param string $username The name that needs to be deleted (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteUserAsync($username) - { - return $this->deleteUserAsyncWithHttpInfo($username) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation deleteUserAsyncWithHttpInfo - * - * Delete user - * - * @param string $username The name that needs to be deleted (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function deleteUserAsyncWithHttpInfo($username) - { - $returnType = ''; - $request = $this->deleteUserRequest($username); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'deleteUser' - * - * @param string $username The name that needs to be deleted (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function deleteUserRequest($username) - { - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling deleteUser' - ); - } - - $resourcePath = '/user/{username}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($username !== null) { - $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation getUserByName - * - * Get user by user name - * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\User - */ - public function getUserByName($username) - { - list($response) = $this->getUserByNameWithHttpInfo($username); - return $response; - } - - /** - * Operation getUserByNameWithHttpInfo - * - * Get user by user name - * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\User, HTTP status code, HTTP response headers (array of strings) - */ - public function getUserByNameWithHttpInfo($username) - { - $request = $this->getUserByNameRequest($username); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\User', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\OpenAPI\Client\Model\User'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\OpenAPI\Client\Model\User', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getUserByNameAsync - * - * Get user by user name - * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getUserByNameAsync($username) - { - return $this->getUserByNameAsyncWithHttpInfo($username) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getUserByNameAsyncWithHttpInfo - * - * Get user by user name - * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getUserByNameAsyncWithHttpInfo($username) - { - $returnType = '\OpenAPI\Client\Model\User'; - $request = $this->getUserByNameRequest($username); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getUserByName' - * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function getUserByNameRequest($username) - { - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling getUserByName' - ); - } - - $resourcePath = '/user/{username}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($username !== null) { - $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), - $resourcePath - ); - } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation loginUser - * - * Logs user into the system - * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function loginUser($username, $password) - { - list($response) = $this->loginUserWithHttpInfo($username, $password); - return $response; - } - - /** - * Operation loginUserWithHttpInfo - * - * Logs user into the system - * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) - */ - public function loginUserWithHttpInfo($username, $password) - { - $request = $this->loginUserRequest($username, $password); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('string' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, 'string', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = 'string'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'string', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation loginUserAsync - * - * Logs user into the system - * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function loginUserAsync($username, $password) - { - return $this->loginUserAsyncWithHttpInfo($username, $password) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation loginUserAsyncWithHttpInfo - * - * Logs user into the system - * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function loginUserAsyncWithHttpInfo($username, $password) - { - $returnType = 'string'; - $request = $this->loginUserRequest($username, $password); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = (string) $responseBody; - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'loginUser' - * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function loginUserRequest($username, $password) - { - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling loginUser' - ); - } - // verify the required parameter 'password' is set - if ($password === null || (is_array($password) && count($password) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $password when calling loginUser' - ); - } - - $resourcePath = '/user/login'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($username !== null) { - if('form' === 'form' && is_array($username)) { - foreach($username as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['username'] = $username; - } - } - // query params - if ($password !== null) { - if('form' === 'form' && is_array($password)) { - foreach($password as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['password'] = $password; - } - } - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation logoutUser - * - * Logs out current logged in user session - * - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function logoutUser() - { - $this->logoutUserWithHttpInfo(); - } - - /** - * Operation logoutUserWithHttpInfo - * - * Logs out current logged in user session - * - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function logoutUserWithHttpInfo() - { - $request = $this->logoutUserRequest(); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation logoutUserAsync - * - * Logs out current logged in user session - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function logoutUserAsync() - { - return $this->logoutUserAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation logoutUserAsyncWithHttpInfo - * - * Logs out current logged in user session - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function logoutUserAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->logoutUserRequest(); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'logoutUser' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function logoutUserRequest() - { - - $resourcePath = '/user/logout'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation updateUser - * - * Updated user - * - * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $user Updated user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function updateUser($username, $user) - { - $this->updateUserWithHttpInfo($username, $user); - } - - /** - * Operation updateUserWithHttpInfo - * - * Updated user - * - * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $user Updated user object (required) - * - * @throws \OpenAPI\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) - */ - public function updateUserWithHttpInfo($username, $user) - { - $request = $this->updateUserRequest($username, $user); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation updateUserAsync - * - * Updated user - * - * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $user Updated user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updateUserAsync($username, $user) - { - return $this->updateUserAsyncWithHttpInfo($username, $user) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation updateUserAsyncWithHttpInfo - * - * Updated user - * - * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $user Updated user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function updateUserAsyncWithHttpInfo($username, $user) - { - $returnType = ''; - $request = $this->updateUserRequest($username, $user); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'updateUser' - * - * @param string $username name that need to be deleted (required) - * @param \OpenAPI\Client\Model\User $user Updated user object (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function updateUserRequest($username, $user) - { - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling updateUser' - ); - } - // verify the required parameter 'user' is set - if ($user === null || (is_array($user) && count($user) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $user when calling updateUser' - ); - } - - $resourcePath = '/user/{username}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // path params - if ($username !== null) { - $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), - $resourcePath - ); - } - - // body params - $_tempBody = null; - if (isset($user)) { - $_tempBody = $user; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } - - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $query = \GuzzleHttp\Psr7\build_query($queryParams); - return new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php deleted file mode 100644 index f041f3e7723..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ /dev/null @@ -1,121 +0,0 @@ -responseHeaders = $responseHeaders; - $this->responseBody = $responseBody; - } - - /** - * Gets the HTTP response header - * - * @return string[]|null HTTP response header - */ - public function getResponseHeaders() - { - return $this->responseHeaders; - } - - /** - * Gets the HTTP body of the server response either as Json or string - * - * @return mixed HTTP body of the server response either as \stdClass or string - */ - public function getResponseBody() - { - return $this->responseBody; - } - - /** - * Sets the deseralized response object (during deserialization) - * - * @param mixed $obj Deserialized response object - * - * @return void - */ - public function setResponseObject($obj) - { - $this->responseObject = $obj; - } - - /** - * Gets the deseralized response object (during deserialization) - * - * @return mixed the deserialized response object - */ - public function getResponseObject() - { - return $this->responseObject; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php deleted file mode 100644 index 3ab5eda04ec..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ /dev/null @@ -1,517 +0,0 @@ -tempFolderPath = sys_get_temp_dir(); - } - - /** - * Sets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $key API key or token - * - * @return $this - */ - public function setApiKey($apiKeyIdentifier, $key) - { - $this->apiKeys[$apiKeyIdentifier] = $key; - return $this; - } - - /** - * Gets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string API key or token - */ - public function getApiKey($apiKeyIdentifier) - { - return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; - } - - /** - * Sets the prefix for API key (e.g. Bearer) - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer - * - * @return $this - */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) - { - $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; - return $this; - } - - /** - * Gets API key prefix - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string - */ - public function getApiKeyPrefix($apiKeyIdentifier) - { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; - } - - /** - * Sets the access token for OAuth - * - * @param string $accessToken Token for OAuth - * - * @return $this - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - return $this; - } - - /** - * Gets the access token for OAuth - * - * @return string Access token for OAuth - */ - public function getAccessToken() - { - return $this->accessToken; - } - - /** - * Sets the username for HTTP basic authentication - * - * @param string $username Username for HTTP basic authentication - * - * @return $this - */ - public function setUsername($username) - { - $this->username = $username; - return $this; - } - - /** - * Gets the username for HTTP basic authentication - * - * @return string Username for HTTP basic authentication - */ - public function getUsername() - { - return $this->username; - } - - /** - * Sets the password for HTTP basic authentication - * - * @param string $password Password for HTTP basic authentication - * - * @return $this - */ - public function setPassword($password) - { - $this->password = $password; - return $this; - } - - /** - * Gets the password for HTTP basic authentication - * - * @return string Password for HTTP basic authentication - */ - public function getPassword() - { - return $this->password; - } - - /** - * Sets the host - * - * @param string $host Host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - return $this; - } - - /** - * Gets the host - * - * @return string Host - */ - public function getHost() - { - return $this->host; - } - - /** - * Sets the user agent of the api client - * - * @param string $userAgent the user agent of the api client - * - * @throws \InvalidArgumentException - * @return $this - */ - public function setUserAgent($userAgent) - { - if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); - } - - $this->userAgent = $userAgent; - return $this; - } - - /** - * Gets the user agent of the api client - * - * @return string user agent - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Sets debug flag - * - * @param bool $debug Debug flag - * - * @return $this - */ - public function setDebug($debug) - { - $this->debug = $debug; - return $this; - } - - /** - * Gets the debug flag - * - * @return bool - */ - public function getDebug() - { - return $this->debug; - } - - /** - * Sets the debug file - * - * @param string $debugFile Debug file - * - * @return $this - */ - public function setDebugFile($debugFile) - { - $this->debugFile = $debugFile; - return $this; - } - - /** - * Gets the debug file - * - * @return string - */ - public function getDebugFile() - { - return $this->debugFile; - } - - /** - * Sets the temp folder path - * - * @param string $tempFolderPath Temp folder path - * - * @return $this - */ - public function setTempFolderPath($tempFolderPath) - { - $this->tempFolderPath = $tempFolderPath; - return $this; - } - - /** - * Gets the temp folder path - * - * @return string Temp folder path - */ - public function getTempFolderPath() - { - return $this->tempFolderPath; - } - - /** - * Gets the default configuration instance - * - * @return Configuration - */ - public static function getDefaultConfiguration() - { - if (self::$defaultConfiguration === null) { - self::$defaultConfiguration = new Configuration(); - } - - return self::$defaultConfiguration; - } - - /** - * Sets the detault configuration instance - * - * @param Configuration $config An instance of the Configuration Object - * - * @return void - */ - public static function setDefaultConfiguration(Configuration $config) - { - self::$defaultConfiguration = $config; - } - - /** - * Gets the essential information for debugging - * - * @return string The report for debugging - */ - public static function toDebugReport() - { - $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; - $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 1.0.0' . PHP_EOL; - $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; - - return $report; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->getApiKey($apiKeyIdentifier); - - if ($apiKey === null) { - return null; - } - - if ($prefix === null) { - $keyWithPrefix = $apiKey; - } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; - } - - return $keyWithPrefix; - } - - /** - * Returns an array of host settings - * - * @return an array of host settings - */ - public function getHostSettings() - { - return [ - [ - "url" => "http://{server}.swagger.io:{port}/v2", - "description" => "petstore server", - "variables" => [ - "server" => [ - "description" => "No description provided", - "default_value" => "petstore", - "enum_values" => [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - ], - "port" => [ - "description" => "No description provided", - "default_value" => "80", - "enum_values" => [ - "80", - "8080" - ] - ] - ] - ], - [ - "url" => "https://localhost:8080/{version}", - "description" => "The local server", - "variables" => [ - "version" => [ - "description" => "No description provided", - "default_value" => "v2", - "enum_values" => [ - "v1", - "v2" - ] - ] - ] - ] - ]; - } - - /** - * Returns URL based on the index and variables - * - * @param index array index of the host settings - * @param variables hash of variable and the corresponding value (optional) - * @return URL based on host settings - */ - public function getHostFromSettings($index, $variables = null) - { - if (null === $variables) { - $variables = []; - } - - $hosts = $this->getHostSettings(); - - // check array index out of bound - if ($index < 0 || $index >= sizeof($hosts)) { - throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); - } - - $host = $hosts[$index]; - $url = $host["url"]; - - // go through variable and assign a value - foreach ($host["variables"] as $name => $variable) { - if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum - $url = str_replace("{".$name."}", $variables[$name], $url); - } else { - throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); - } - } else { - // use default value - $url = str_replace("{".$name."}", $variable["default_value"], $url); - } - } - - return $url; - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php deleted file mode 100644 index 25a92414028..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ /dev/null @@ -1,110 +0,0 @@ -selectAcceptHeader($accept); - if ($accept !== null) { - $headers['Accept'] = $accept; - } - - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); - return $headers; - } - - /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - private function selectAcceptHeader($accept) - { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) - { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } else { - return implode(',', $contentType); - } - } -} - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php deleted file mode 100644 index 2811e834099..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ /dev/null @@ -1,337 +0,0 @@ - 'map[string,string]', - 'map_of_map_property' => 'map[string,map[string,string]]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'map_property' => null, - 'map_of_map_property' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'map_property' => 'map_property', - 'map_of_map_property' => 'map_of_map_property' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'map_property' => 'setMapProperty', - 'map_of_map_property' => 'setMapOfMapProperty' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'map_property' => 'getMapProperty', - 'map_of_map_property' => 'getMapOfMapProperty' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['map_property'] = isset($data['map_property']) ? $data['map_property'] : null; - $this->container['map_of_map_property'] = isset($data['map_of_map_property']) ? $data['map_of_map_property'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets map_property - * - * @return map[string,string]|null - */ - public function getMapProperty() - { - return $this->container['map_property']; - } - - /** - * Sets map_property - * - * @param map[string,string]|null $map_property map_property - * - * @return $this - */ - public function setMapProperty($map_property) - { - $this->container['map_property'] = $map_property; - - return $this; - } - - /** - * Gets map_of_map_property - * - * @return map[string,map[string,string]]|null - */ - public function getMapOfMapProperty() - { - return $this->container['map_of_map_property']; - } - - /** - * Sets map_of_map_property - * - * @param map[string,map[string,string]]|null $map_of_map_property map_of_map_property - * - * @return $this - */ - public function setMapOfMapProperty($map_of_map_property) - { - $this->container['map_of_map_property'] = $map_of_map_property; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php deleted file mode 100644 index 145ecc65ac0..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ /dev/null @@ -1,343 +0,0 @@ - 'string', - 'color' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'class_name' => null, - 'color' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'class_name' => 'className', - 'color' => 'color' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'class_name' => 'setClassName', - 'color' => 'setColor' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'class_name' => 'getClassName', - 'color' => 'getColor' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['class_name'] = isset($data['class_name']) ? $data['class_name'] : null; - $this->container['color'] = isset($data['color']) ? $data['color'] : 'red'; - - // Initialize discriminator property with the model name. - $this->container['class_name'] = static::$openAPIModelName; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['class_name'] === null) { - $invalidProperties[] = "'class_name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets class_name - * - * @return string - */ - public function getClassName() - { - return $this->container['class_name']; - } - - /** - * Sets class_name - * - * @param string $class_name class_name - * - * @return $this - */ - public function setClassName($class_name) - { - $this->container['class_name'] = $class_name; - - return $this; - } - - /** - * Gets color - * - * @return string|null - */ - public function getColor() - { - return $this->container['color']; - } - - /** - * Sets color - * - * @param string|null $color color - * - * @return $this - */ - public function setColor($color) - { - $this->container['color'] = $color; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php deleted file mode 100644 index 43244c474ee..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ /dev/null @@ -1,367 +0,0 @@ - 'int', - 'type' => 'string', - 'message' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'code' => 'int32', - 'type' => null, - 'message' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'code' => 'code', - 'type' => 'type', - 'message' => 'message' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'code' => 'setCode', - 'type' => 'setType', - 'message' => 'setMessage' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'code' => 'getCode', - 'type' => 'getType', - 'message' => 'getMessage' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets code - * - * @return int|null - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param int|null $code code - * - * @return $this - */ - public function setCode($code) - { - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type type - * - * @return $this - */ - public function setType($type) - { - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets message - * - * @return string|null - */ - public function getMessage() - { - return $this->container['message']; - } - - /** - * Sets message - * - * @param string|null $message message - * - * @return $this - */ - public function setMessage($message) - { - $this->container['message'] = $message; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php deleted file mode 100644 index a0f5ccfd05a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ /dev/null @@ -1,307 +0,0 @@ - 'float[][]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'array_array_number' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'array_array_number' => 'ArrayArrayNumber' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'array_array_number' => 'setArrayArrayNumber' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'array_array_number' => 'getArrayArrayNumber' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['array_array_number'] = isset($data['array_array_number']) ? $data['array_array_number'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets array_array_number - * - * @return float[][]|null - */ - public function getArrayArrayNumber() - { - return $this->container['array_array_number']; - } - - /** - * Sets array_array_number - * - * @param float[][]|null $array_array_number array_array_number - * - * @return $this - */ - public function setArrayArrayNumber($array_array_number) - { - $this->container['array_array_number'] = $array_array_number; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php deleted file mode 100644 index 483ea4fbd9e..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ /dev/null @@ -1,307 +0,0 @@ - 'float[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'array_number' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'array_number' => 'ArrayNumber' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'array_number' => 'setArrayNumber' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'array_number' => 'getArrayNumber' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['array_number'] = isset($data['array_number']) ? $data['array_number'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets array_number - * - * @return float[]|null - */ - public function getArrayNumber() - { - return $this->container['array_number']; - } - - /** - * Sets array_number - * - * @param float[]|null $array_number array_number - * - * @return $this - */ - public function setArrayNumber($array_number) - { - $this->container['array_number'] = $array_number; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php deleted file mode 100644 index bad6739097d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ /dev/null @@ -1,367 +0,0 @@ - 'string[]', - 'array_array_of_integer' => 'int[][]', - 'array_array_of_model' => '\OpenAPI\Client\Model\ReadOnlyFirst[][]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'array_of_string' => null, - 'array_array_of_integer' => 'int64', - 'array_array_of_model' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'array_of_string' => 'array_of_string', - 'array_array_of_integer' => 'array_array_of_integer', - 'array_array_of_model' => 'array_array_of_model' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'array_of_string' => 'setArrayOfString', - 'array_array_of_integer' => 'setArrayArrayOfInteger', - 'array_array_of_model' => 'setArrayArrayOfModel' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'array_of_string' => 'getArrayOfString', - 'array_array_of_integer' => 'getArrayArrayOfInteger', - 'array_array_of_model' => 'getArrayArrayOfModel' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['array_of_string'] = isset($data['array_of_string']) ? $data['array_of_string'] : null; - $this->container['array_array_of_integer'] = isset($data['array_array_of_integer']) ? $data['array_array_of_integer'] : null; - $this->container['array_array_of_model'] = isset($data['array_array_of_model']) ? $data['array_array_of_model'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets array_of_string - * - * @return string[]|null - */ - public function getArrayOfString() - { - return $this->container['array_of_string']; - } - - /** - * Sets array_of_string - * - * @param string[]|null $array_of_string array_of_string - * - * @return $this - */ - public function setArrayOfString($array_of_string) - { - $this->container['array_of_string'] = $array_of_string; - - return $this; - } - - /** - * Gets array_array_of_integer - * - * @return int[][]|null - */ - public function getArrayArrayOfInteger() - { - return $this->container['array_array_of_integer']; - } - - /** - * Sets array_array_of_integer - * - * @param int[][]|null $array_array_of_integer array_array_of_integer - * - * @return $this - */ - public function setArrayArrayOfInteger($array_array_of_integer) - { - $this->container['array_array_of_integer'] = $array_array_of_integer; - - return $this; - } - - /** - * Gets array_array_of_model - * - * @return \OpenAPI\Client\Model\ReadOnlyFirst[][]|null - */ - public function getArrayArrayOfModel() - { - return $this->container['array_array_of_model']; - } - - /** - * Sets array_array_of_model - * - * @param \OpenAPI\Client\Model\ReadOnlyFirst[][]|null $array_array_of_model array_array_of_model - * - * @return $this - */ - public function setArrayArrayOfModel($array_array_of_model) - { - $this->container['array_array_of_model'] = $array_array_of_model; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php deleted file mode 100644 index 973de7be8fc..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ /dev/null @@ -1,457 +0,0 @@ - 'string', - 'capital_camel' => 'string', - 'small_snake' => 'string', - 'capital_snake' => 'string', - 'sca_eth_flow_points' => 'string', - 'att_name' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'small_camel' => null, - 'capital_camel' => null, - 'small_snake' => null, - 'capital_snake' => null, - 'sca_eth_flow_points' => null, - 'att_name' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'small_camel' => 'smallCamel', - 'capital_camel' => 'CapitalCamel', - 'small_snake' => 'small_Snake', - 'capital_snake' => 'Capital_Snake', - 'sca_eth_flow_points' => 'SCA_ETH_Flow_Points', - 'att_name' => 'ATT_NAME' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'small_camel' => 'setSmallCamel', - 'capital_camel' => 'setCapitalCamel', - 'small_snake' => 'setSmallSnake', - 'capital_snake' => 'setCapitalSnake', - 'sca_eth_flow_points' => 'setScaEthFlowPoints', - 'att_name' => 'setAttName' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'small_camel' => 'getSmallCamel', - 'capital_camel' => 'getCapitalCamel', - 'small_snake' => 'getSmallSnake', - 'capital_snake' => 'getCapitalSnake', - 'sca_eth_flow_points' => 'getScaEthFlowPoints', - 'att_name' => 'getAttName' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['small_camel'] = isset($data['small_camel']) ? $data['small_camel'] : null; - $this->container['capital_camel'] = isset($data['capital_camel']) ? $data['capital_camel'] : null; - $this->container['small_snake'] = isset($data['small_snake']) ? $data['small_snake'] : null; - $this->container['capital_snake'] = isset($data['capital_snake']) ? $data['capital_snake'] : null; - $this->container['sca_eth_flow_points'] = isset($data['sca_eth_flow_points']) ? $data['sca_eth_flow_points'] : null; - $this->container['att_name'] = isset($data['att_name']) ? $data['att_name'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets small_camel - * - * @return string|null - */ - public function getSmallCamel() - { - return $this->container['small_camel']; - } - - /** - * Sets small_camel - * - * @param string|null $small_camel small_camel - * - * @return $this - */ - public function setSmallCamel($small_camel) - { - $this->container['small_camel'] = $small_camel; - - return $this; - } - - /** - * Gets capital_camel - * - * @return string|null - */ - public function getCapitalCamel() - { - return $this->container['capital_camel']; - } - - /** - * Sets capital_camel - * - * @param string|null $capital_camel capital_camel - * - * @return $this - */ - public function setCapitalCamel($capital_camel) - { - $this->container['capital_camel'] = $capital_camel; - - return $this; - } - - /** - * Gets small_snake - * - * @return string|null - */ - public function getSmallSnake() - { - return $this->container['small_snake']; - } - - /** - * Sets small_snake - * - * @param string|null $small_snake small_snake - * - * @return $this - */ - public function setSmallSnake($small_snake) - { - $this->container['small_snake'] = $small_snake; - - return $this; - } - - /** - * Gets capital_snake - * - * @return string|null - */ - public function getCapitalSnake() - { - return $this->container['capital_snake']; - } - - /** - * Sets capital_snake - * - * @param string|null $capital_snake capital_snake - * - * @return $this - */ - public function setCapitalSnake($capital_snake) - { - $this->container['capital_snake'] = $capital_snake; - - return $this; - } - - /** - * Gets sca_eth_flow_points - * - * @return string|null - */ - public function getScaEthFlowPoints() - { - return $this->container['sca_eth_flow_points']; - } - - /** - * Sets sca_eth_flow_points - * - * @param string|null $sca_eth_flow_points sca_eth_flow_points - * - * @return $this - */ - public function setScaEthFlowPoints($sca_eth_flow_points) - { - $this->container['sca_eth_flow_points'] = $sca_eth_flow_points; - - return $this; - } - - /** - * Gets att_name - * - * @return string|null - */ - public function getAttName() - { - return $this->container['att_name']; - } - - /** - * Sets att_name - * - * @param string|null $att_name Name of the pet - * - * @return $this - */ - public function setAttName($att_name) - { - $this->container['att_name'] = $att_name; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php deleted file mode 100644 index 5603aab4c7d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ /dev/null @@ -1,301 +0,0 @@ - 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'declawed' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes + parent::openAPITypes(); - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats + parent::openAPIFormats(); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'declawed' => 'declawed' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'declawed' => 'setDeclawed' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'declawed' => 'getDeclawed' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return parent::attributeMap() + self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return parent::setters() + self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return parent::getters() + self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - parent::__construct($data); - - $this->container['declawed'] = isset($data['declawed']) ? $data['declawed'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets declawed - * - * @return bool|null - */ - public function getDeclawed() - { - return $this->container['declawed']; - } - - /** - * Sets declawed - * - * @param bool|null $declawed declawed - * - * @return $this - */ - public function setDeclawed($declawed) - { - $this->container['declawed'] = $declawed; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php deleted file mode 100644 index 8d31dffa0f5..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ /dev/null @@ -1,307 +0,0 @@ - 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'declawed' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'declawed' => 'declawed' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'declawed' => 'setDeclawed' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'declawed' => 'getDeclawed' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['declawed'] = isset($data['declawed']) ? $data['declawed'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets declawed - * - * @return bool|null - */ - public function getDeclawed() - { - return $this->container['declawed']; - } - - /** - * Sets declawed - * - * @param bool|null $declawed declawed - * - * @return $this - */ - public function setDeclawed($declawed) - { - $this->container['declawed'] = $declawed; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php deleted file mode 100644 index 174fdd9b84f..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ /dev/null @@ -1,340 +0,0 @@ - 'int', - 'name' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => 'int64', - 'name' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'name' => 'name' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'name' => 'setName' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'name' => 'getName' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : 'default-name'; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return int|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int|null $id id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php deleted file mode 100644 index f833dea74f3..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ /dev/null @@ -1,308 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - '_class' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - '_class' => '_class' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - '_class' => 'setClass' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - '_class' => 'getClass' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['_class'] = isset($data['_class']) ? $data['_class'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets _class - * - * @return string|null - */ - public function getClass() - { - return $this->container['_class']; - } - - /** - * Sets _class - * - * @param string|null $_class _class - * - * @return $this - */ - public function setClass($_class) - { - $this->container['_class'] = $_class; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php deleted file mode 100644 index 564b89cec44..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ /dev/null @@ -1,307 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'client' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'client' => 'client' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'client' => 'setClient' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'client' => 'getClient' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['client'] = isset($data['client']) ? $data['client'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets client - * - * @return string|null - */ - public function getClient() - { - return $this->container['client']; - } - - /** - * Sets client - * - * @param string|null $client client - * - * @return $this - */ - public function setClient($client) - { - $this->container['client'] = $client; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php deleted file mode 100644 index 4a205e6a0ac..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ /dev/null @@ -1,301 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'breed' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes + parent::openAPITypes(); - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats + parent::openAPIFormats(); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'breed' => 'breed' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'breed' => 'setBreed' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'breed' => 'getBreed' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return parent::attributeMap() + self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return parent::setters() + self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return parent::getters() + self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - parent::__construct($data); - - $this->container['breed'] = isset($data['breed']) ? $data['breed'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets breed - * - * @return string|null - */ - public function getBreed() - { - return $this->container['breed']; - } - - /** - * Sets breed - * - * @param string|null $breed breed - * - * @return $this - */ - public function setBreed($breed) - { - $this->container['breed'] = $breed; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php deleted file mode 100644 index dc8ac5fefe7..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ /dev/null @@ -1,307 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'breed' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'breed' => 'breed' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'breed' => 'setBreed' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'breed' => 'getBreed' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['breed'] = isset($data['breed']) ? $data['breed'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets breed - * - * @return string|null - */ - public function getBreed() - { - return $this->container['breed']; - } - - /** - * Sets breed - * - * @param string|null $breed breed - * - * @return $this - */ - public function setBreed($breed) - { - $this->container['breed'] = $breed; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php deleted file mode 100644 index b26906a75cc..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ /dev/null @@ -1,393 +0,0 @@ - 'string', - 'array_enum' => 'string[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'just_symbol' => null, - 'array_enum' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'just_symbol' => 'just_symbol', - 'array_enum' => 'array_enum' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'just_symbol' => 'setJustSymbol', - 'array_enum' => 'setArrayEnum' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'just_symbol' => 'getJustSymbol', - 'array_enum' => 'getArrayEnum' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const JUST_SYMBOL_GREATER_THAN_OR_EQUAL_TO = '>='; - const JUST_SYMBOL_DOLLAR = '$'; - const ARRAY_ENUM_FISH = 'fish'; - const ARRAY_ENUM_CRAB = 'crab'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getJustSymbolAllowableValues() - { - return [ - self::JUST_SYMBOL_GREATER_THAN_OR_EQUAL_TO, - self::JUST_SYMBOL_DOLLAR, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getArrayEnumAllowableValues() - { - return [ - self::ARRAY_ENUM_FISH, - self::ARRAY_ENUM_CRAB, - ]; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['just_symbol'] = isset($data['just_symbol']) ? $data['just_symbol'] : null; - $this->container['array_enum'] = isset($data['array_enum']) ? $data['array_enum'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getJustSymbolAllowableValues(); - if (!is_null($this->container['just_symbol']) && !in_array($this->container['just_symbol'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'just_symbol', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets just_symbol - * - * @return string|null - */ - public function getJustSymbol() - { - return $this->container['just_symbol']; - } - - /** - * Sets just_symbol - * - * @param string|null $just_symbol just_symbol - * - * @return $this - */ - public function setJustSymbol($just_symbol) - { - $allowedValues = $this->getJustSymbolAllowableValues(); - if (!is_null($just_symbol) && !in_array($just_symbol, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'just_symbol', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['just_symbol'] = $just_symbol; - - return $this; - } - - /** - * Gets array_enum - * - * @return string[]|null - */ - public function getArrayEnum() - { - return $this->container['array_enum']; - } - - /** - * Sets array_enum - * - * @param string[]|null $array_enum array_enum - * - * @return $this - */ - public function setArrayEnum($array_enum) - { - $allowedValues = $this->getArrayEnumAllowableValues(); - if (!is_null($array_enum) && array_diff($array_enum, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'array_enum', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['array_enum'] = $array_enum; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php deleted file mode 100644 index ba586a5606b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ /dev/null @@ -1,64 +0,0 @@ - 'string', - 'enum_string_required' => 'string', - 'enum_integer' => 'int', - 'enum_number' => 'double', - 'outer_enum' => '\OpenAPI\Client\Model\OuterEnum', - 'outer_enum_integer' => '\OpenAPI\Client\Model\OuterEnumInteger', - 'outer_enum_default_value' => '\OpenAPI\Client\Model\OuterEnumDefaultValue', - 'outer_enum_integer_default_value' => '\OpenAPI\Client\Model\OuterEnumIntegerDefaultValue' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'enum_string' => null, - 'enum_string_required' => null, - 'enum_integer' => 'int32', - 'enum_number' => 'double', - 'outer_enum' => null, - 'outer_enum_integer' => null, - 'outer_enum_default_value' => null, - 'outer_enum_integer_default_value' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'enum_string' => 'enum_string', - 'enum_string_required' => 'enum_string_required', - 'enum_integer' => 'enum_integer', - 'enum_number' => 'enum_number', - 'outer_enum' => 'outerEnum', - 'outer_enum_integer' => 'outerEnumInteger', - 'outer_enum_default_value' => 'outerEnumDefaultValue', - 'outer_enum_integer_default_value' => 'outerEnumIntegerDefaultValue' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'enum_string' => 'setEnumString', - 'enum_string_required' => 'setEnumStringRequired', - 'enum_integer' => 'setEnumInteger', - 'enum_number' => 'setEnumNumber', - 'outer_enum' => 'setOuterEnum', - 'outer_enum_integer' => 'setOuterEnumInteger', - 'outer_enum_default_value' => 'setOuterEnumDefaultValue', - 'outer_enum_integer_default_value' => 'setOuterEnumIntegerDefaultValue' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'enum_string' => 'getEnumString', - 'enum_string_required' => 'getEnumStringRequired', - 'enum_integer' => 'getEnumInteger', - 'enum_number' => 'getEnumNumber', - 'outer_enum' => 'getOuterEnum', - 'outer_enum_integer' => 'getOuterEnumInteger', - 'outer_enum_default_value' => 'getOuterEnumDefaultValue', - 'outer_enum_integer_default_value' => 'getOuterEnumIntegerDefaultValue' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const ENUM_STRING_UPPER = 'UPPER'; - const ENUM_STRING_LOWER = 'lower'; - const ENUM_STRING_EMPTY = ''; - const ENUM_STRING_REQUIRED_UPPER = 'UPPER'; - const ENUM_STRING_REQUIRED_LOWER = 'lower'; - const ENUM_STRING_REQUIRED_EMPTY = ''; - const ENUM_INTEGER_1 = 1; - const ENUM_INTEGER_MINUS_1 = -1; - const ENUM_NUMBER_1_DOT_1 = 1.1; - const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEnumStringAllowableValues() - { - return [ - self::ENUM_STRING_UPPER, - self::ENUM_STRING_LOWER, - self::ENUM_STRING_EMPTY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEnumStringRequiredAllowableValues() - { - return [ - self::ENUM_STRING_REQUIRED_UPPER, - self::ENUM_STRING_REQUIRED_LOWER, - self::ENUM_STRING_REQUIRED_EMPTY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEnumIntegerAllowableValues() - { - return [ - self::ENUM_INTEGER_1, - self::ENUM_INTEGER_MINUS_1, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getEnumNumberAllowableValues() - { - return [ - self::ENUM_NUMBER_1_DOT_1, - self::ENUM_NUMBER_MINUS_1_DOT_2, - ]; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['enum_string'] = isset($data['enum_string']) ? $data['enum_string'] : null; - $this->container['enum_string_required'] = isset($data['enum_string_required']) ? $data['enum_string_required'] : null; - $this->container['enum_integer'] = isset($data['enum_integer']) ? $data['enum_integer'] : null; - $this->container['enum_number'] = isset($data['enum_number']) ? $data['enum_number'] : null; - $this->container['outer_enum'] = isset($data['outer_enum']) ? $data['outer_enum'] : null; - $this->container['outer_enum_integer'] = isset($data['outer_enum_integer']) ? $data['outer_enum_integer'] : null; - $this->container['outer_enum_default_value'] = isset($data['outer_enum_default_value']) ? $data['outer_enum_default_value'] : null; - $this->container['outer_enum_integer_default_value'] = isset($data['outer_enum_integer_default_value']) ? $data['outer_enum_integer_default_value'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getEnumStringAllowableValues(); - if (!is_null($this->container['enum_string']) && !in_array($this->container['enum_string'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'enum_string', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if ($this->container['enum_string_required'] === null) { - $invalidProperties[] = "'enum_string_required' can't be null"; - } - $allowedValues = $this->getEnumStringRequiredAllowableValues(); - if (!is_null($this->container['enum_string_required']) && !in_array($this->container['enum_string_required'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'enum_string_required', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getEnumIntegerAllowableValues(); - if (!is_null($this->container['enum_integer']) && !in_array($this->container['enum_integer'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'enum_integer', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getEnumNumberAllowableValues(); - if (!is_null($this->container['enum_number']) && !in_array($this->container['enum_number'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'enum_number', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets enum_string - * - * @return string|null - */ - public function getEnumString() - { - return $this->container['enum_string']; - } - - /** - * Sets enum_string - * - * @param string|null $enum_string enum_string - * - * @return $this - */ - public function setEnumString($enum_string) - { - $allowedValues = $this->getEnumStringAllowableValues(); - if (!is_null($enum_string) && !in_array($enum_string, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'enum_string', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['enum_string'] = $enum_string; - - return $this; - } - - /** - * Gets enum_string_required - * - * @return string - */ - public function getEnumStringRequired() - { - return $this->container['enum_string_required']; - } - - /** - * Sets enum_string_required - * - * @param string $enum_string_required enum_string_required - * - * @return $this - */ - public function setEnumStringRequired($enum_string_required) - { - $allowedValues = $this->getEnumStringRequiredAllowableValues(); - if (!in_array($enum_string_required, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'enum_string_required', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['enum_string_required'] = $enum_string_required; - - return $this; - } - - /** - * Gets enum_integer - * - * @return int|null - */ - public function getEnumInteger() - { - return $this->container['enum_integer']; - } - - /** - * Sets enum_integer - * - * @param int|null $enum_integer enum_integer - * - * @return $this - */ - public function setEnumInteger($enum_integer) - { - $allowedValues = $this->getEnumIntegerAllowableValues(); - if (!is_null($enum_integer) && !in_array($enum_integer, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'enum_integer', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['enum_integer'] = $enum_integer; - - return $this; - } - - /** - * Gets enum_number - * - * @return double|null - */ - public function getEnumNumber() - { - return $this->container['enum_number']; - } - - /** - * Sets enum_number - * - * @param double|null $enum_number enum_number - * - * @return $this - */ - public function setEnumNumber($enum_number) - { - $allowedValues = $this->getEnumNumberAllowableValues(); - if (!is_null($enum_number) && !in_array($enum_number, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'enum_number', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['enum_number'] = $enum_number; - - return $this; - } - - /** - * Gets outer_enum - * - * @return \OpenAPI\Client\Model\OuterEnum|null - */ - public function getOuterEnum() - { - return $this->container['outer_enum']; - } - - /** - * Sets outer_enum - * - * @param \OpenAPI\Client\Model\OuterEnum|null $outer_enum outer_enum - * - * @return $this - */ - public function setOuterEnum($outer_enum) - { - $this->container['outer_enum'] = $outer_enum; - - return $this; - } - - /** - * Gets outer_enum_integer - * - * @return \OpenAPI\Client\Model\OuterEnumInteger|null - */ - public function getOuterEnumInteger() - { - return $this->container['outer_enum_integer']; - } - - /** - * Sets outer_enum_integer - * - * @param \OpenAPI\Client\Model\OuterEnumInteger|null $outer_enum_integer outer_enum_integer - * - * @return $this - */ - public function setOuterEnumInteger($outer_enum_integer) - { - $this->container['outer_enum_integer'] = $outer_enum_integer; - - return $this; - } - - /** - * Gets outer_enum_default_value - * - * @return \OpenAPI\Client\Model\OuterEnumDefaultValue|null - */ - public function getOuterEnumDefaultValue() - { - return $this->container['outer_enum_default_value']; - } - - /** - * Sets outer_enum_default_value - * - * @param \OpenAPI\Client\Model\OuterEnumDefaultValue|null $outer_enum_default_value outer_enum_default_value - * - * @return $this - */ - public function setOuterEnumDefaultValue($outer_enum_default_value) - { - $this->container['outer_enum_default_value'] = $outer_enum_default_value; - - return $this; - } - - /** - * Gets outer_enum_integer_default_value - * - * @return \OpenAPI\Client\Model\OuterEnumIntegerDefaultValue|null - */ - public function getOuterEnumIntegerDefaultValue() - { - return $this->container['outer_enum_integer_default_value']; - } - - /** - * Sets outer_enum_integer_default_value - * - * @param \OpenAPI\Client\Model\OuterEnumIntegerDefaultValue|null $outer_enum_integer_default_value outer_enum_integer_default_value - * - * @return $this - */ - public function setOuterEnumIntegerDefaultValue($outer_enum_integer_default_value) - { - $this->container['outer_enum_integer_default_value'] = $outer_enum_integer_default_value; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php deleted file mode 100644 index 03a15d5b802..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ /dev/null @@ -1,308 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'source_uri' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'source_uri' => 'sourceURI' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'source_uri' => 'setSourceUri' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'source_uri' => 'getSourceUri' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['source_uri'] = isset($data['source_uri']) ? $data['source_uri'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets source_uri - * - * @return string|null - */ - public function getSourceUri() - { - return $this->container['source_uri']; - } - - /** - * Sets source_uri - * - * @param string|null $source_uri Test capitalization - * - * @return $this - */ - public function setSourceUri($source_uri) - { - $this->container['source_uri'] = $source_uri; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php deleted file mode 100644 index 4f8ffd8d9de..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ /dev/null @@ -1,337 +0,0 @@ - '\OpenAPI\Client\Model\File', - 'files' => '\OpenAPI\Client\Model\File[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'file' => null, - 'files' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'file' => 'file', - 'files' => 'files' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'file' => 'setFile', - 'files' => 'setFiles' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'file' => 'getFile', - 'files' => 'getFiles' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['file'] = isset($data['file']) ? $data['file'] : null; - $this->container['files'] = isset($data['files']) ? $data['files'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets file - * - * @return \OpenAPI\Client\Model\File|null - */ - public function getFile() - { - return $this->container['file']; - } - - /** - * Sets file - * - * @param \OpenAPI\Client\Model\File|null $file file - * - * @return $this - */ - public function setFile($file) - { - $this->container['file'] = $file; - - return $this; - } - - /** - * Gets files - * - * @return \OpenAPI\Client\Model\File[]|null - */ - public function getFiles() - { - return $this->container['files']; - } - - /** - * Sets files - * - * @param \OpenAPI\Client\Model\File[]|null $files files - * - * @return $this - */ - public function setFiles($files) - { - $this->container['files'] = $files; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php deleted file mode 100644 index 0394d187aca..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ /dev/null @@ -1,861 +0,0 @@ - 'int', - 'int32' => 'int', - 'int64' => 'int', - 'number' => 'float', - 'float' => 'float', - 'double' => 'double', - 'string' => 'string', - 'byte' => 'string', - 'binary' => '\SplFileObject', - 'date' => '\DateTime', - 'date_time' => '\DateTime', - 'uuid' => 'string', - 'password' => 'string', - 'pattern_with_digits' => 'string', - 'pattern_with_digits_and_delimiter' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'integer' => null, - 'int32' => 'int32', - 'int64' => 'int64', - 'number' => null, - 'float' => 'float', - 'double' => 'double', - 'string' => null, - 'byte' => 'byte', - 'binary' => 'binary', - 'date' => 'date', - 'date_time' => 'date-time', - 'uuid' => 'uuid', - 'password' => 'password', - 'pattern_with_digits' => null, - 'pattern_with_digits_and_delimiter' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'integer' => 'integer', - 'int32' => 'int32', - 'int64' => 'int64', - 'number' => 'number', - 'float' => 'float', - 'double' => 'double', - 'string' => 'string', - 'byte' => 'byte', - 'binary' => 'binary', - 'date' => 'date', - 'date_time' => 'dateTime', - 'uuid' => 'uuid', - 'password' => 'password', - 'pattern_with_digits' => 'pattern_with_digits', - 'pattern_with_digits_and_delimiter' => 'pattern_with_digits_and_delimiter' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'integer' => 'setInteger', - 'int32' => 'setInt32', - 'int64' => 'setInt64', - 'number' => 'setNumber', - 'float' => 'setFloat', - 'double' => 'setDouble', - 'string' => 'setString', - 'byte' => 'setByte', - 'binary' => 'setBinary', - 'date' => 'setDate', - 'date_time' => 'setDateTime', - 'uuid' => 'setUuid', - 'password' => 'setPassword', - 'pattern_with_digits' => 'setPatternWithDigits', - 'pattern_with_digits_and_delimiter' => 'setPatternWithDigitsAndDelimiter' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'integer' => 'getInteger', - 'int32' => 'getInt32', - 'int64' => 'getInt64', - 'number' => 'getNumber', - 'float' => 'getFloat', - 'double' => 'getDouble', - 'string' => 'getString', - 'byte' => 'getByte', - 'binary' => 'getBinary', - 'date' => 'getDate', - 'date_time' => 'getDateTime', - 'uuid' => 'getUuid', - 'password' => 'getPassword', - 'pattern_with_digits' => 'getPatternWithDigits', - 'pattern_with_digits_and_delimiter' => 'getPatternWithDigitsAndDelimiter' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['integer'] = isset($data['integer']) ? $data['integer'] : null; - $this->container['int32'] = isset($data['int32']) ? $data['int32'] : null; - $this->container['int64'] = isset($data['int64']) ? $data['int64'] : null; - $this->container['number'] = isset($data['number']) ? $data['number'] : null; - $this->container['float'] = isset($data['float']) ? $data['float'] : null; - $this->container['double'] = isset($data['double']) ? $data['double'] : null; - $this->container['string'] = isset($data['string']) ? $data['string'] : null; - $this->container['byte'] = isset($data['byte']) ? $data['byte'] : null; - $this->container['binary'] = isset($data['binary']) ? $data['binary'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; - $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['pattern_with_digits'] = isset($data['pattern_with_digits']) ? $data['pattern_with_digits'] : null; - $this->container['pattern_with_digits_and_delimiter'] = isset($data['pattern_with_digits_and_delimiter']) ? $data['pattern_with_digits_and_delimiter'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if (!is_null($this->container['integer']) && ($this->container['integer'] > 100)) { - $invalidProperties[] = "invalid value for 'integer', must be smaller than or equal to 100."; - } - - if (!is_null($this->container['integer']) && ($this->container['integer'] < 10)) { - $invalidProperties[] = "invalid value for 'integer', must be bigger than or equal to 10."; - } - - if (!is_null($this->container['int32']) && ($this->container['int32'] > 200)) { - $invalidProperties[] = "invalid value for 'int32', must be smaller than or equal to 200."; - } - - if (!is_null($this->container['int32']) && ($this->container['int32'] < 20)) { - $invalidProperties[] = "invalid value for 'int32', must be bigger than or equal to 20."; - } - - if ($this->container['number'] === null) { - $invalidProperties[] = "'number' can't be null"; - } - if (($this->container['number'] > 543.2)) { - $invalidProperties[] = "invalid value for 'number', must be smaller than or equal to 543.2."; - } - - if (($this->container['number'] < 32.1)) { - $invalidProperties[] = "invalid value for 'number', must be bigger than or equal to 32.1."; - } - - if (!is_null($this->container['float']) && ($this->container['float'] > 987.6)) { - $invalidProperties[] = "invalid value for 'float', must be smaller than or equal to 987.6."; - } - - if (!is_null($this->container['float']) && ($this->container['float'] < 54.3)) { - $invalidProperties[] = "invalid value for 'float', must be bigger than or equal to 54.3."; - } - - if (!is_null($this->container['double']) && ($this->container['double'] > 123.4)) { - $invalidProperties[] = "invalid value for 'double', must be smaller than or equal to 123.4."; - } - - if (!is_null($this->container['double']) && ($this->container['double'] < 67.8)) { - $invalidProperties[] = "invalid value for 'double', must be bigger than or equal to 67.8."; - } - - if (!is_null($this->container['string']) && !preg_match("/[a-z]/i", $this->container['string'])) { - $invalidProperties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i."; - } - - if ($this->container['byte'] === null) { - $invalidProperties[] = "'byte' can't be null"; - } - if ($this->container['date'] === null) { - $invalidProperties[] = "'date' can't be null"; - } - if ($this->container['password'] === null) { - $invalidProperties[] = "'password' can't be null"; - } - if ((mb_strlen($this->container['password']) > 64)) { - $invalidProperties[] = "invalid value for 'password', the character length must be smaller than or equal to 64."; - } - - if ((mb_strlen($this->container['password']) < 10)) { - $invalidProperties[] = "invalid value for 'password', the character length must be bigger than or equal to 10."; - } - - if (!is_null($this->container['pattern_with_digits']) && !preg_match("/^\\d{10}$/", $this->container['pattern_with_digits'])) { - $invalidProperties[] = "invalid value for 'pattern_with_digits', must be conform to the pattern /^\\d{10}$/."; - } - - if (!is_null($this->container['pattern_with_digits_and_delimiter']) && !preg_match("/^image_\\d{1,3}$/i", $this->container['pattern_with_digits_and_delimiter'])) { - $invalidProperties[] = "invalid value for 'pattern_with_digits_and_delimiter', must be conform to the pattern /^image_\\d{1,3}$/i."; - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets integer - * - * @return int|null - */ - public function getInteger() - { - return $this->container['integer']; - } - - /** - * Sets integer - * - * @param int|null $integer integer - * - * @return $this - */ - public function setInteger($integer) - { - - if (!is_null($integer) && ($integer > 100)) { - throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.'); - } - if (!is_null($integer) && ($integer < 10)) { - throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.'); - } - - $this->container['integer'] = $integer; - - return $this; - } - - /** - * Gets int32 - * - * @return int|null - */ - public function getInt32() - { - return $this->container['int32']; - } - - /** - * Sets int32 - * - * @param int|null $int32 int32 - * - * @return $this - */ - public function setInt32($int32) - { - - if (!is_null($int32) && ($int32 > 200)) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.'); - } - if (!is_null($int32) && ($int32 < 20)) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.'); - } - - $this->container['int32'] = $int32; - - return $this; - } - - /** - * Gets int64 - * - * @return int|null - */ - public function getInt64() - { - return $this->container['int64']; - } - - /** - * Sets int64 - * - * @param int|null $int64 int64 - * - * @return $this - */ - public function setInt64($int64) - { - $this->container['int64'] = $int64; - - return $this; - } - - /** - * Gets number - * - * @return float - */ - public function getNumber() - { - return $this->container['number']; - } - - /** - * Sets number - * - * @param float $number number - * - * @return $this - */ - public function setNumber($number) - { - - if (($number > 543.2)) { - throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.'); - } - if (($number < 32.1)) { - throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.'); - } - - $this->container['number'] = $number; - - return $this; - } - - /** - * Gets float - * - * @return float|null - */ - public function getFloat() - { - return $this->container['float']; - } - - /** - * Sets float - * - * @param float|null $float float - * - * @return $this - */ - public function setFloat($float) - { - - if (!is_null($float) && ($float > 987.6)) { - throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.'); - } - if (!is_null($float) && ($float < 54.3)) { - throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.'); - } - - $this->container['float'] = $float; - - return $this; - } - - /** - * Gets double - * - * @return double|null - */ - public function getDouble() - { - return $this->container['double']; - } - - /** - * Sets double - * - * @param double|null $double double - * - * @return $this - */ - public function setDouble($double) - { - - if (!is_null($double) && ($double > 123.4)) { - throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.'); - } - if (!is_null($double) && ($double < 67.8)) { - throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.'); - } - - $this->container['double'] = $double; - - return $this; - } - - /** - * Gets string - * - * @return string|null - */ - public function getString() - { - return $this->container['string']; - } - - /** - * Sets string - * - * @param string|null $string string - * - * @return $this - */ - public function setString($string) - { - - if (!is_null($string) && (!preg_match("/[a-z]/i", $string))) { - throw new \InvalidArgumentException("invalid value for $string when calling FormatTest., must conform to the pattern /[a-z]/i."); - } - - $this->container['string'] = $string; - - return $this; - } - - /** - * Gets byte - * - * @return string - */ - public function getByte() - { - return $this->container['byte']; - } - - /** - * Sets byte - * - * @param string $byte byte - * - * @return $this - */ - public function setByte($byte) - { - $this->container['byte'] = $byte; - - return $this; - } - - /** - * Gets binary - * - * @return \SplFileObject|null - */ - public function getBinary() - { - return $this->container['binary']; - } - - /** - * Sets binary - * - * @param \SplFileObject|null $binary binary - * - * @return $this - */ - public function setBinary($binary) - { - $this->container['binary'] = $binary; - - return $this; - } - - /** - * Gets date - * - * @return \DateTime - */ - public function getDate() - { - return $this->container['date']; - } - - /** - * Sets date - * - * @param \DateTime $date date - * - * @return $this - */ - public function setDate($date) - { - $this->container['date'] = $date; - - return $this; - } - - /** - * Gets date_time - * - * @return \DateTime|null - */ - public function getDateTime() - { - return $this->container['date_time']; - } - - /** - * Sets date_time - * - * @param \DateTime|null $date_time date_time - * - * @return $this - */ - public function setDateTime($date_time) - { - $this->container['date_time'] = $date_time; - - return $this; - } - - /** - * Gets uuid - * - * @return string|null - */ - public function getUuid() - { - return $this->container['uuid']; - } - - /** - * Sets uuid - * - * @param string|null $uuid uuid - * - * @return $this - */ - public function setUuid($uuid) - { - $this->container['uuid'] = $uuid; - - return $this; - } - - /** - * Gets password - * - * @return string - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string $password password - * - * @return $this - */ - public function setPassword($password) - { - if ((mb_strlen($password) > 64)) { - throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.'); - } - if ((mb_strlen($password) < 10)) { - throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.'); - } - - $this->container['password'] = $password; - - return $this; - } - - /** - * Gets pattern_with_digits - * - * @return string|null - */ - public function getPatternWithDigits() - { - return $this->container['pattern_with_digits']; - } - - /** - * Sets pattern_with_digits - * - * @param string|null $pattern_with_digits A string that is a 10 digit number. Can have leading zeros. - * - * @return $this - */ - public function setPatternWithDigits($pattern_with_digits) - { - - if (!is_null($pattern_with_digits) && (!preg_match("/^\\d{10}$/", $pattern_with_digits))) { - throw new \InvalidArgumentException("invalid value for $pattern_with_digits when calling FormatTest., must conform to the pattern /^\\d{10}$/."); - } - - $this->container['pattern_with_digits'] = $pattern_with_digits; - - return $this; - } - - /** - * Gets pattern_with_digits_and_delimiter - * - * @return string|null - */ - public function getPatternWithDigitsAndDelimiter() - { - return $this->container['pattern_with_digits_and_delimiter']; - } - - /** - * Sets pattern_with_digits_and_delimiter - * - * @param string|null $pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - * - * @return $this - */ - public function setPatternWithDigitsAndDelimiter($pattern_with_digits_and_delimiter) - { - - if (!is_null($pattern_with_digits_and_delimiter) && (!preg_match("/^image_\\d{1,3}$/i", $pattern_with_digits_and_delimiter))) { - throw new \InvalidArgumentException("invalid value for $pattern_with_digits_and_delimiter when calling FormatTest., must conform to the pattern /^image_\\d{1,3}$/i."); - } - - $this->container['pattern_with_digits_and_delimiter'] = $pattern_with_digits_and_delimiter; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php deleted file mode 100644 index 40a8e5584fc..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ /dev/null @@ -1,337 +0,0 @@ - 'string', - 'foo' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'bar' => null, - 'foo' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'bar' => 'bar', - 'foo' => 'foo' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'bar' => 'setBar', - 'foo' => 'setFoo' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'bar' => 'getBar', - 'foo' => 'getFoo' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['bar'] = isset($data['bar']) ? $data['bar'] : null; - $this->container['foo'] = isset($data['foo']) ? $data['foo'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets bar - * - * @return string|null - */ - public function getBar() - { - return $this->container['bar']; - } - - /** - * Sets bar - * - * @param string|null $bar bar - * - * @return $this - */ - public function setBar($bar) - { - $this->container['bar'] = $bar; - - return $this; - } - - /** - * Gets foo - * - * @return string|null - */ - public function getFoo() - { - return $this->container['foo']; - } - - /** - * Sets foo - * - * @param string|null $foo foo - * - * @return $this - */ - public function setFoo($foo) - { - $this->container['foo'] = $foo; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php deleted file mode 100644 index be76b2439b9..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ /dev/null @@ -1,421 +0,0 @@ - 'map[string,map[string,string]]', - 'map_of_enum_string' => 'map[string,string]', - 'direct_map' => 'map[string,bool]', - 'indirect_map' => 'map[string,bool]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'map_map_of_string' => null, - 'map_of_enum_string' => null, - 'direct_map' => null, - 'indirect_map' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'map_map_of_string' => 'map_map_of_string', - 'map_of_enum_string' => 'map_of_enum_string', - 'direct_map' => 'direct_map', - 'indirect_map' => 'indirect_map' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'map_map_of_string' => 'setMapMapOfString', - 'map_of_enum_string' => 'setMapOfEnumString', - 'direct_map' => 'setDirectMap', - 'indirect_map' => 'setIndirectMap' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'map_map_of_string' => 'getMapMapOfString', - 'map_of_enum_string' => 'getMapOfEnumString', - 'direct_map' => 'getDirectMap', - 'indirect_map' => 'getIndirectMap' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const MAP_OF_ENUM_STRING_UPPER = 'UPPER'; - const MAP_OF_ENUM_STRING_LOWER = 'lower'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getMapOfEnumStringAllowableValues() - { - return [ - self::MAP_OF_ENUM_STRING_UPPER, - self::MAP_OF_ENUM_STRING_LOWER, - ]; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['map_map_of_string'] = isset($data['map_map_of_string']) ? $data['map_map_of_string'] : null; - $this->container['map_of_enum_string'] = isset($data['map_of_enum_string']) ? $data['map_of_enum_string'] : null; - $this->container['direct_map'] = isset($data['direct_map']) ? $data['direct_map'] : null; - $this->container['indirect_map'] = isset($data['indirect_map']) ? $data['indirect_map'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets map_map_of_string - * - * @return map[string,map[string,string]]|null - */ - public function getMapMapOfString() - { - return $this->container['map_map_of_string']; - } - - /** - * Sets map_map_of_string - * - * @param map[string,map[string,string]]|null $map_map_of_string map_map_of_string - * - * @return $this - */ - public function setMapMapOfString($map_map_of_string) - { - $this->container['map_map_of_string'] = $map_map_of_string; - - return $this; - } - - /** - * Gets map_of_enum_string - * - * @return map[string,string]|null - */ - public function getMapOfEnumString() - { - return $this->container['map_of_enum_string']; - } - - /** - * Sets map_of_enum_string - * - * @param map[string,string]|null $map_of_enum_string map_of_enum_string - * - * @return $this - */ - public function setMapOfEnumString($map_of_enum_string) - { - $allowedValues = $this->getMapOfEnumStringAllowableValues(); - if (!is_null($map_of_enum_string) && array_diff($map_of_enum_string, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'map_of_enum_string', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['map_of_enum_string'] = $map_of_enum_string; - - return $this; - } - - /** - * Gets direct_map - * - * @return map[string,bool]|null - */ - public function getDirectMap() - { - return $this->container['direct_map']; - } - - /** - * Sets direct_map - * - * @param map[string,bool]|null $direct_map direct_map - * - * @return $this - */ - public function setDirectMap($direct_map) - { - $this->container['direct_map'] = $direct_map; - - return $this; - } - - /** - * Gets indirect_map - * - * @return map[string,bool]|null - */ - public function getIndirectMap() - { - return $this->container['indirect_map']; - } - - /** - * Sets indirect_map - * - * @param map[string,bool]|null $indirect_map indirect_map - * - * @return $this - */ - public function setIndirectMap($indirect_map) - { - $this->container['indirect_map'] = $indirect_map; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php deleted file mode 100644 index 2522e4d5d52..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ /dev/null @@ -1,367 +0,0 @@ - 'string', - 'date_time' => '\DateTime', - 'map' => 'map[string,\OpenAPI\Client\Model\Animal]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'uuid' => 'uuid', - 'date_time' => 'date-time', - 'map' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'uuid' => 'uuid', - 'date_time' => 'dateTime', - 'map' => 'map' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'uuid' => 'setUuid', - 'date_time' => 'setDateTime', - 'map' => 'setMap' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'uuid' => 'getUuid', - 'date_time' => 'getDateTime', - 'map' => 'getMap' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; - $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; - $this->container['map'] = isset($data['map']) ? $data['map'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets uuid - * - * @return string|null - */ - public function getUuid() - { - return $this->container['uuid']; - } - - /** - * Sets uuid - * - * @param string|null $uuid uuid - * - * @return $this - */ - public function setUuid($uuid) - { - $this->container['uuid'] = $uuid; - - return $this; - } - - /** - * Gets date_time - * - * @return \DateTime|null - */ - public function getDateTime() - { - return $this->container['date_time']; - } - - /** - * Sets date_time - * - * @param \DateTime|null $date_time date_time - * - * @return $this - */ - public function setDateTime($date_time) - { - $this->container['date_time'] = $date_time; - - return $this; - } - - /** - * Gets map - * - * @return map[string,\OpenAPI\Client\Model\Animal]|null - */ - public function getMap() - { - return $this->container['map']; - } - - /** - * Sets map - * - * @param map[string,\OpenAPI\Client\Model\Animal]|null $map map - * - * @return $this - */ - public function setMap($map) - { - $this->container['map'] = $map; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php deleted file mode 100644 index 5be747eb525..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ /dev/null @@ -1,338 +0,0 @@ - 'int', - 'class' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'name' => 'int32', - 'class' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'name' => 'name', - 'class' => 'class' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', - 'class' => 'setClass' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', - 'class' => 'getClass' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['class'] = isset($data['class']) ? $data['class'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets name - * - * @return int|null - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param int|null $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets class - * - * @return string|null - */ - public function getClass() - { - return $this->container['class']; - } - - /** - * Sets class - * - * @param string|null $class class - * - * @return $this - */ - public function setClass($class) - { - $this->container['class'] = $class; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php deleted file mode 100644 index fcfdd67eebf..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ /dev/null @@ -1,96 +0,0 @@ - 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - '_123_list' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - '_123_list' => '123-list' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - '_123_list' => 'set123List' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - '_123_list' => 'get123List' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['_123_list'] = isset($data['_123_list']) ? $data['_123_list'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets _123_list - * - * @return string|null - */ - public function get123List() - { - return $this->container['_123_list']; - } - - /** - * Sets _123_list - * - * @param string|null $_123_list _123_list - * - * @return $this - */ - public function set123List($_123_list) - { - $this->container['_123_list'] = $_123_list; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php deleted file mode 100644 index 7de6909e70b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ /dev/null @@ -1,308 +0,0 @@ - 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'return' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'return' => 'return' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'return' => 'setReturn' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'return' => 'getReturn' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['return'] = isset($data['return']) ? $data['return'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets return - * - * @return int|null - */ - public function getReturn() - { - return $this->container['return']; - } - - /** - * Sets return - * - * @param int|null $return return - * - * @return $this - */ - public function setReturn($return) - { - $this->container['return'] = $return; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php deleted file mode 100644 index a3eddb49986..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ /dev/null @@ -1,401 +0,0 @@ - 'int', - 'snake_case' => 'int', - 'property' => 'string', - '_123_number' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'name' => 'int32', - 'snake_case' => 'int32', - 'property' => null, - '_123_number' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'name' => 'name', - 'snake_case' => 'snake_case', - 'property' => 'property', - '_123_number' => '123Number' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', - 'snake_case' => 'setSnakeCase', - 'property' => 'setProperty', - '_123_number' => 'set123Number' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', - 'snake_case' => 'getSnakeCase', - 'property' => 'getProperty', - '_123_number' => 'get123Number' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['snake_case'] = isset($data['snake_case']) ? $data['snake_case'] : null; - $this->container['property'] = isset($data['property']) ? $data['property'] : null; - $this->container['_123_number'] = isset($data['_123_number']) ? $data['_123_number'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets name - * - * @return int - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param int $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets snake_case - * - * @return int|null - */ - public function getSnakeCase() - { - return $this->container['snake_case']; - } - - /** - * Sets snake_case - * - * @param int|null $snake_case snake_case - * - * @return $this - */ - public function setSnakeCase($snake_case) - { - $this->container['snake_case'] = $snake_case; - - return $this; - } - - /** - * Gets property - * - * @return string|null - */ - public function getProperty() - { - return $this->container['property']; - } - - /** - * Sets property - * - * @param string|null $property property - * - * @return $this - */ - public function setProperty($property) - { - $this->container['property'] = $property; - - return $this; - } - - /** - * Gets _123_number - * - * @return int|null - */ - public function get123Number() - { - return $this->container['_123_number']; - } - - /** - * Sets _123_number - * - * @param int|null $_123_number _123_number - * - * @return $this - */ - public function set123Number($_123_number) - { - $this->container['_123_number'] = $_123_number; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php deleted file mode 100644 index 17b092299c1..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ /dev/null @@ -1,307 +0,0 @@ - 'float' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'just_number' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'just_number' => 'JustNumber' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'just_number' => 'setJustNumber' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'just_number' => 'getJustNumber' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['just_number'] = isset($data['just_number']) ? $data['just_number'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets just_number - * - * @return float|null - */ - public function getJustNumber() - { - return $this->container['just_number']; - } - - /** - * Sets just_number - * - * @param float|null $just_number just_number - * - * @return $this - */ - public function setJustNumber($just_number) - { - $this->container['just_number'] = $just_number; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php deleted file mode 100644 index 0fce0df270c..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ /dev/null @@ -1,491 +0,0 @@ - 'int', - 'pet_id' => 'int', - 'quantity' => 'int', - 'ship_date' => '\DateTime', - 'status' => 'string', - 'complete' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => 'int64', - 'pet_id' => 'int64', - 'quantity' => 'int32', - 'ship_date' => 'date-time', - 'status' => null, - 'complete' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'pet_id' => 'petId', - 'quantity' => 'quantity', - 'ship_date' => 'shipDate', - 'status' => 'status', - 'complete' => 'complete' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'pet_id' => 'setPetId', - 'quantity' => 'setQuantity', - 'ship_date' => 'setShipDate', - 'status' => 'setStatus', - 'complete' => 'setComplete' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'pet_id' => 'getPetId', - 'quantity' => 'getQuantity', - 'ship_date' => 'getShipDate', - 'status' => 'getStatus', - 'complete' => 'getComplete' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const STATUS_PLACED = 'placed'; - const STATUS_APPROVED = 'approved'; - const STATUS_DELIVERED = 'delivered'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_PLACED, - self::STATUS_APPROVED, - self::STATUS_DELIVERED, - ]; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['pet_id'] = isset($data['pet_id']) ? $data['pet_id'] : null; - $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; - $this->container['ship_date'] = isset($data['ship_date']) ? $data['ship_date'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['complete'] = isset($data['complete']) ? $data['complete'] : false; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return int|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int|null $id id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets pet_id - * - * @return int|null - */ - public function getPetId() - { - return $this->container['pet_id']; - } - - /** - * Sets pet_id - * - * @param int|null $pet_id pet_id - * - * @return $this - */ - public function setPetId($pet_id) - { - $this->container['pet_id'] = $pet_id; - - return $this; - } - - /** - * Gets quantity - * - * @return int|null - */ - public function getQuantity() - { - return $this->container['quantity']; - } - - /** - * Sets quantity - * - * @param int|null $quantity quantity - * - * @return $this - */ - public function setQuantity($quantity) - { - $this->container['quantity'] = $quantity; - - return $this; - } - - /** - * Gets ship_date - * - * @return \DateTime|null - */ - public function getShipDate() - { - return $this->container['ship_date']; - } - - /** - * Sets ship_date - * - * @param \DateTime|null $ship_date ship_date - * - * @return $this - */ - public function setShipDate($ship_date) - { - $this->container['ship_date'] = $ship_date; - - return $this; - } - - /** - * Gets status - * - * @return string|null - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string|null $status Order Status - * - * @return $this - */ - public function setStatus($status) - { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets complete - * - * @return bool|null - */ - public function getComplete() - { - return $this->container['complete']; - } - - /** - * Sets complete - * - * @param bool|null $complete complete - * - * @return $this - */ - public function setComplete($complete) - { - $this->container['complete'] = $complete; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php deleted file mode 100644 index cab3e72a8c4..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ /dev/null @@ -1,367 +0,0 @@ - 'float', - 'my_string' => 'string', - 'my_boolean' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'my_number' => null, - 'my_string' => null, - 'my_boolean' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'my_number' => 'my_number', - 'my_string' => 'my_string', - 'my_boolean' => 'my_boolean' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'my_number' => 'setMyNumber', - 'my_string' => 'setMyString', - 'my_boolean' => 'setMyBoolean' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'my_number' => 'getMyNumber', - 'my_string' => 'getMyString', - 'my_boolean' => 'getMyBoolean' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['my_number'] = isset($data['my_number']) ? $data['my_number'] : null; - $this->container['my_string'] = isset($data['my_string']) ? $data['my_string'] : null; - $this->container['my_boolean'] = isset($data['my_boolean']) ? $data['my_boolean'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets my_number - * - * @return float|null - */ - public function getMyNumber() - { - return $this->container['my_number']; - } - - /** - * Sets my_number - * - * @param float|null $my_number my_number - * - * @return $this - */ - public function setMyNumber($my_number) - { - $this->container['my_number'] = $my_number; - - return $this; - } - - /** - * Gets my_string - * - * @return string|null - */ - public function getMyString() - { - return $this->container['my_string']; - } - - /** - * Sets my_string - * - * @param string|null $my_string my_string - * - * @return $this - */ - public function setMyString($my_string) - { - $this->container['my_string'] = $my_string; - - return $this; - } - - /** - * Gets my_boolean - * - * @return bool|null - */ - public function getMyBoolean() - { - return $this->container['my_boolean']; - } - - /** - * Sets my_boolean - * - * @param bool|null $my_boolean my_boolean - * - * @return $this - */ - public function setMyBoolean($my_boolean) - { - $this->container['my_boolean'] = $my_boolean; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php deleted file mode 100644 index e9314682d6c..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ /dev/null @@ -1,64 +0,0 @@ - 'int', - 'category' => '\OpenAPI\Client\Model\Category', - 'name' => 'string', - 'photo_urls' => 'string[]', - 'tags' => '\OpenAPI\Client\Model\Tag[]', - 'status' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => 'int64', - 'category' => null, - 'name' => null, - 'photo_urls' => null, - 'tags' => null, - 'status' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'category' => 'category', - 'name' => 'name', - 'photo_urls' => 'photoUrls', - 'tags' => 'tags', - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'category' => 'setCategory', - 'name' => 'setName', - 'photo_urls' => 'setPhotoUrls', - 'tags' => 'setTags', - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'category' => 'getCategory', - 'name' => 'getName', - 'photo_urls' => 'getPhotoUrls', - 'tags' => 'getTags', - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const STATUS_AVAILABLE = 'available'; - const STATUS_PENDING = 'pending'; - const STATUS_SOLD = 'sold'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_AVAILABLE, - self::STATUS_PENDING, - self::STATUS_SOLD, - ]; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['category'] = isset($data['category']) ? $data['category'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['photo_urls'] = isset($data['photo_urls']) ? $data['photo_urls'] : null; - $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['photo_urls'] === null) { - $invalidProperties[] = "'photo_urls' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return int|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int|null $id id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets category - * - * @return \OpenAPI\Client\Model\Category|null - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param \OpenAPI\Client\Model\Category|null $category category - * - * @return $this - */ - public function setCategory($category) - { - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets photo_urls - * - * @return string[] - */ - public function getPhotoUrls() - { - return $this->container['photo_urls']; - } - - /** - * Sets photo_urls - * - * @param string[] $photo_urls photo_urls - * - * @return $this - */ - public function setPhotoUrls($photo_urls) - { - $this->container['photo_urls'] = $photo_urls; - - return $this; - } - - /** - * Gets tags - * - * @return \OpenAPI\Client\Model\Tag[]|null - */ - public function getTags() - { - return $this->container['tags']; - } - - /** - * Sets tags - * - * @param \OpenAPI\Client\Model\Tag[]|null $tags tags - * - * @return $this - */ - public function setTags($tags) - { - $this->container['tags'] = $tags; - - return $this; - } - - /** - * Gets status - * - * @return string|null - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string|null $status pet status in the store - * - * @return $this - */ - public function setStatus($status) - { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php deleted file mode 100644 index 1cdb5ac74da..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ /dev/null @@ -1,337 +0,0 @@ - 'string', - 'baz' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'bar' => null, - 'baz' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'bar' => 'bar', - 'baz' => 'baz' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'bar' => 'setBar', - 'baz' => 'setBaz' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'bar' => 'getBar', - 'baz' => 'getBaz' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['bar'] = isset($data['bar']) ? $data['bar'] : null; - $this->container['baz'] = isset($data['baz']) ? $data['baz'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets bar - * - * @return string|null - */ - public function getBar() - { - return $this->container['bar']; - } - - /** - * Sets bar - * - * @param string|null $bar bar - * - * @return $this - */ - public function setBar($bar) - { - $this->container['bar'] = $bar; - - return $this; - } - - /** - * Gets baz - * - * @return string|null - */ - public function getBaz() - { - return $this->container['baz']; - } - - /** - * Sets baz - * - * @param string|null $baz baz - * - * @return $this - */ - public function setBaz($baz) - { - $this->container['baz'] = $baz; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php deleted file mode 100644 index b58e8fcff1e..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ /dev/null @@ -1,307 +0,0 @@ - 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'special_property_name' => 'int64' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'special_property_name' => '$special[property.name]' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'special_property_name' => 'setSpecialPropertyName' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'special_property_name' => 'getSpecialPropertyName' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['special_property_name'] = isset($data['special_property_name']) ? $data['special_property_name'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets special_property_name - * - * @return int|null - */ - public function getSpecialPropertyName() - { - return $this->container['special_property_name']; - } - - /** - * Sets special_property_name - * - * @param int|null $special_property_name special_property_name - * - * @return $this - */ - public function setSpecialPropertyName($special_property_name) - { - $this->container['special_property_name'] = $special_property_name; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php deleted file mode 100644 index 1c3dd48126d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ /dev/null @@ -1,337 +0,0 @@ - 'int', - 'name' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => 'int64', - 'name' => null - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'name' => 'name' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'name' => 'setName' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'name' => 'getName' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return int|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int|null $id id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets name - * - * @return string|null - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string|null $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php deleted file mode 100644 index 859a2025249..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ /dev/null @@ -1,517 +0,0 @@ - 'int', - 'username' => 'string', - 'first_name' => 'string', - 'last_name' => 'string', - 'email' => 'string', - 'password' => 'string', - 'phone' => 'string', - 'user_status' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => 'int64', - 'username' => null, - 'first_name' => null, - 'last_name' => null, - 'email' => null, - 'password' => null, - 'phone' => null, - 'user_status' => 'int32' - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'id' => 'id', - 'username' => 'username', - 'first_name' => 'firstName', - 'last_name' => 'lastName', - 'email' => 'email', - 'password' => 'password', - 'phone' => 'phone', - 'user_status' => 'userStatus' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'username' => 'setUsername', - 'first_name' => 'setFirstName', - 'last_name' => 'setLastName', - 'email' => 'setEmail', - 'password' => 'setPassword', - 'phone' => 'setPhone', - 'user_status' => 'setUserStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'username' => 'getUsername', - 'first_name' => 'getFirstName', - 'last_name' => 'getLastName', - 'email' => 'getEmail', - 'password' => 'getPassword', - 'phone' => 'getPhone', - 'user_status' => 'getUserStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['username'] = isset($data['username']) ? $data['username'] : null; - $this->container['first_name'] = isset($data['first_name']) ? $data['first_name'] : null; - $this->container['last_name'] = isset($data['last_name']) ? $data['last_name'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; - $this->container['user_status'] = isset($data['user_status']) ? $data['user_status'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets id - * - * @return int|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param int|null $id id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets username - * - * @return string|null - */ - public function getUsername() - { - return $this->container['username']; - } - - /** - * Sets username - * - * @param string|null $username username - * - * @return $this - */ - public function setUsername($username) - { - $this->container['username'] = $username; - - return $this; - } - - /** - * Gets first_name - * - * @return string|null - */ - public function getFirstName() - { - return $this->container['first_name']; - } - - /** - * Sets first_name - * - * @param string|null $first_name first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->container['first_name'] = $first_name; - - return $this; - } - - /** - * Gets last_name - * - * @return string|null - */ - public function getLastName() - { - return $this->container['last_name']; - } - - /** - * Sets last_name - * - * @param string|null $last_name last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->container['last_name'] = $last_name; - - return $this; - } - - /** - * Gets email - * - * @return string|null - */ - public function getEmail() - { - return $this->container['email']; - } - - /** - * Sets email - * - * @param string|null $email email - * - * @return $this - */ - public function setEmail($email) - { - $this->container['email'] = $email; - - return $this; - } - - /** - * Gets password - * - * @return string|null - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string|null $password password - * - * @return $this - */ - public function setPassword($password) - { - $this->container['password'] = $password; - - return $this; - } - - /** - * Gets phone - * - * @return string|null - */ - public function getPhone() - { - return $this->container['phone']; - } - - /** - * Sets phone - * - * @param string|null $phone phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->container['phone'] = $phone; - - return $this; - } - - /** - * Gets user_status - * - * @return int|null - */ - public function getUserStatus() - { - return $this->container['user_status']; - } - - /** - * Sets user_status - * - * @param int|null $user_status User Status - * - * @return $this - */ - public function setUserStatus($user_status) - { - $this->container['user_status'] = $user_status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php deleted file mode 100644 index 1a12604649f..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ /dev/null @@ -1,352 +0,0 @@ -format('Y-m-d') : $data->format(self::$dateTimeFormat); - } elseif (is_array($data)) { - foreach ($data as $property => $value) { - $data[$property] = self::sanitizeForSerialization($value); - } - return $data; - } elseif (is_object($data)) { - $values = []; - if ($data instanceof ModelInterface) { - $formats = $data::openAPIFormats(); - foreach ($data::openAPITypes() as $property => $openAPIType) { - $getter = $data::getters()[$property]; - $value = $data->$getter(); - if ($value !== null - && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); - } - if ($value !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); - } - } - } else { - foreach($data as $property => $value) { - $values[$property] = self::sanitizeForSerialization($value); - } - } - return (object)$values; - } else { - return (string)$data; - } - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param string $filename filename to be sanitized - * - * @return string the sanitized filename - */ - public static function sanitizeFilename($filename) - { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { - return $match[1]; - } else { - return $filename; - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the path, by url-encoding. - * - * @param string $value a string which will be part of the path - * - * @return string the serialized object - */ - public static function toPathValue($value) - { - return rawurlencode(self::toString($value)); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. - * - * @param string[]|string|\DateTime $object an object to be serialized to a string - * - * @return string the serialized object - */ - public static function toQueryValue($object) - { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object); - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the header. If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string $value a string which will be part of the header - * - * @return string the header string - */ - public static function toHeaderValue($value) - { - if (method_exists($value, 'toHeaderValue')) { - return $value->toHeaderValue(); - } - - return self::toString($value); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the parameter. If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * If it's a boolean, convert it to "true" or "false". - * - * @param string|bool|\DateTime $value the value of the parameter - * - * @return string the header string - */ - public static function toString($value) - { - if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(self::$dateTimeFormat); - } elseif (is_bool($value)) { - return $value ? 'true' : 'false'; - } else { - return $value; - } - } - - /** - * Serialize an array to a string. - * - * @param array $collection collection to serialize to a string - * @param string $style the format use for serialization (csv, - * ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array - * - * @return string - */ - public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) - { - if ($allowCollectionFormatMulti && ('multi' === $style)) { - // http_build_query() almost does the job for us. We just - // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); - } - switch ($style) { - case 'pipeDelimited': - case 'pipes': - return implode('|', $collection); - - case 'tsv': - return implode("\t", $collection); - - case 'spaceDelimited': - case 'ssv': - return implode(' ', $collection); - - case 'simple': - case 'csv': - // Deliberate fall through. CSV is default format. - default: - return implode(',', $collection); - } - } - - /** - * Deserialize a JSON string into an object - * - * @param mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used - * - * @return object|array|null a single or an array of $class instances - */ - public static function deserialize($data, $class, $httpHeaders = null) - { - if (null === $data) { - return null; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] - $data = is_string($data) ? json_decode($data) : $data; - settype($data, 'array'); - $inner = substr($class, 4, -1); - $deserialized = []; - if (strrpos($inner, ",") !== false) { - $subClass_array = explode(',', $inner, 2); - $subClass = $subClass_array[1]; - foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null); - } - } - return $deserialized; - } elseif ($class === 'object') { - settype($data, 'array'); - return $data; - } elseif ($class === '\DateTime') { - // Some API's return an invalid, empty string as a - // date-time property. DateTime::__construct() will return - // the current time for empty input which is probably not - // what is meant. The invalid empty string is probably to - // be interpreted as a missing field/value. Let's handle - // this graceful. - if (!empty($data)) { - return new \DateTime($data); - } else { - return null; - } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; - } elseif ($class === '\SplFileObject') { - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); - } - return $data; - } else { - $data = is_string($data) ? json_decode($data) : $data; - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\OpenAPI\Client\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; - - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { - continue; - } - - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } - } - return $instance; - } - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist b/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist deleted file mode 100644 index 3dd90bbe32c..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/phpunit.xml.dist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - ./test/Api - ./test/Model - - - - - ./lib/Api - ./lib/Model - - - - - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/pom.xml b/samples/openapi3/client/petstore/php/OpenAPIClient-php/pom.xml deleted file mode 100644 index d5d32c3bd1b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - 4.0.0 - org.openapitools - PhpPetstoreOAS3Tests - pom - 1.0-SNAPSHOT - PHP OpenAPI OAS3 Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - bundle-install - pre-integration-test - - exec - - - composer - - install - - - - - bundle-test - integration-test - - exec - - - vendor/bin/phpunit - - tests - - - - - - - - diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php deleted file mode 100644 index e27cb94acc0..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ /dev/null @@ -1,84 +0,0 @@ -api = new Api\PetApi(); - - $this->petId = 10005; - $pet = new Model\Pet; - $pet->setId($this->petId); - $pet->setName("PHP Unit Test"); - $pet->setPhotoUrls(array("http://test_php_unit_test.com")); - // new tag - $tag= new Model\Tag; - $tag->setId($this->petId); // use the same id as pet - $tag->setName("test php tag"); - // new category - $category = new Model\Category; - $category->setId($this->petId); // use the same id as pet - $category->setName("test php category"); - - $pet->setTags(array($tag)); - $pet->setCategory($category); - - $pet_api = new Api\PetApi(); - // add a new pet (model) - $add_response = $pet_api->addPet($pet); - } - - public function testAsyncRequest() - { - $promise = $this->api->getPetByIdAsync(10005); - - $promise2 = $this->api->getPetByIdAsync(10005); - - $pet = $promise->wait(); - $pet2 = $promise2->wait(); - $this->assertInstanceOf(Pet::class, $pet); - $this->assertInstanceOf(Pet::class, $pet2); - } - - public function testAsyncRequestWithHttpInfo() - { - $promise = $this->api->getPetByIdAsyncWithHttpInfo($this->petId); - - list($pet, $status, $headers) = $promise->wait(); - $this->assertEquals(200, $status); - $this->assertIsArray($headers); - $this->assertInstanceOf(Pet::class, $pet); - } - - public function testAsyncThrowingException() - { - $this->expectException(\OpenAPI\Client\ApiException::class); - $promise = $this->api->getPetByIdAsync(0); - $promise->wait(); - } - - /** - * @doesNotPerformAssertions - */ - public function testAsyncApiExceptionWithoutWaitIsNotThrown() - { - $promise = $this->api->getPetByIdAsync(0); - sleep(1); - } - - public function testAsyncHttpInfoThrowingException() - { - $this->expectException(\OpenAPI\Client\ApiException::class); - $promise = $this->api->getPetByIdAsyncWithHttpInfo(0); - $promise->wait(); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php deleted file mode 100644 index daafb50ede7..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php +++ /dev/null @@ -1,63 +0,0 @@ -setApiKey('api_key', '123qwe'); - - $fakeHttpClient = new FakeHttpClient(); - $api = new PetApi($fakeHttpClient, $authConfig); - $api->getPetById(123); - - $headers = $fakeHttpClient->getLastRequest()->getHeaders(); - - $this->assertArrayHasKey('api_key', $headers); - $this->assertEquals(['123qwe'], $headers['api_key']); - } - - public function testApiToken() - { - $authConfig = new Configuration(); - $authConfig->setAccessToken('asd123'); - - $fakeHttpClient = new FakeHttpClient(); - $api = new PetApi($fakeHttpClient, $authConfig); - $api->addPet(new Pet()); - - $headers = $fakeHttpClient->getLastRequest()->getHeaders(); - - $this->assertArrayHasKey('Authorization', $headers); - $this->assertEquals(['Bearer asd123'], $headers['Authorization']); - } - - public function testBasicAuth() - { - $username = 'user'; - $password = 'password'; - - $authConfig = new Configuration(); - $authConfig->setUsername($username); - $authConfig->setPassword($password); - - $fakeHttpClient = new FakeHttpClient(); - $api = new FakeApi($fakeHttpClient, $authConfig); - $api->testEndpointParameters(123, 100.1, 'ASD_', 'ASD'); - - $headers = $fakeHttpClient->getLastRequest()->getHeaders(); - - $this->assertArrayHasKey('Authorization', $headers); - $encodedCredentials = base64_encode("$username:$password"); - $this->assertEquals(["Basic $encodedCredentials"], $headers['Authorization']); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php deleted file mode 100644 index ca0fc505d6d..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php +++ /dev/null @@ -1,40 +0,0 @@ - $dateTime, - ]); - - $data = ObjectSerializer::sanitizeForSerialization($input); - - $this->assertEquals($data->dateTime, '1973-04-30T17:05:00+02:00'); - - ObjectSerializer::setDateTimeFormat(\DateTime::RFC3339_EXTENDED); - $dataFraction = ObjectSerializer::sanitizeForSerialization($input); - $this->assertEquals($dataFraction->dateTime, '1973-04-30T17:05:00.000+02:00'); - ObjectSerializer::setDateTimeFormat(\DateTime::ATOM); - } - - public function testDateSanitazion() - { - $dateTime = new \DateTime('April 30, 1973 17:05 CEST'); - - $input = new FormatTest([ - 'date' => $dateTime, - ]); - - $data = ObjectSerializer::sanitizeForSerialization($input); - - $this->assertEquals($data->date, '1973-04-30'); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php deleted file mode 100644 index b14dd018df0..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php +++ /dev/null @@ -1,38 +0,0 @@ -setId(1); - $newPet->setName("PHP Unit Test"); - (new Api\PetApi())->addPetWithHttpInfo($newPet); - } - - public function testEnableDebugOutput() - { - $this->expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#'); - - $config = new Configuration(); - $config->setDebug(true); - $api = new Api\PetApi(null, $config); - $api->getPetById(1); - } - - public function testEnableDebugOutputAsync() - { - $this->expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#'); - - $config = new Configuration(); - $config->setDebug(true); - $api = new Api\PetApi(null, $config); - $promise = $api->getPetByIdAsync(1); - $promise->wait(); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php deleted file mode 100644 index fbc089c7f18..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php +++ /dev/null @@ -1,16 +0,0 @@ -assertSame(EnumClass::ABC, '_abc'); - $this->assertSame(EnumClass::EFG, '-efg'); - $this->assertSame(EnumClass::XYZ, '(xyz)'); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php deleted file mode 100644 index 1ce05cf4106..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php +++ /dev/null @@ -1,35 +0,0 @@ -assertSame(EnumTest::ENUM_STRING_UPPER, "UPPER"); - $this->assertSame(EnumTest::ENUM_STRING_LOWER, "lower"); - $this->assertSame(EnumTest::ENUM_INTEGER_1, 1); - $this->assertSame(EnumTest::ENUM_INTEGER_MINUS_1, -1); - $this->assertSame(EnumTest::ENUM_NUMBER_1_DOT_1, 1.1); - $this->assertSame(EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2); - } - - public function testNonRequiredPropertyIsOptional() - { - $enum = new EnumTest([ - 'enum_string_required' => 'UPPER', - ]); - $this->assertSame([], $enum->listInvalidProperties()); - $this->assertTrue($enum->valid()); - } - - public function testRequiredProperty() - { - $enum = new EnumTest(); - $this->assertSame(["'enum_string_required' can't be null"], $enum->listInvalidProperties()); - $this->assertFalse($enum->valid()); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php deleted file mode 100644 index c12388187fd..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php +++ /dev/null @@ -1,39 +0,0 @@ -expectException(\OpenAPI\Client\ApiException::class); - $this->expectExceptionCode(404); - $this->expectExceptionMessage('http://petstore.swagger.io/INVALID_URL/store/inventory'); - $config = new Configuration(); - $config->setHost('http://petstore.swagger.io/INVALID_URL'); - - $api = new Api\StoreApi( - new Client(), - $config - ); - $api->getInventory(); - } - - public function testWrongHost() - { - $this->expectException(\OpenAPI\Client\ApiException::class); - $this->expectExceptionMessage('Could not resolve'); - $this->expectExceptionMessage('wrong_host.zxc'); - $config = new Configuration(); - $config->setHost('http://wrong_host.zxc'); - - $api = new Api\StoreApi( - new Client(), - $config - ); - $api->getInventory(); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php deleted file mode 100644 index d93b8f8b0b3..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php +++ /dev/null @@ -1,69 +0,0 @@ -request; - } - - /** - * @param null|ResponseInterface $response - */ - public function setResponse(ResponseInterface $response = null) - { - $this->response = $response; - } - - /** - * Send an HTTP request. - * - * @param RequestInterface $request Request to send - * @param array $options Request options to apply to the given - * request and to the transfer. - * - * @return ResponseInterface - * @throws GuzzleException - */ - public function send(RequestInterface $request, array $options = []) - { - $this->request = $request; - return $this->response ?: new Response(200); - } - - public function sendAsync(RequestInterface $request, array $options = []) - { - throw new \RuntimeException('not implemented'); - } - - public function request($method, $uri, array $options = []) - { - throw new \RuntimeException('not implemented'); - } - - public function requestAsync($method, $uri, array $options = []) - { - throw new \RuntimeException('not implemented'); - } - - public function getConfig($option = null) - { - throw new \RuntimeException('not implemented'); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php deleted file mode 100644 index 6dd19a675f6..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php +++ /dev/null @@ -1,58 +0,0 @@ -selectHeaders([ - 'application/xml', - 'application/json' - ], []); - $this->assertSame('application/json', $headers['Accept']); - - $headers = $selector->selectHeaders([], []); - $this->assertArrayNotHasKey('Accept', $headers); - - $header = $selector->selectHeaders([ - 'application/yaml', - 'application/xml' - ], []); - $this->assertSame('application/yaml,application/xml', $header['Accept']); - - // test selectHeaderContentType - $headers = $selector->selectHeaders([], [ - 'application/xml', - 'application/json' - ]); - $this->assertSame('application/json', $headers['Content-Type']); - - $headers = $selector->selectHeaders([], []); - $this->assertSame('application/json', $headers['Content-Type']); - $headers = $selector->selectHeaders([], [ - 'application/yaml', - 'application/xml' - ]); - $this->assertSame('application/yaml,application/xml', $headers['Content-Type']); - } - - public function testSelectingHeadersForMultipartBody() - { - // test selectHeaderAccept - $selector = new HeaderSelector(); - $headers = $selector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); - $this->assertSame('application/json', $headers['Accept']); - $this->assertArrayNotHasKey('Content-Type', $headers); - - $headers = $selector->selectHeadersForMultipart([]); - $this->assertArrayNotHasKey('Accept', $headers); - $this->assertArrayNotHasKey('Content-Type', $headers); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php deleted file mode 100644 index 989516cc0c6..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php +++ /dev/null @@ -1,33 +0,0 @@ -fakeHttpClient = new FakeHttpClient(); - } - - public function testUserAgent() - { - $config = new Configuration(); - $config->setUserAgent('value'); - $api = new Api\PetApi($this->fakeHttpClient, $config); - - $api->getPetById(3); - - $request = $this->fakeHttpClient->getLastRequest(); - $headers = $request->getHeaders(); - - $this->assertArrayHasKey('User-Agent', $headers); - $this->assertEquals(['value'], $headers['User-Agent']); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php deleted file mode 100644 index 333b88bbeda..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php +++ /dev/null @@ -1,96 +0,0 @@ -assertSame('red', $dog->getColor()); - $this->assertSame('red', $animal->getColor()); - } - - /** - * test inheritance in the model - */ - public function testInheritance() - { - $newDog = new Dog; - // the object should be an instance of the derived class - $this->assertInstanceOf(Dog::class, $newDog); - // the object should also be an instance of the parent class - $this->assertInstanceOf(Animal::class, $newDog); - } - - /** - * test inheritance constructor is working with data initialization - */ - public function testInheritanceConstructorDataInitialization() - { - // initialize the object with data in the constructor - $data = [ - 'class_name' => 'Dog', - 'breed' => 'Great Dane', - ]; - $newDog = new Dog($data); - - // the property on the derived class should be set - $this->assertSame('Great Dane', $newDog->getBreed()); - // the property on the parent class should be set - $this->assertSame('Dog', $newDog->getClassName()); - } - - /** - * test if discriminator is initialized automatically - */ - public function testDiscriminatorInitialization() - { - $newDog = new Dog(); - $this->assertSame('Dog', $newDog->getClassName()); - } - - /** - * test if ArrayAccess interface works - */ - public function testArrayStuff() - { - // create an array of Animal - $farm = array(); - - // add some animals to the farm to make sure the ArrayAccess interface works - $farm[] = new Dog(); - $farm[] = new Cat(); - $farm[] = new Animal(); - - // assert we can look up the animals in the farm by array indices (let's try a random order) - $this->assertInstanceOf(Cat::class, $farm[1]); - $this->assertInstanceOf(Dog::class, $farm[0]); - $this->assertInstanceOf(Animal::class, $farm[2]); - - // let's try to `foreach` the animals in the farm and let's try to use the objects we loop through - foreach ($farm as $animal) { - $this->assertContains($animal->getClassName(), ['Dog', 'Cat', 'Animal']); - $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $animal); - } - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php deleted file mode 100644 index 818568873aa..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php +++ /dev/null @@ -1,27 +0,0 @@ -assertSame("sun.gif", $s->sanitizeFilename("sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("../sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("/var/tmp/sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("./sun.gif")); - - $this->assertSame("sun", $s->sanitizeFilename("sun")); - $this->assertSame("sun.gif", $s->sanitizeFilename("..\sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("\var\tmp\sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("c:\var\tmp\sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename(".\sun.gif")); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php deleted file mode 100644 index 3cfcc38f45a..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php +++ /dev/null @@ -1,133 +0,0 @@ -assertSame(Model\Order::STATUS_PLACED, "placed"); - $this->assertSame(Model\Order::STATUS_APPROVED, "approved"); - } - - // test get inventory - public function testOrder() - { - // initialize the API client - $order = new Model\Order(); - - $order->setStatus("placed"); - $this->assertSame("placed", $order->getStatus()); - } - - public function testOrderException() - { - // initialize the API client - $this->expectException(\InvalidArgumentException::class); - $order = new Model\Order(); - $order->setStatus("invalid_value"); - } - - // test deseralization of order - public function testDeserializationOfOrder() - { - $order_json = <<assertInstanceOf('OpenAPI\Client\Model\Order', $order); - $this->assertSame(10, $order->getId()); - $this->assertSame(20, $order->getPetId()); - $this->assertSame(30, $order->getQuantity()); - $this->assertTrue(new \DateTime("2015-08-22T07:13:36.613Z") == $order->getShipDate()); - $this->assertSame("placed", $order->getStatus()); - $this->assertSame(false, $order->getComplete()); - } - - // test deseralization of array of array of order - public function testDeserializationOfArrayOfArrayOfOrder() - { - $order_json = <<assertArrayHasKey(0, $order); - $this->assertArrayHasKey(0, $order[0]); - $_order = $order[0][0]; - $this->assertInstanceOf('OpenAPI\Client\Model\Order', $_order); - $this->assertSame(10, $_order->getId()); - $this->assertSame(20, $_order->getPetId()); - $this->assertSame(30, $_order->getQuantity()); - $this->assertTrue(new \DateTime("2015-08-22T07:13:36.613Z") == $_order->getShipDate()); - $this->assertSame("placed", $_order->getStatus()); - $this->assertSame(false, $_order->getComplete()); - } - - // test deseralization of map of map of order - public function testDeserializationOfMapOfMapOfOrder() - { - $order_json = <<assertArrayHasKey('test', $order); - $this->assertArrayHasKey('test2', $order['test']); - $_order = $order['test']['test2']; - $this->assertInstanceOf('OpenAPI\Client\Model\Order', $_order); - $this->assertSame(10, $_order->getId()); - $this->assertSame(20, $_order->getPetId()); - $this->assertSame(30, $_order->getQuantity()); - $this->assertTrue(new \DateTime("2015-08-22T07:13:36.613Z") == $_order->getShipDate()); - $this->assertSame("placed", $_order->getStatus()); - $this->assertSame(false, $_order->getComplete()); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php deleted file mode 100644 index 00777968f9b..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php +++ /dev/null @@ -1,95 +0,0 @@ -assertIsString($result); - $this->assertEquals('placed', $result); - } - - public function testDeserializeInvalidValue() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid value for enum'); - ObjectSerializer::deserialize( - "lkjfalgkdfjg", - OuterEnum::class - ); - } - - public function testDeserializeNested() - { - $json = '{ - "enum_string": "UPPER", - "enum_integer": -1, - "enum_number": -1.2, - "outerEnum": "approved" - }'; - - /** * @var EnumTest $result */ - $result = ObjectSerializer::deserialize( - json_decode($json), - EnumTest::class - ); - - $this->assertInstanceOf(EnumTest::class, $result); - $this->assertEquals('approved', $result->getOuterEnum()); - } - - public function testSanitize() - { - $json = "placed"; - - $result = ObjectSerializer::sanitizeForSerialization( - $json - ); - - $this->assertIsString($result); - } - - public function testSanitizeNested() - { - $input = new EnumTest([ - 'enum_string' => 'UPPER', - 'enum_integer' => -1, - 'enum_number' => -1.2, - 'outer_enum' => 'approved' - ]); - - $result = ObjectSerializer::sanitizeForSerialization( - $input - ); - - $this->assertIsObject($result); - $this->assertInstanceOf(\stdClass::class, $result); - - $this->assertIsString($result->outerEnum); - $this->assertEquals('approved', $result->outerEnum); - } - - public function testSanitizeNestedInvalidValue() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid value for enum'); - $input = new EnumTest([ - 'enum_string' => 'UPPER', - 'enum_integer' => -1, - 'enum_number' => -1.2, - 'outer_enum' => 'invalid_value' - ]); - - ObjectSerializer::sanitizeForSerialization($input); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php deleted file mode 100644 index aed0fade808..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php +++ /dev/null @@ -1,66 +0,0 @@ -fakeHttpClient = new FakeHttpClient(); - $this->fakeApi = new Api\FakeApi($this->fakeHttpClient); - $this->userApi = new Api\UserApi($this->fakeHttpClient); - } - - public function testHeaderParam() - { - $this->fakeApi->testEnumParameters([], 'something'); - - $request = $this->fakeHttpClient->getLastRequest(); - $headers = $request->getHeaders(); - - $this->assertArrayHasKey('enum_header_string', $headers); - $this->assertEquals(['something'], $headers['enum_header_string']); - } - - public function testHeaderParamCollection() - { - $this->fakeApi->testEnumParameters(['string1', 'string2']); - - $request = $this->fakeHttpClient->getLastRequest(); - $headers = $request->getHeaders(); - - $this->assertArrayHasKey('enum_header_string_array', $headers); - $this->assertEquals(['string1,string2'], $headers['enum_header_string_array']); - } - - public function testInlineAdditionalProperties() - { - $param = new \stdClass(); - $param->foo = 'bar'; - $this->fakeApi->testInlineAdditionalProperties($param); - - $request = $this->fakeHttpClient->getLastRequest(); - $this->assertSame('{"foo":"bar"}', $request->getBody()->getContents()); - } - -// missing example for collection path param in config -// public function testPathParamCollection() -// { -// $this->userApi->getUserByNameWithHttpInfo(['aa', 'bb']); -// $request = $this->fakeHttpClient->getLastRequest(); -// $this->assertEquals('user/aa,bb', urldecode($request->getUri()->getPath())); -// } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php deleted file mode 100644 index 2a5bb49caa7..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php +++ /dev/null @@ -1,390 +0,0 @@ -setId($newPetId); - $newPet->setName("PHP Unit Test"); - $newPet->setPhotoUrls(["http://test_php_unit_test.com"]); - // new tag - $tag = new Model\Tag; - $tag->setId($newPetId); // use the same id as pet - $tag->setName("test php tag"); - // new category - $category = new Model\Category; - $category->setId($newPetId); // use the same id as pet - $category->setName("test php category"); - - $newPet->setTags(array($tag)); - $newPet->setCategory($category); - - $config = new Configuration(); - $petApi = new Api\PetApi(null, $config); - - // add a new pet (model) - list(, $status) = $petApi->addPetWithHttpInfo($newPet); - Assert::assertEquals(200, $status); - } - - public function setUp(): void - { - $this->api = new Api\PetApi(); - } - - public function testGetPetById() - { - $petId = 10005; - - $pet = $this->api->getPetById($petId); - $this->assertSame($pet->getId(), $petId); - $this->assertSame($pet->getName(), 'PHP Unit Test'); - $this->assertSame($pet->getPhotoUrls()[0], 'http://test_php_unit_test.com'); - $this->assertSame($pet->getCategory()->getId(), $petId); - $this->assertSame($pet->getCategory()->getName(), 'test php category'); - $this->assertSame($pet->getTags()[0]->getId(), $petId); - $this->assertSame($pet->getTags()[0]->getName(), 'test php tag'); - } - - /** - * comment out as we've removed invalid endpoints from the spec, we'll introduce something - * similar in the future when we've time to update the petstore server - * - * // test getPetById with a Pet object (id 10005) - * public function testGetPetByIdInObject() - * { - * // initialize the API client without host - * $pet_id = 10005; // ID of pet that needs to be fetched - * $pet_api = new Api\PetApi(); - * $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555'); - * // return Pet (inline model) - * $response = $pet_api->getPetByIdInObject($pet_id); - * $this->assertInstanceOf('OpenAPI\Client\Model\InlineResponse200', $response); - * $this->assertSame($response->getId(), $pet_id); - * $this->assertSame($response->getName(), 'PHP Unit Test'); - * $this->assertSame($response->getPhotoUrls()[0], 'http://test_php_unit_test.com'); - * - * // category is type "object" - * $this->assertInternalType('array', $response->getCategory()); - * $this->assertSame($response->getCategory()['id'], $pet_id); - * $this->assertSame($response->getCategory()['name'], 'test php category'); - * - * $this->assertSame($response->getTags()[0]->getId(), $pet_id); - * $this->assertSame($response->getTags()[0]->getName(), 'test php tag'); - * } - */ - - // test getPetByIdWithHttpInfo with a Pet object (id 10005) - public function testGetPetByIdWithHttpInfo() - { - // initialize the API client without host - $petId = 10005; // ID of pet that needs to be fetched - - /** @var $pet Pet */ - list($pet, $status_code, $response_headers) = $this->api->getPetByIdWithHttpInfo($petId); - $this->assertSame($pet->getId(), $petId); - $this->assertSame($pet->getName(), 'PHP Unit Test'); - $this->assertSame($pet->getCategory()->getId(), $petId); - $this->assertSame($pet->getCategory()->getName(), 'test php category'); - $this->assertSame($pet->getTags()[0]->getId(), $petId); - $this->assertSame($pet->getTags()[0]->getName(), 'test php tag'); - $this->assertSame($status_code, 200); - $this->assertSame($response_headers['Content-Type'], ['application/json']); - } - - public function testFindPetByStatus() - { - $response = $this->api->findPetsByStatus('available'); - $this->assertGreaterThan(0, count($response)); // at least one object returned - - $this->assertSame(get_class($response[0]), Pet::class); // verify the object is Pet - foreach ($response as $pet) { - $this->assertSame($pet['status'], 'available'); - } - - $response = $this->api->findPetsByStatus('unknown_and_incorrect_status'); - $this->assertCount(0, $response); - } - - public function testUpdatePet() - { - $petId = 10001; - $updatedPet = new Model\Pet; - $updatedPet->setId($petId); - $updatedPet->setName('updatePet'); - $updatedPet->setStatus('pending'); - $result = $this->api->updatePet($updatedPet); - $this->assertNull($result); - - // verify updated Pet - $result = $this->api->getPetById($petId); - $this->assertSame($result->getId(), $petId); - $this->assertSame($result->getStatus(), 'pending'); - $this->assertSame($result->getName(), 'updatePet'); - } - - // test updatePetWithFormWithHttpInfo and verify by the "name" of the response - public function testUpdatePetWithFormWithHttpInfo() - { - $petId = 10001; // ID of pet that needs to be fetched - - // update Pet (form) - list($update_response, $status_code, $http_headers) = $this->api->updatePetWithFormWithHttpInfo( - $petId, - 'update pet with form with http info' - ); - // return nothing (void) - $this->assertNull($update_response); - $this->assertSame($status_code, 200); - $this->assertSame($http_headers['Content-Type'], ['application/json']); - $response = $this->api->getPetById($petId); - $this->assertSame($response->getId(), $petId); - $this->assertSame($response->getName(), 'update pet with form with http info'); - } - - // test updatePetWithForm and verify by the "name" and "status" of the response - public function testUpdatePetWithForm() - { - $pet_id = 10001; // ID of pet that needs to be fetched - $result = $this->api->updatePetWithForm($pet_id, 'update pet with form', 'sold'); - // return nothing (void) - $this->assertNull($result); - - $response = $this->api->getPetById($pet_id); - $this->assertSame($response->getId(), $pet_id); - $this->assertSame($response->getName(), 'update pet with form'); - $this->assertSame($response->getStatus(), 'sold'); - } - - // test addPet and verify by the "id" and "name" of the response - public function testAddPet() - { - $new_pet_id = 10005; - $newPet = new Model\Pet; - $newPet->setId($new_pet_id); - $newPet->setName("PHP Unit Test 2"); - - // add a new pet (model) - $add_response = $this->api->addPet($newPet); - // return nothing (void) - $this->assertNull($add_response); - - // verify added Pet - $response = $this->api->getPetById($new_pet_id); - $this->assertSame($response->getId(), $new_pet_id); - $this->assertSame($response->getName(), 'PHP Unit Test 2'); - } - - /* - * comment out as we've removed invalid endpoints from the spec, we'll introduce something - * similar in the future when we've time to update the petstore server - * - // test addPetUsingByteArray and verify by the "id" and "name" of the response - public function testAddPetUsingByteArray() - { - // initialize the API client - $config = (new Configuration())->setHost('http://petstore.swagger.io/v2'); - $api_client = new ApiClient($config); - - $new_pet_id = 10005; - $new_pet = new Model\Pet; - $new_pet->setId($new_pet_id); - $new_pet->setName("PHP Unit Test 3"); - // new tag - $tag= new Model\Tag; - $tag->setId($new_pet_id); // use the same id as pet - $tag->setName("test php tag"); - // new category - $category = new Model\Category; - $category->setId($new_pet_id); // use the same id as pet - $category->setName("test php category"); - - $new_pet->setTags(array($tag)); - $new_pet->setCategory($category); - - $pet_api = new Api\PetApi($api_client); - // add a new pet (model) - $object_serializer = new ObjectSerializer(); - $pet_json_string = json_encode($object_serializer->sanitizeForSerialization($new_pet)); - $add_response = $pet_api->addPetUsingByteArray($pet_json_string); - // return nothing (void) - $this->assertSame($add_response, NULL); - // verify added Pet - $response = $pet_api->getPetById($new_pet_id); - $this->assertSame($response->getId(), $new_pet_id); - $this->assertSame($response->getName(), 'PHP Unit Test 3'); - } - */ - - // test upload file - public function testUploadFile() - { - // upload file - $pet_id = 10001; - $response = $this->api->uploadFile($pet_id, 'test meta', __DIR__ . '/../composer.json'); - // return ApiResponse - $this->assertInstanceOf(ApiResponse::class, $response); - } - - /* - * comment out as we've removed invalid endpoints from the spec, we'll introduce something - * similar in the future when we've time to update the petstore server - * - // test byte array response - public function testGetPetByIdWithByteArray() - { - // initialize the API client - $config = new Configuration(); - $config->setHost('http://petstore.swagger.io/v2'); - $api_client = new APIClient($config); - $pet_api = new Api\PetApi($api_client); - // test getPetByIdWithByteArray - $pet_id = 10005; - $bytes = $pet_api->petPetIdtestingByteArraytrueGet($pet_id); - $json = json_decode($bytes, true); - - $this->assertInternalType("string", $bytes); - - $this->assertSame($json['id'], $pet_id); - // not testing name as it's tested by addPetUsingByteArray - //$this->assertSame($json['name'], 'PHP Unit Test'); - $this->assertSame($json['category']['id'], $pet_id); - $this->assertSame($json['category']['name'], 'test php category'); - $this->assertSame($json['tags'][0]['id'], $pet_id); - $this->assertSame($json['tags'][0]['name'], 'test php tag'); - } - */ - - // test empty object serialization - public function testEmptyPetSerialization() - { - $new_pet = new Model\Pet; - // the empty object should be serialised to {} - $this->assertSame("{}", "$new_pet"); - } - - // test inheritance in the model - public function testInheritance() - { - $new_dog = new Model\Dog; - // the object should be an instance of the derived class - $this->assertInstanceOf('OpenAPI\Client\Model\Dog', $new_dog); - // the object should also be an instance of the parent class - $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $new_dog); - } - - // test inheritance constructor is working with data - // initialization - public function testInheritanceConstructorDataInitialization() - { - // initialize the object with data in the constructor - $data = array( - 'class_name' => 'Dog', - 'breed' => 'Great Dane' - ); - $new_dog = new Model\Dog($data); - - // the property on the derived class should be set - $this->assertSame('Great Dane', $new_dog->getBreed()); - // the property on the parent class should be set - $this->assertSame('Dog', $new_dog->getClassName()); - } - - // test if discriminator is initialized automatically - public function testDiscriminatorInitialization() - { - $new_dog = new Model\Dog(); - $this->assertSame('Dog', $new_dog->getClassName()); - } - - // test if ArrayAccess interface works - public function testArrayStuff() - { - // create an array of Animal - $farm = array(); - - // add some animals to the farm to make sure the ArrayAccess - // interface works - $farm[] = new Model\Dog(); - $farm[] = new Model\Cat(); - $farm[] = new Model\Animal(); - - // assert we can look up the animals in the farm by array - // indices (let's try a random order) - $this->assertInstanceOf('OpenAPI\Client\Model\Cat', $farm[1]); - $this->assertInstanceOf('OpenAPI\Client\Model\Dog', $farm[0]); - $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $farm[2]); - - // let's try to `foreach` the animals in the farm and let's - // try to use the objects we loop through - foreach ($farm as $animal) { - $this->assertContains($animal->getClassName(), array('Dog', 'Cat', 'Animal')); - $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $animal); - } - } - - // test if default values works - public function testDefaultValues() - { - // add some animals to the farm to make sure the ArrayAccess - // interface works - $dog = new Model\Dog(); - $animal = new Model\Animal(); - - // assert we can look up the animals in the farm by array - // indices (let's try a random order) - $this->assertSame('red', $dog->getColor()); - $this->assertSame('red', $animal->getColor()); - } - - /** - * test invalid argument - */ - public function testInvalidArgument() - { - // the argument is required, and we must specify one or some from 'available', 'pending', 'sold' - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Missing the required parameter $status when calling findPetsByStatus'); - $this->api->findPetsByStatus([]); - } - -// Disabled as currently we don't have any endpoint that would return file -// For testing I just replaced url and return type in Api method. -// public function testDownloadingLargeFile() -// { -// $petId = 10005; -// $config = new Configuration(); -// $config->setHost('https://getcomposer.org'); -// $api = new PetApi(new Client(), $config); -// $result = $api->getPetById($petId); -// $this->assertInstanceOf(\SplFileObject::class, $result); -// var_dump([ -// 'peak mem (MiB)' => memory_get_peak_usage(true)/1024/1024, -// 'file size (MiB)' => $result->getSize()/1024/1024, -// 'path' => sys_get_temp_dir() . '/' . $result->getFilename() -// ]); -// } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetTest.php deleted file mode 100644 index c3c4ee8950e..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/PetTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSame("{}", "$new_pet"); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php deleted file mode 100644 index 834e27588a7..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php +++ /dev/null @@ -1,36 +0,0 @@ -fakeClient = new FakeHttpClient(); - $this->api = new Api\FakeApi($this->fakeClient); - } - - public function testFormDataEncodingToJson() - { - $this->api->testJsonFormData('value', 'value2'); - - $request = $this->fakeClient->getLastRequest(); - $contentType = $request->getHeader('Content-Type'); - $this->assertEquals(['application/x-www-form-urlencoded'], $contentType); - - $requestContent = $request->getBody()->getContents(); - - // JSON serialization of form data is not supported - $this->assertEquals('param=value¶m2=value2', $requestContent); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php deleted file mode 100644 index 8d65396ccbc..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php +++ /dev/null @@ -1,92 +0,0 @@ -fakeHttpClient = new FakeHttpClient(); - $this->api = new PetApi($this->fakeHttpClient); - } - - public function testDefined200ReturnType() - { - $this->fakeHttpClient->setResponse(new Response(200, [], json_encode([]))); - $result = $this->api->getPetById(123); - - $this->assertInstanceOf(Pet::class, $result); - } - - public function testDefault2xxReturnType() - { - $this->fakeHttpClient->setResponse(new Response(255, [], json_encode([]))); - $result = $this->api->getPetById(123); - - $this->assertInstanceOf(Pet::class, $result); - } - - public function testDefinedErrorException() - { - $this->expectExceptionCode(400); - $this->expectException(\OpenAPI\Client\ApiException::class); - $statusCode = 400; - - $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); - $this->api->getPetById(123); - } - -// missing case in spec: -// responses: -// '400': -// description: failure -// schema: -// $ref: '#/definitions/Error' -// public function testDefinedErrorResponseObject() -// { -// $result = null; -// try { -// $this->fakeHttpClient->setResponse(new Response(400, [], '{}')); -// $this->api->getPetById(123); -// } catch (ApiException $e) { -// $result = $e->getResponseObject(); -// } -// -// $this->assertInstanceOf(Error::class, $result); -// } - - public function testDefaultErrorException() - { - $this->expectExceptionCode(404); - $this->expectException(\OpenAPI\Client\ApiException::class); - $statusCode = 404; - - $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); - $this->api->getPetById(123); - } - - public function testDefaultErrorResponseObject() - { - $result = null; - try { - $this->fakeHttpClient->setResponse(new Response(404, [], '{}')); - $this->api->getPetById(123); - } catch (ApiException $e) { - $result = $e->getResponseObject(); - } - - $this->assertNull($result); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php deleted file mode 100644 index 4bb85919dc5..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php +++ /dev/null @@ -1,57 +0,0 @@ -api = new StoreApi(); - } - - /** - * Setup before running each test case - */ - public static function setUpBeforeClass(): void - { - // add a new pet (id 10005) to ensure the pet object is available for all the tests - // new pet - $id = 10005; - $pet = new Pet(); - $pet->setId($id); - $pet->setName('PHP Unit Test'); - $pet->setStatus('available'); - // new tag - $tag = new Tag(); - $tag->setId($id); // use the same id as pet - $tag->setName('test php tag'); - // new category - $category = new Category(); - $category->setId($id); // use the same id as pet - $category->setName('test php category'); - - $pet->setTags([$tag]); - $pet->setCategory($category); - - $api = new PetApi(); - $api->addPet($pet); - } - - public function testGetInventory() - { - $result = $this->api->getInventory(); - - $this->assertIsArray($result); - $this->assertIsInt($result['available']); - } -} diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php deleted file mode 100644 index 929789670f9..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php +++ /dev/null @@ -1,37 +0,0 @@ -api = new Api\UserApi(); - } - - // test login use - public function testLoginUser() - { - // initialize the API client - // login - $response = $this->api->loginUser('xxxxx', 'yyyyyyyy'); - - $this->assertIsString($response); - - $pattern = '/logged in user session/'; - $assertMessage = "response string starts with 'logged in user session'"; - $this->assertIsString($response); - if (method_exists($this, 'assertMatchesRegularExpression')) { - $this->assertMatchesRegularExpression($pattern, $response, $assertMessage); - } else { - $this->assertRegExp($pattern, $response, $assertMessage); - } - } -}