From a7e92786df1956cc9407acf0f7d1ad2704130e55 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 6 Apr 2022 10:24:32 +0800 Subject: [PATCH] [PowerShell] add more tests to powershell client (#12057) * add more tests to powershell client * update spec * update method name * add new file --- appveyor.yml | 9 +- bin/configs/powershell.yaml | 2 +- ...odels-for-testing-with-http-signature.yaml | 2185 +++++++++++++++++ .../powershell/.openapi-generator/FILES | 134 + samples/client/petstore/powershell/Build.ps1 | 2 +- .../client/petstore/powershell/CIRunTest.ps1 | 14 + samples/client/petstore/powershell/README.md | 112 +- .../client/petstore/powershell/appveyor.yml | 2 +- .../petstore/powershell/docs/200Response.md | 23 + .../docs/AdditionalPropertiesClass.md | 35 + .../client/petstore/powershell/docs/Animal.md | 23 + .../client/petstore/powershell/docs/Apple.md | 23 + .../petstore/powershell/docs/AppleReq.md | 23 + .../docs/ArrayOfArrayOfNumberOnly.md | 21 + .../powershell/docs/ArrayOfNumberOnly.md | 21 + .../petstore/powershell/docs/ArrayTest.md | 25 + .../client/petstore/powershell/docs/Banana.md | 21 + .../petstore/powershell/docs/BananaReq.md | 23 + .../petstore/powershell/docs/BasquePig.md | 21 + .../powershell/docs/Capitalization.md | 31 + .../client/petstore/powershell/docs/Cat.md | 25 + .../petstore/powershell/docs/CatAllOf.md | 21 + .../petstore/powershell/docs/Category.md | 2 +- .../petstore/powershell/docs/ClassModel.md | 21 + .../client/petstore/powershell/docs/Client.md | 21 + .../powershell/docs/ComplexQuadrilateral.md | 23 + .../petstore/powershell/docs/DanishPig.md | 21 + .../powershell/docs/DeprecatedObject.md | 21 + .../client/petstore/powershell/docs/Dog.md | 25 + .../petstore/powershell/docs/DogAllOf.md | 21 + .../petstore/powershell/docs/Drawing.md | 27 + .../petstore/powershell/docs/EnumArrays.md | 23 + .../petstore/powershell/docs/EnumClass.md | 20 + .../petstore/powershell/docs/EnumTest.md | 37 + .../powershell/docs/EquilateralTriangle.md | 23 + .../client/petstore/powershell/docs/File.md | 21 + .../powershell/docs/FileSchemaTestClass.md | 23 + .../client/petstore/powershell/docs/Foo.md | 21 + .../petstore/powershell/docs/FormatTest.md | 51 + .../client/petstore/powershell/docs/Fruit.md | 27 + .../petstore/powershell/docs/FruitReq.md | 27 + .../petstore/powershell/docs/GmFruit.md | 27 + .../powershell/docs/GrandparentAnimal.md | 21 + .../powershell/docs/HasOnlyReadOnly.md | 23 + .../powershell/docs/HealthCheckResult.md | 21 + .../powershell/docs/InlineResponseDefault.md | 21 + .../powershell/docs/IsoscelesTriangle.md | 23 + .../client/petstore/powershell/docs/List.md | 21 + .../client/petstore/powershell/docs/Mammal.md | 27 + .../petstore/powershell/docs/MapTest.md | 27 + ...dPropertiesAndAdditionalPropertiesClass.md | 25 + .../client/petstore/powershell/docs/Name.md | 27 + .../petstore/powershell/docs/NullableClass.md | 43 + .../petstore/powershell/docs/NullableShape.md | 25 + .../petstore/powershell/docs/NumberOnly.md | 21 + .../docs/ObjectWithDeprecatedFields.md | 27 + .../client/petstore/powershell/docs/Order.md | 2 +- .../powershell/docs/OuterComposite.md | 25 + .../petstore/powershell/docs/OuterEnum.md | 20 + .../powershell/docs/OuterEnumDefaultValue.md | 20 + .../powershell/docs/OuterEnumInteger.md | 20 + .../docs/OuterEnumIntegerDefaultValue.md | 20 + .../powershell/docs/PSAnotherFakeApi.md | 52 + .../petstore/powershell/docs/PSDefaultApi.md | 44 + .../petstore/powershell/docs/PSFakeApi.md | 751 ++++++ .../docs/PSFakeClassnameTags123Api.md | 59 + .../petstore/powershell/docs/PSPetApi.md | 123 +- .../petstore/powershell/docs/PSStoreApi.md | 4 +- .../petstore/powershell/docs/PSUserApi.md | 62 +- .../petstore/powershell/docs/ParentPet.md | 21 + .../powershell/docs/PetWithRequiredTags.md | 31 + .../client/petstore/powershell/docs/Pig.md | 21 + .../petstore/powershell/docs/Quadrilateral.md | 23 + .../powershell/docs/QuadrilateralInterface.md | 21 + .../petstore/powershell/docs/ReadOnlyFirst.md | 23 + .../client/petstore/powershell/docs/Return.md | 21 + .../powershell/docs/ScaleneTriangle.md | 23 + .../client/petstore/powershell/docs/Shape.md | 25 + .../powershell/docs/ShapeInterface.md | 21 + .../petstore/powershell/docs/ShapeOrNull.md | 25 + .../powershell/docs/SimpleQuadrilateral.md | 23 + .../powershell/docs/SpecialModelName.md | 23 + .../petstore/powershell/docs/Triangle.md | 23 + .../powershell/docs/TriangleInterface.md | 21 + .../client/petstore/powershell/docs/User.md | 10 +- .../client/petstore/powershell/docs/Whale.md | 25 + .../client/petstore/powershell/docs/Zebra.md | 23 + .../src/PSPetstore/Api/PSAnotherFakeApi.ps1 | 85 + .../src/PSPetstore/Api/PSDefaultApi.ps1 | 70 + .../src/PSPetstore/Api/PSFakeApi.ps1 | 1436 +++++++++++ .../Api/PSFakeClassnameTags123Api.ps1 | 90 + .../src/PSPetstore/Api/PSPetApi.ps1 | 142 +- .../src/PSPetstore/Api/PSStoreApi.ps1 | 10 +- .../src/PSPetstore/Api/PSUserApi.ps1 | 32 +- .../src/PSPetstore/Client/PSConfiguration.ps1 | 6 +- .../Model/AdditionalPropertiesClass.ps1 | 188 ++ .../src/PSPetstore/Model/Animal.ps1 | 118 + .../src/PSPetstore/Model/ApiResponse.ps1 | 4 +- .../powershell/src/PSPetstore/Model/Apple.ps1 | 112 + .../src/PSPetstore/Model/AppleReq.ps1 | 118 + .../Model/ArrayOfArrayOfNumberOnly.ps1 | 97 + .../PSPetstore/Model/ArrayOfNumberOnly.ps1 | 97 + .../src/PSPetstore/Model/ArrayTest.ps1 | 123 + .../src/PSPetstore/Model/Banana.ps1 | 97 + .../src/PSPetstore/Model/BananaReq.ps1 | 118 + .../src/PSPetstore/Model/BasquePig.ps1 | 105 + .../src/PSPetstore/Model/Capitalization.ps1 | 162 ++ .../powershell/src/PSPetstore/Model/Cat.ps1 | 131 + .../src/PSPetstore/Model/CatAllOf.ps1 | 97 + .../src/PSPetstore/Model/Category.ps1 | 27 +- .../src/PSPetstore/Model/ClassModel.ps1 | 97 + .../src/PSPetstore/Model/Client.ps1 | 97 + .../PSPetstore/Model/ComplexQuadrilateral.ps1 | 122 + .../src/PSPetstore/Model/DanishPig.ps1 | 105 + .../src/PSPetstore/Model/DeprecatedObject.ps1 | 97 + .../powershell/src/PSPetstore/Model/Dog.ps1 | 131 + .../src/PSPetstore/Model/DogAllOf.ps1 | 97 + .../src/PSPetstore/Model/Drawing.ps1 | 136 + .../src/PSPetstore/Model/EnumArrays.ps1 | 112 + .../src/PSPetstore/Model/EnumTest.ps1 | 214 ++ .../PSPetstore/Model/EquilateralTriangle.ps1 | 122 + .../powershell/src/PSPetstore/Model/File.ps1 | 97 + .../PSPetstore/Model/FileSchemaTestClass.ps1 | 110 + .../powershell/src/PSPetstore/Model/Foo.ps1 | 97 + .../src/PSPetstore/Model/FormatTest.ps1 | 363 +++ .../powershell/src/PSPetstore/Model/Fruit.ps1 | 82 + .../src/PSPetstore/Model/FruitReq.ps1 | 91 + .../src/PSPetstore/Model/GmFruit.ps1 | 84 + .../PSPetstore/Model/GrandparentAnimal.ps1 | 105 + .../src/PSPetstore/Model/HasOnlyReadOnly.ps1 | 110 + .../PSPetstore/Model/HealthCheckResult.ps1 | 97 + .../Model/InlineResponseDefault.ps1 | 97 + .../PSPetstore/Model/IsoscelesTriangle.ps1 | 122 + .../powershell/src/PSPetstore/Model/List.ps1 | 97 + .../src/PSPetstore/Model/Mammal.ps1 | 98 + .../src/PSPetstore/Model/MapTest.ps1 | 137 ++ ...PropertiesAndAdditionalPropertiesClass.ps1 | 123 + .../src/PSPetstore/Model/Model200Response.ps1 | 110 + .../src/PSPetstore/Model/ModelReturn.ps1 | 97 + .../powershell/src/PSPetstore/Model/Name.ps1 | 144 ++ .../src/PSPetstore/Model/NullableClass.ps1 | 240 ++ .../src/PSPetstore/Model/NullableShape.ps1 | 91 + .../src/PSPetstore/Model/NumberOnly.ps1 | 97 + .../Model/ObjectWithDeprecatedFields.ps1 | 136 + .../powershell/src/PSPetstore/Model/Order.ps1 | 4 +- .../src/PSPetstore/Model/OuterComposite.ps1 | 123 + .../src/PSPetstore/Model/ParentPet.ps1 | 105 + .../powershell/src/PSPetstore/Model/Pet.ps1 | 4 +- .../PSPetstore/Model/PetWithRequiredTags.ps1 | 179 ++ .../powershell/src/PSPetstore/Model/Pig.ps1 | 82 + .../src/PSPetstore/Model/Quadrilateral.ps1 | 82 + .../Model/QuadrilateralInterface.ps1 | 105 + .../src/PSPetstore/Model/ReadOnlyFirst.ps1 | 110 + .../src/PSPetstore/Model/ScaleneTriangle.ps1 | 122 + .../powershell/src/PSPetstore/Model/Shape.ps1 | 82 + .../src/PSPetstore/Model/ShapeInterface.ps1 | 105 + .../src/PSPetstore/Model/ShapeOrNull.ps1 | 91 + .../PSPetstore/Model/SimpleQuadrilateral.ps1 | 122 + .../src/PSPetstore/Model/SpecialModelName.ps1 | 110 + .../powershell/src/PSPetstore/Model/Tag.ps1 | 9 +- .../src/PSPetstore/Model/Triangle.ps1 | 98 + .../PSPetstore/Model/TriangleInterface.ps1 | 105 + .../powershell/src/PSPetstore/Model/User.ps1 | 61 +- .../powershell/src/PSPetstore/Model/Whale.ps1 | 131 + .../powershell/src/PSPetstore/Model/Zebra.ps1 | 122 + .../powershell/src/PSPetstore/PSPetstore.psd1 | 116 +- .../powershell/src/PSPetstore/PSPetstore.psm1 | 2 +- .../Private/Get-CommonParameters.ps1 | 2 +- .../PSPetstore/Private/Out-DebugParameter.ps1 | 2 +- .../src/PSPetstore/Private/PSApiClient.ps1 | 19 +- .../Private/PSHttpSignatureAuth.ps1 | 2 +- .../Private/PSRSAEncryptionProvider.cs | 2 +- .../en-US/about_PSPetstore.help.txt | 2 +- .../tests/Api/PSAnotherFakeApi.Tests.ps1 | 17 + .../tests/Api/PSDefaultApi.Tests.ps1 | 17 + .../powershell/tests/Api/PSFakeApi.Tests.ps1 | 129 + .../Api/PSFakeClassnameTags123Api.Tests.ps1 | 17 + .../Model/AdditionalPropertiesClass.Tests.ps1 | 17 + .../powershell/tests/Model/Animal.Tests.ps1 | 17 + .../powershell/tests/Model/Apple.Tests.ps1 | 17 + .../powershell/tests/Model/AppleReq.Tests.ps1 | 17 + .../Model/ArrayOfArrayOfNumberOnly.Tests.ps1 | 17 + .../tests/Model/ArrayOfNumberOnly.Tests.ps1 | 17 + .../tests/Model/ArrayTest.Tests.ps1 | 17 + .../powershell/tests/Model/Banana.Tests.ps1 | 17 + .../tests/Model/BananaReq.Tests.ps1 | 17 + .../tests/Model/BasquePig.Tests.ps1 | 17 + .../tests/Model/Capitalization.Tests.ps1 | 17 + .../powershell/tests/Model/Cat.Tests.ps1 | 17 + .../powershell/tests/Model/CatAllOf.Tests.ps1 | 17 + .../tests/Model/ClassModel.Tests.ps1 | 17 + .../powershell/tests/Model/Client.Tests.ps1 | 17 + .../Model/ComplexQuadrilateral.Tests.ps1 | 17 + .../tests/Model/DanishPig.Tests.ps1 | 17 + .../tests/Model/DeprecatedObject.Tests.ps1 | 17 + .../powershell/tests/Model/Dog.Tests.ps1 | 17 + .../powershell/tests/Model/DogAllOf.Tests.ps1 | 17 + .../powershell/tests/Model/Drawing.Tests.ps1 | 17 + .../tests/Model/EnumArrays.Tests.ps1 | 17 + .../tests/Model/EnumClass.Tests.ps1 | 17 + .../powershell/tests/Model/EnumTest.Tests.ps1 | 17 + .../tests/Model/EquilateralTriangle.Tests.ps1 | 17 + .../powershell/tests/Model/File.Tests.ps1 | 17 + .../tests/Model/FileSchemaTestClass.Tests.ps1 | 17 + .../powershell/tests/Model/Foo.Tests.ps1 | 17 + .../tests/Model/FormatTest.Tests.ps1 | 17 + .../powershell/tests/Model/Fruit.Tests.ps1 | 17 + .../powershell/tests/Model/FruitReq.Tests.ps1 | 17 + .../powershell/tests/Model/GmFruit.Tests.ps1 | 17 + .../tests/Model/GrandparentAnimal.Tests.ps1 | 17 + .../tests/Model/HasOnlyReadOnly.Tests.ps1 | 17 + .../tests/Model/HealthCheckResult.Tests.ps1 | 17 + .../Model/InlineResponseDefault.Tests.ps1 | 17 + .../tests/Model/IsoscelesTriangle.Tests.ps1 | 17 + .../powershell/tests/Model/List.Tests.ps1 | 17 + .../powershell/tests/Model/Mammal.Tests.ps1 | 17 + .../powershell/tests/Model/MapTest.Tests.ps1 | 17 + ...tiesAndAdditionalPropertiesClass.Tests.ps1 | 17 + .../tests/Model/Model200Response.Tests.ps1 | 17 + .../tests/Model/ModelReturn.Tests.ps1 | 17 + .../powershell/tests/Model/Name.Tests.ps1 | 17 + .../tests/Model/NullableClass.Tests.ps1 | 17 + .../tests/Model/NullableShape.Tests.ps1 | 17 + .../tests/Model/NumberOnly.Tests.ps1 | 17 + .../ObjectWithDeprecatedFields.Tests.ps1 | 17 + .../tests/Model/OuterComposite.Tests.ps1 | 17 + .../tests/Model/OuterEnum.Tests.ps1 | 17 + .../Model/OuterEnumDefaultValue.Tests.ps1 | 17 + .../tests/Model/OuterEnumInteger.Tests.ps1 | 17 + .../OuterEnumIntegerDefaultValue.Tests.ps1 | 17 + .../tests/Model/ParentPet.Tests.ps1 | 17 + .../tests/Model/PetWithRequiredTags.Tests.ps1 | 17 + .../powershell/tests/Model/Pig.Tests.ps1 | 17 + .../tests/Model/Quadrilateral.Tests.ps1 | 17 + .../Model/QuadrilateralInterface.Tests.ps1 | 17 + .../tests/Model/ReadOnlyFirst.Tests.ps1 | 17 + .../tests/Model/ScaleneTriangle.Tests.ps1 | 17 + .../powershell/tests/Model/Shape.Tests.ps1 | 17 + .../tests/Model/ShapeInterface.Tests.ps1 | 17 + .../tests/Model/ShapeOrNull.Tests.ps1 | 17 + .../tests/Model/SimpleQuadrilateral.Tests.ps1 | 17 + .../tests/Model/SpecialModelName.Tests.ps1 | 17 + .../powershell/tests/Model/Triangle.Tests.ps1 | 17 + .../tests/Model/TriangleInterface.Tests.ps1 | 17 + .../powershell/tests/Model/Whale.Tests.ps1 | 17 + .../powershell/tests/Model/Zebra.Tests.ps1 | 17 + 246 files changed, 16102 insertions(+), 205 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml create mode 100644 samples/client/petstore/powershell/CIRunTest.ps1 create mode 100644 samples/client/petstore/powershell/docs/200Response.md create mode 100644 samples/client/petstore/powershell/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/powershell/docs/Animal.md create mode 100644 samples/client/petstore/powershell/docs/Apple.md create mode 100644 samples/client/petstore/powershell/docs/AppleReq.md create mode 100644 samples/client/petstore/powershell/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/powershell/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/powershell/docs/ArrayTest.md create mode 100644 samples/client/petstore/powershell/docs/Banana.md create mode 100644 samples/client/petstore/powershell/docs/BananaReq.md create mode 100644 samples/client/petstore/powershell/docs/BasquePig.md create mode 100644 samples/client/petstore/powershell/docs/Capitalization.md create mode 100644 samples/client/petstore/powershell/docs/Cat.md create mode 100644 samples/client/petstore/powershell/docs/CatAllOf.md create mode 100644 samples/client/petstore/powershell/docs/ClassModel.md create mode 100644 samples/client/petstore/powershell/docs/Client.md create mode 100644 samples/client/petstore/powershell/docs/ComplexQuadrilateral.md create mode 100644 samples/client/petstore/powershell/docs/DanishPig.md create mode 100644 samples/client/petstore/powershell/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/powershell/docs/Dog.md create mode 100644 samples/client/petstore/powershell/docs/DogAllOf.md create mode 100644 samples/client/petstore/powershell/docs/Drawing.md create mode 100644 samples/client/petstore/powershell/docs/EnumArrays.md create mode 100644 samples/client/petstore/powershell/docs/EnumClass.md create mode 100644 samples/client/petstore/powershell/docs/EnumTest.md create mode 100644 samples/client/petstore/powershell/docs/EquilateralTriangle.md create mode 100644 samples/client/petstore/powershell/docs/File.md create mode 100644 samples/client/petstore/powershell/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/powershell/docs/Foo.md create mode 100644 samples/client/petstore/powershell/docs/FormatTest.md create mode 100644 samples/client/petstore/powershell/docs/Fruit.md create mode 100644 samples/client/petstore/powershell/docs/FruitReq.md create mode 100644 samples/client/petstore/powershell/docs/GmFruit.md create mode 100644 samples/client/petstore/powershell/docs/GrandparentAnimal.md create mode 100644 samples/client/petstore/powershell/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/powershell/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/powershell/docs/InlineResponseDefault.md create mode 100644 samples/client/petstore/powershell/docs/IsoscelesTriangle.md create mode 100644 samples/client/petstore/powershell/docs/List.md create mode 100644 samples/client/petstore/powershell/docs/Mammal.md create mode 100644 samples/client/petstore/powershell/docs/MapTest.md create mode 100644 samples/client/petstore/powershell/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/powershell/docs/Name.md create mode 100644 samples/client/petstore/powershell/docs/NullableClass.md create mode 100644 samples/client/petstore/powershell/docs/NullableShape.md create mode 100644 samples/client/petstore/powershell/docs/NumberOnly.md create mode 100644 samples/client/petstore/powershell/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/powershell/docs/OuterComposite.md create mode 100644 samples/client/petstore/powershell/docs/OuterEnum.md create mode 100644 samples/client/petstore/powershell/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/powershell/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/powershell/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/powershell/docs/PSAnotherFakeApi.md create mode 100644 samples/client/petstore/powershell/docs/PSDefaultApi.md create mode 100644 samples/client/petstore/powershell/docs/PSFakeApi.md create mode 100644 samples/client/petstore/powershell/docs/PSFakeClassnameTags123Api.md create mode 100644 samples/client/petstore/powershell/docs/ParentPet.md create mode 100644 samples/client/petstore/powershell/docs/PetWithRequiredTags.md create mode 100644 samples/client/petstore/powershell/docs/Pig.md create mode 100644 samples/client/petstore/powershell/docs/Quadrilateral.md create mode 100644 samples/client/petstore/powershell/docs/QuadrilateralInterface.md create mode 100644 samples/client/petstore/powershell/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/powershell/docs/Return.md create mode 100644 samples/client/petstore/powershell/docs/ScaleneTriangle.md create mode 100644 samples/client/petstore/powershell/docs/Shape.md create mode 100644 samples/client/petstore/powershell/docs/ShapeInterface.md create mode 100644 samples/client/petstore/powershell/docs/ShapeOrNull.md create mode 100644 samples/client/petstore/powershell/docs/SimpleQuadrilateral.md create mode 100644 samples/client/petstore/powershell/docs/SpecialModelName.md create mode 100644 samples/client/petstore/powershell/docs/Triangle.md create mode 100644 samples/client/petstore/powershell/docs/TriangleInterface.md create mode 100644 samples/client/petstore/powershell/docs/Whale.md create mode 100644 samples/client/petstore/powershell/docs/Zebra.md create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Api/PSAnotherFakeApi.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Api/PSDefaultApi.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/AdditionalPropertiesClass.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Animal.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Apple.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/AppleReq.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfArrayOfNumberOnly.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfNumberOnly.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ArrayTest.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Banana.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/BananaReq.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/BasquePig.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Capitalization.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Cat.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/CatAllOf.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ClassModel.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Client.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ComplexQuadrilateral.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/DanishPig.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/DeprecatedObject.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Dog.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/DogAllOf.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Drawing.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/EnumArrays.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/EnumTest.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/EquilateralTriangle.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/File.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/FileSchemaTestClass.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Foo.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/FormatTest.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Fruit.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/FruitReq.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/GmFruit.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/GrandparentAnimal.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/HasOnlyReadOnly.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/HealthCheckResult.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/InlineResponseDefault.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/IsoscelesTriangle.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/List.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Mammal.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/MapTest.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/MixedPropertiesAndAdditionalPropertiesClass.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Model200Response.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ModelReturn.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Name.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/NullableClass.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/NullableShape.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/NumberOnly.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ObjectWithDeprecatedFields.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/OuterComposite.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ParentPet.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/PetWithRequiredTags.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Pig.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Quadrilateral.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/QuadrilateralInterface.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ReadOnlyFirst.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ScaleneTriangle.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Shape.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ShapeInterface.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/ShapeOrNull.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/SimpleQuadrilateral.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/SpecialModelName.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Triangle.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/TriangleInterface.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Whale.ps1 create mode 100644 samples/client/petstore/powershell/src/PSPetstore/Model/Zebra.ps1 create mode 100644 samples/client/petstore/powershell/tests/Api/PSAnotherFakeApi.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Api/PSDefaultApi.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Api/PSFakeApi.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Api/PSFakeClassnameTags123Api.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/AdditionalPropertiesClass.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Animal.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Apple.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/AppleReq.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ArrayOfArrayOfNumberOnly.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ArrayOfNumberOnly.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ArrayTest.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Banana.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/BananaReq.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/BasquePig.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Capitalization.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Cat.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/CatAllOf.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ClassModel.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Client.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ComplexQuadrilateral.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/DanishPig.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/DeprecatedObject.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Dog.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/DogAllOf.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Drawing.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/EnumArrays.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/EnumClass.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/EnumTest.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/EquilateralTriangle.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/File.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/FileSchemaTestClass.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Foo.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/FormatTest.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Fruit.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/FruitReq.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/GmFruit.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/GrandparentAnimal.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/HasOnlyReadOnly.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/HealthCheckResult.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/InlineResponseDefault.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/IsoscelesTriangle.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/List.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Mammal.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/MapTest.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/MixedPropertiesAndAdditionalPropertiesClass.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Model200Response.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ModelReturn.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Name.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/NullableClass.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/NullableShape.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/NumberOnly.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ObjectWithDeprecatedFields.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/OuterComposite.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/OuterEnum.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/OuterEnumDefaultValue.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/OuterEnumInteger.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/OuterEnumIntegerDefaultValue.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ParentPet.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/PetWithRequiredTags.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Pig.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Quadrilateral.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/QuadrilateralInterface.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ReadOnlyFirst.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ScaleneTriangle.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Shape.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ShapeInterface.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/ShapeOrNull.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/SimpleQuadrilateral.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/SpecialModelName.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Triangle.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/TriangleInterface.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Whale.Tests.ps1 create mode 100644 samples/client/petstore/powershell/tests/Model/Zebra.Tests.ps1 diff --git a/appveyor.yml b/appveyor.yml index 85b45d481329..6c136913908b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -101,15 +101,8 @@ test_script: # test ps petstore - ps: | - $ErrorActionPreference = "Stop" cd samples\client\petstore\powershell\ - .\Build.ps1 - Import-Module -Name '.\src\PSPetstore' - $Result = Invoke-Pester -PassThru - if ($Result.FailedCount -gt 0) { - $host.SetShouldExit($Result.FailedCount) - exit $Result.FailedCount - } + .\CIRunTest.ps1 cache: - C:\maven\ - C:\gradle\ diff --git a/bin/configs/powershell.yaml b/bin/configs/powershell.yaml index c31d09aa13c3..9a408c2ad176 100644 --- a/bin/configs/powershell.yaml +++ b/bin/configs/powershell.yaml @@ -1,6 +1,6 @@ generatorName: powershell outputDir: samples/client/petstore/powershell -inputSpec: modules/openapi-generator/src/test/resources/3_0/powershell/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/powershell additionalProperties: packageGuid: a27b908d-2a20-467f-bc32-af6f3a654ac5 diff --git a/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml new file mode 100644 index 000000000000..00094aa46de9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -0,0 +1,2185 @@ +openapi: 3.0.0 +info: + 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: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + x-powershell-method-name: Remove-Pet + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/array-of-enums: + get: + tags: + - fake + summary: Array of Enums + operationId: getArrayOfEnums + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - username: foo + - username: bar + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + anyTypeProp: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + See https://github.com/OAI/OpenAPI-Specification/issues/1389 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + anyTypePropNullable: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + The 'nullable' attribute does not change the allowed values. + nullable: true + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + #EnumClass: + # type: string + # default: '-efg' + # enum: + # - _abc + # - '-efg' + # - (xyz) + #Enum_Test: + # type: object + # required: + # - enum_string_required + # properties: + # enum_string: + # type: string + # enum: + # - UPPER + # - lower + # - '' + # enum_string_required: + # type: string + # enum: + # - UPPER + # - lower + # - '' + # enum_integer: + # type: integer + # format: int32 + # enum: + # - 1 + # - -1 + # enum_integer_only: + # type: integer + # enum: + # - 2 + # - -2 + # enum_number: + # type: number + # format: double + # enum: + # - 1.1 + # - -1.2 + # outerEnum: + # $ref: '#/components/schemas/OuterEnum' + # outerEnumInteger: + # $ref: '#/components/schemas/OuterEnumInteger' + # outerEnumDefaultValue: + # $ref: '#/components/schemas/OuterEnumDefaultValue' + # outerEnumIntegerDefaultValue: + # $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + #OuterEnum: + # nullable: true + # type: string + # enum: + # - placed + # - approved + # - delivered + #OuterEnumInteger: + # type: integer + # enum: + # - 0 + # - 1 + # - 2 + #OuterEnumDefaultValue: + # type: string + # enum: + # - placed + # - approved + # - delivered + # default: placed + #OuterEnumIntegerDefaultValue: + # type: integer + # enum: + # - 0 + # - 1 + # - 2 + # default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + '_special_model.name_': + type: string + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + additionalProperties: false + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + required: + - className + DanishPig: + type: object + properties: + className: + type: string + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + NullableShape: + description: The value may be a shape or the 'null' value. + The 'nullable' attribute was introduced in OAS schema >= 3.0 + and has been deprecated in OAS schema >= 3.1. + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + additionalProperties: false + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + #ChildCat: + # allOf: + # - $ref: '#/components/schemas/ParentPet' + # - type: object + # properties: + # name: + # type: string + # pet_type: + # x-enum-as-string: true + # type: string + # enum: + # - ChildCat + # default: ChildCat + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/OuterEnum' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + PetWithRequiredTags: + type: object + required: + - name + - photoUrls + - tags + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet diff --git a/samples/client/petstore/powershell/.openapi-generator/FILES b/samples/client/petstore/powershell/.openapi-generator/FILES index 5f8aa4fd57d6..f2de7bc76301 100644 --- a/samples/client/petstore/powershell/.openapi-generator/FILES +++ b/samples/client/petstore/powershell/.openapi-generator/FILES @@ -1,25 +1,159 @@ Build.ps1 README.md appveyor.yml +docs/200Response.md +docs/AdditionalPropertiesClass.md +docs/Animal.md docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DeprecatedObject.md +docs/Dog.md +docs/DogAllOf.md +docs/Drawing.md +docs/EnumArrays.md +docs/EquilateralTriangle.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineResponseDefault.md +docs/IsoscelesTriangle.md +docs/List.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Name.md +docs/NullableClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md docs/Order.md +docs/OuterComposite.md +docs/PSAnotherFakeApi.md +docs/PSDefaultApi.md +docs/PSFakeApi.md +docs/PSFakeClassnameTags123Api.md docs/PSPetApi.md docs/PSStoreApi.md docs/PSUserApi.md +docs/ParentPet.md docs/Pet.md +docs/PetWithRequiredTags.md +docs/Pig.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md docs/Tag.md +docs/Triangle.md +docs/TriangleInterface.md docs/User.md +docs/Whale.md +docs/Zebra.md +src/PSPetstore/Api/PSAnotherFakeApi.ps1 +src/PSPetstore/Api/PSDefaultApi.ps1 +src/PSPetstore/Api/PSFakeApi.ps1 +src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 src/PSPetstore/Api/PSPetApi.ps1 src/PSPetstore/Api/PSStoreApi.ps1 src/PSPetstore/Api/PSUserApi.ps1 src/PSPetstore/Client/PSConfiguration.ps1 +src/PSPetstore/Model/AdditionalPropertiesClass.ps1 +src/PSPetstore/Model/Animal.ps1 src/PSPetstore/Model/ApiResponse.ps1 +src/PSPetstore/Model/Apple.ps1 +src/PSPetstore/Model/AppleReq.ps1 +src/PSPetstore/Model/ArrayOfArrayOfNumberOnly.ps1 +src/PSPetstore/Model/ArrayOfNumberOnly.ps1 +src/PSPetstore/Model/ArrayTest.ps1 +src/PSPetstore/Model/Banana.ps1 +src/PSPetstore/Model/BananaReq.ps1 +src/PSPetstore/Model/BasquePig.ps1 +src/PSPetstore/Model/Capitalization.ps1 +src/PSPetstore/Model/Cat.ps1 +src/PSPetstore/Model/CatAllOf.ps1 src/PSPetstore/Model/Category.ps1 +src/PSPetstore/Model/ClassModel.ps1 +src/PSPetstore/Model/Client.ps1 +src/PSPetstore/Model/ComplexQuadrilateral.ps1 +src/PSPetstore/Model/DanishPig.ps1 +src/PSPetstore/Model/DeprecatedObject.ps1 +src/PSPetstore/Model/Dog.ps1 +src/PSPetstore/Model/DogAllOf.ps1 +src/PSPetstore/Model/Drawing.ps1 +src/PSPetstore/Model/EnumArrays.ps1 +src/PSPetstore/Model/EquilateralTriangle.ps1 +src/PSPetstore/Model/File.ps1 +src/PSPetstore/Model/FileSchemaTestClass.ps1 +src/PSPetstore/Model/Foo.ps1 +src/PSPetstore/Model/FormatTest.ps1 +src/PSPetstore/Model/Fruit.ps1 +src/PSPetstore/Model/FruitReq.ps1 +src/PSPetstore/Model/GmFruit.ps1 +src/PSPetstore/Model/GrandparentAnimal.ps1 +src/PSPetstore/Model/HasOnlyReadOnly.ps1 +src/PSPetstore/Model/HealthCheckResult.ps1 +src/PSPetstore/Model/InlineResponseDefault.ps1 +src/PSPetstore/Model/IsoscelesTriangle.ps1 +src/PSPetstore/Model/List.ps1 +src/PSPetstore/Model/Mammal.ps1 +src/PSPetstore/Model/MapTest.ps1 +src/PSPetstore/Model/MixedPropertiesAndAdditionalPropertiesClass.ps1 +src/PSPetstore/Model/Model200Response.ps1 +src/PSPetstore/Model/ModelReturn.ps1 +src/PSPetstore/Model/Name.ps1 +src/PSPetstore/Model/NullableClass.ps1 +src/PSPetstore/Model/NullableShape.ps1 +src/PSPetstore/Model/NumberOnly.ps1 +src/PSPetstore/Model/ObjectWithDeprecatedFields.ps1 src/PSPetstore/Model/Order.ps1 +src/PSPetstore/Model/OuterComposite.ps1 +src/PSPetstore/Model/ParentPet.ps1 src/PSPetstore/Model/Pet.ps1 +src/PSPetstore/Model/PetWithRequiredTags.ps1 +src/PSPetstore/Model/Pig.ps1 +src/PSPetstore/Model/Quadrilateral.ps1 +src/PSPetstore/Model/QuadrilateralInterface.ps1 +src/PSPetstore/Model/ReadOnlyFirst.ps1 +src/PSPetstore/Model/ScaleneTriangle.ps1 +src/PSPetstore/Model/Shape.ps1 +src/PSPetstore/Model/ShapeInterface.ps1 +src/PSPetstore/Model/ShapeOrNull.ps1 +src/PSPetstore/Model/SimpleQuadrilateral.ps1 +src/PSPetstore/Model/SpecialModelName.ps1 src/PSPetstore/Model/Tag.ps1 +src/PSPetstore/Model/Triangle.ps1 +src/PSPetstore/Model/TriangleInterface.ps1 src/PSPetstore/Model/User.ps1 +src/PSPetstore/Model/Whale.ps1 +src/PSPetstore/Model/Zebra.ps1 src/PSPetstore/PSPetstore.psm1 src/PSPetstore/Private/Get-CommonParameters.ps1 src/PSPetstore/Private/Out-DebugParameter.ps1 diff --git a/samples/client/petstore/powershell/Build.ps1 b/samples/client/petstore/powershell/Build.ps1 index dc4e005472d5..e15418c3aadf 100644 --- a/samples/client/petstore/powershell/Build.ps1 +++ b/samples/client/petstore/powershell/Build.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/client/petstore/powershell/CIRunTest.ps1 b/samples/client/petstore/powershell/CIRunTest.ps1 new file mode 100644 index 000000000000..82aaf5ce46ca --- /dev/null +++ b/samples/client/petstore/powershell/CIRunTest.ps1 @@ -0,0 +1,14 @@ +# assuming the current directory is already set correctly +#cd samples\client\petstore\powershell\ +$ErrorActionPreference = "Stop" + +.\Build.ps1 + +Import-Module -Name '.\src\PSPetstore' + +$Result = Invoke-Pester -PassThru + +if ($Result.FailedCount -gt 0) { + $host.SetShouldExit($Result.FailedCount) + exit $Result.FailedCount +} diff --git a/samples/client/petstore/powershell/README.md b/samples/client/petstore/powershell/README.md index d394a82a0e91..bb6c77f0266b 100644 --- a/samples/client/petstore/powershell/README.md +++ b/samples/client/petstore/powershell/README.md @@ -1,6 +1,6 @@ # PSPetstore - the PowerShell module for the OpenAPI Petstore -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +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 PowerShell module is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -55,6 +55,24 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*PSAnotherFakeApi* | [**Invoke-PS123TestSpecialTags**](docs/PSAnotherFakeApi.md#Invoke-PS123TestSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*PSDefaultApi* | [**Invoke-PSFooGet**](docs/PSDefaultApi.md#Invoke-PSFooGet) | **GET** /foo | +*PSFakeApi* | [**Invoke-PSFakeHealthGet**](docs/PSFakeApi.md#Invoke-PSFakeHealthGet) | **GET** /fake/health | Health check endpoint +*PSFakeApi* | [**Invoke-PSFakeOuterBooleanSerialize**](docs/PSFakeApi.md#Invoke-PSFakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*PSFakeApi* | [**Invoke-PSFakeOuterCompositeSerialize**](docs/PSFakeApi.md#Invoke-PSFakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*PSFakeApi* | [**Invoke-PSFakeOuterNumberSerialize**](docs/PSFakeApi.md#Invoke-PSFakeOuterNumberSerialize) | **POST** /fake/outer/number | +*PSFakeApi* | [**Invoke-PSFakeOuterStringSerialize**](docs/PSFakeApi.md#Invoke-PSFakeOuterStringSerialize) | **POST** /fake/outer/string | +*PSFakeApi* | [**Get-PSArrayOfEnums**](docs/PSFakeApi.md#Get-PSArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +*PSFakeApi* | [**Test-PSBodyWithFileSchema**](docs/PSFakeApi.md#Test-PSBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*PSFakeApi* | [**Test-PSBodyWithQueryParams**](docs/PSFakeApi.md#Test-PSBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*PSFakeApi* | [**Test-PSClientModel**](docs/PSFakeApi.md#Test-PSClientModel) | **PATCH** /fake | To test ""client"" model +*PSFakeApi* | [**Test-PSEndpointParameters**](docs/PSFakeApi.md#Test-PSEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*PSFakeApi* | [**Test-PSEnumParameters**](docs/PSFakeApi.md#Test-PSEnumParameters) | **GET** /fake | To test enum parameters +*PSFakeApi* | [**Test-PSGroupParameters**](docs/PSFakeApi.md#Test-PSGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*PSFakeApi* | [**Test-PSInlineAdditionalProperties**](docs/PSFakeApi.md#Test-PSInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*PSFakeApi* | [**Test-PSJsonFormData**](docs/PSFakeApi.md#Test-PSJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*PSFakeApi* | [**Test-PSQueryParameterCollectionFormat**](docs/PSFakeApi.md#Test-PSQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | +*PSFakeClassnameTags123Api* | [**Test-PSClassname**](docs/PSFakeClassnameTags123Api.md#Test-PSClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PSPetApi* | [**Add-PSPet**](docs/PSPetApi.md#Add-PSPet) | **POST** /pet | Add a new pet to the store *PSPetApi* | [**Remove-Pet**](docs/PSPetApi.md#remove-pet) | **DELETE** /pet/{petId} | Deletes a pet *PSPetApi* | [**Find-PSPetsByStatus**](docs/PSPetApi.md#Find-PSPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -63,9 +81,10 @@ Class | Method | HTTP request | Description *PSPetApi* | [**Update-PSPet**](docs/PSPetApi.md#Update-PSPet) | **PUT** /pet | Update an existing pet *PSPetApi* | [**Update-PSPetWithForm**](docs/PSPetApi.md#Update-PSPetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PSPetApi* | [**Invoke-PSUploadFile**](docs/PSPetApi.md#Invoke-PSUploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PSStoreApi* | [**Remove-PSOrder**](docs/PSStoreApi.md#Remove-PSOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*PSPetApi* | [**Invoke-PSUploadFileWithRequiredFile**](docs/PSPetApi.md#Invoke-PSUploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*PSStoreApi* | [**Remove-PSOrder**](docs/PSStoreApi.md#Remove-PSOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *PSStoreApi* | [**Get-PSInventory**](docs/PSStoreApi.md#Get-PSInventory) | **GET** /store/inventory | Returns pet inventories by status -*PSStoreApi* | [**Get-PSOrderById**](docs/PSStoreApi.md#Get-PSOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*PSStoreApi* | [**Get-PSOrderById**](docs/PSStoreApi.md#Get-PSOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *PSStoreApi* | [**Invoke-PSPlaceOrder**](docs/PSStoreApi.md#Invoke-PSPlaceOrder) | **POST** /store/order | Place an order for a pet *PSUserApi* | [**New-PSUser**](docs/PSUserApi.md#New-PSUser) | **POST** /user | Create user *PSUserApi* | [**New-PSUsersWithArrayInput**](docs/PSUserApi.md#New-PSUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -79,12 +98,75 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [PSPetstore/Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [PSPetstore/Model.Animal](docs/Animal.md) - [PSPetstore/Model.ApiResponse](docs/ApiResponse.md) + - [PSPetstore/Model.Apple](docs/Apple.md) + - [PSPetstore/Model.AppleReq](docs/AppleReq.md) + - [PSPetstore/Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [PSPetstore/Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [PSPetstore/Model.ArrayTest](docs/ArrayTest.md) + - [PSPetstore/Model.Banana](docs/Banana.md) + - [PSPetstore/Model.BananaReq](docs/BananaReq.md) + - [PSPetstore/Model.BasquePig](docs/BasquePig.md) + - [PSPetstore/Model.Capitalization](docs/Capitalization.md) + - [PSPetstore/Model.Cat](docs/Cat.md) + - [PSPetstore/Model.CatAllOf](docs/CatAllOf.md) - [PSPetstore/Model.Category](docs/Category.md) + - [PSPetstore/Model.ClassModel](docs/ClassModel.md) + - [PSPetstore/Model.Client](docs/Client.md) + - [PSPetstore/Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [PSPetstore/Model.DanishPig](docs/DanishPig.md) + - [PSPetstore/Model.DeprecatedObject](docs/DeprecatedObject.md) + - [PSPetstore/Model.Dog](docs/Dog.md) + - [PSPetstore/Model.DogAllOf](docs/DogAllOf.md) + - [PSPetstore/Model.Drawing](docs/Drawing.md) + - [PSPetstore/Model.EnumArrays](docs/EnumArrays.md) + - [PSPetstore/Model.EquilateralTriangle](docs/EquilateralTriangle.md) + - [PSPetstore/Model.File](docs/File.md) + - [PSPetstore/Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [PSPetstore/Model.Foo](docs/Foo.md) + - [PSPetstore/Model.FormatTest](docs/FormatTest.md) + - [PSPetstore/Model.Fruit](docs/Fruit.md) + - [PSPetstore/Model.FruitReq](docs/FruitReq.md) + - [PSPetstore/Model.GmFruit](docs/GmFruit.md) + - [PSPetstore/Model.GrandparentAnimal](docs/GrandparentAnimal.md) + - [PSPetstore/Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [PSPetstore/Model.HealthCheckResult](docs/HealthCheckResult.md) + - [PSPetstore/Model.InlineResponseDefault](docs/InlineResponseDefault.md) + - [PSPetstore/Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [PSPetstore/Model.List](docs/List.md) + - [PSPetstore/Model.Mammal](docs/Mammal.md) + - [PSPetstore/Model.MapTest](docs/MapTest.md) + - [PSPetstore/Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [PSPetstore/Model.Model200Response](docs/Model200Response.md) + - [PSPetstore/Model.ModelReturn](docs/ModelReturn.md) + - [PSPetstore/Model.Name](docs/Name.md) + - [PSPetstore/Model.NullableClass](docs/NullableClass.md) + - [PSPetstore/Model.NullableShape](docs/NullableShape.md) + - [PSPetstore/Model.NumberOnly](docs/NumberOnly.md) + - [PSPetstore/Model.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - [PSPetstore/Model.Order](docs/Order.md) + - [PSPetstore/Model.OuterComposite](docs/OuterComposite.md) + - [PSPetstore/Model.ParentPet](docs/ParentPet.md) - [PSPetstore/Model.Pet](docs/Pet.md) + - [PSPetstore/Model.PetWithRequiredTags](docs/PetWithRequiredTags.md) + - [PSPetstore/Model.Pig](docs/Pig.md) + - [PSPetstore/Model.Quadrilateral](docs/Quadrilateral.md) + - [PSPetstore/Model.QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [PSPetstore/Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [PSPetstore/Model.ScaleneTriangle](docs/ScaleneTriangle.md) + - [PSPetstore/Model.Shape](docs/Shape.md) + - [PSPetstore/Model.ShapeInterface](docs/ShapeInterface.md) + - [PSPetstore/Model.ShapeOrNull](docs/ShapeOrNull.md) + - [PSPetstore/Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [PSPetstore/Model.SpecialModelName](docs/SpecialModelName.md) - [PSPetstore/Model.Tag](docs/Tag.md) + - [PSPetstore/Model.Triangle](docs/Triangle.md) + - [PSPetstore/Model.TriangleInterface](docs/TriangleInterface.md) - [PSPetstore/Model.User](docs/User.md) + - [PSPetstore/Model.Whale](docs/Whale.md) + - [PSPetstore/Model.Zebra](docs/Zebra.md) ## Documentation for Authorization @@ -98,12 +180,30 @@ Class | Method | HTTP request | Description - **Location**: HTTP header -### auth_cookie +### api_key_query - **Type**: API key -- **API key parameter name**: AUTH_KEY -- **Location**: +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### bearer_test + + +- **Type**: HTTP basic authentication + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### http_signature_test + + +- **Type**: HTTP basic authentication ### petstore_auth diff --git a/samples/client/petstore/powershell/appveyor.yml b/samples/client/petstore/powershell/appveyor.yml index 86b98d394b5c..49a524319c08 100644 --- a/samples/client/petstore/powershell/appveyor.yml +++ b/samples/client/petstore/powershell/appveyor.yml @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/client/petstore/powershell/docs/200Response.md b/samples/client/petstore/powershell/docs/200Response.md new file mode 100644 index 000000000000..b76a7e3f4c2a --- /dev/null +++ b/samples/client/petstore/powershell/docs/200Response.md @@ -0,0 +1,23 @@ +# Model200Response +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **Int32** | | [optional] +**Class** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Model200Response = Initialize-PSPetstoreModel200Response -Name null ` + -Class null +``` + +- Convert the resource to JSON +```powershell +$Model200Response | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/AdditionalPropertiesClass.md b/samples/client/petstore/powershell/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..62c7aa1763f1 --- /dev/null +++ b/samples/client/petstore/powershell/docs/AdditionalPropertiesClass.md @@ -0,0 +1,35 @@ +# AdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **System.Collections.Hashtable** | | [optional] +**MapOfMapProperty** | [**System.Collections.Hashtable**](Map.md) | | [optional] +**Anytype1** | [**AnyType**](.md) | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | [**SystemCollectionsHashtable**](.md) | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | [**SystemCollectionsHashtable**](.md) | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | [**System.Collections.Hashtable**](SystemCollectionsHashtable.md) | | [optional] +**EmptyMap** | [**SystemCollectionsHashtable**](.md) | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapWithUndeclaredPropertiesString** | **System.Collections.Hashtable** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$AdditionalPropertiesClass = Initialize-PSPetstoreAdditionalPropertiesClass -MapProperty null ` + -MapOfMapProperty null ` + -Anytype1 null ` + -MapWithUndeclaredPropertiesAnytype1 null ` + -MapWithUndeclaredPropertiesAnytype2 null ` + -MapWithUndeclaredPropertiesAnytype3 null ` + -EmptyMap null ` + -MapWithUndeclaredPropertiesString null +``` + +- Convert the resource to JSON +```powershell +$AdditionalPropertiesClass | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Animal.md b/samples/client/petstore/powershell/docs/Animal.md new file mode 100644 index 000000000000..58df67eab7df --- /dev/null +++ b/samples/client/petstore/powershell/docs/Animal.md @@ -0,0 +1,23 @@ +# Animal +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **String** | | +**Color** | **String** | | [optional] [default to "red"] + +## Examples + +- Prepare the resource +```powershell +$Animal = Initialize-PSPetstoreAnimal -ClassName null ` + -Color null +``` + +- Convert the resource to JSON +```powershell +$Animal | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Apple.md b/samples/client/petstore/powershell/docs/Apple.md new file mode 100644 index 000000000000..9300bd149eca --- /dev/null +++ b/samples/client/petstore/powershell/docs/Apple.md @@ -0,0 +1,23 @@ +# Apple +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **String** | | [optional] +**Origin** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Apple = Initialize-PSPetstoreApple -Cultivar null ` + -Origin null +``` + +- Convert the resource to JSON +```powershell +$Apple | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/AppleReq.md b/samples/client/petstore/powershell/docs/AppleReq.md new file mode 100644 index 000000000000..d6450add0c3d --- /dev/null +++ b/samples/client/petstore/powershell/docs/AppleReq.md @@ -0,0 +1,23 @@ +# AppleReq +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **String** | | +**Mealy** | **Boolean** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$AppleReq = Initialize-PSPetstoreAppleReq -Cultivar null ` + -Mealy null +``` + +- Convert the resource to JSON +```powershell +$AppleReq | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/powershell/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..c09ec94f47cc --- /dev/null +++ b/samples/client/petstore/powershell/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,21 @@ +# ArrayOfArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | [**Decimal[][]**](Array.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ArrayOfArrayOfNumberOnly = Initialize-PSPetstoreArrayOfArrayOfNumberOnly -ArrayArrayNumber null +``` + +- Convert the resource to JSON +```powershell +$ArrayOfArrayOfNumberOnly | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ArrayOfNumberOnly.md b/samples/client/petstore/powershell/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..d9ecadf562d6 --- /dev/null +++ b/samples/client/petstore/powershell/docs/ArrayOfNumberOnly.md @@ -0,0 +1,21 @@ +# ArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **Decimal[]** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ArrayOfNumberOnly = Initialize-PSPetstoreArrayOfNumberOnly -ArrayNumber null +``` + +- Convert the resource to JSON +```powershell +$ArrayOfNumberOnly | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ArrayTest.md b/samples/client/petstore/powershell/docs/ArrayTest.md new file mode 100644 index 000000000000..d95b602b96c8 --- /dev/null +++ b/samples/client/petstore/powershell/docs/ArrayTest.md @@ -0,0 +1,25 @@ +# ArrayTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **String[]** | | [optional] +**ArrayArrayOfInteger** | [**Int64[][]**](Array.md) | | [optional] +**ArrayArrayOfModel** | [**ReadOnlyFirst[][]**](Array.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ArrayTest = Initialize-PSPetstoreArrayTest -ArrayOfString null ` + -ArrayArrayOfInteger null ` + -ArrayArrayOfModel null +``` + +- Convert the resource to JSON +```powershell +$ArrayTest | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Banana.md b/samples/client/petstore/powershell/docs/Banana.md new file mode 100644 index 000000000000..db1064bfb605 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Banana.md @@ -0,0 +1,21 @@ +# Banana +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **Decimal** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Banana = Initialize-PSPetstoreBanana -LengthCm null +``` + +- Convert the resource to JSON +```powershell +$Banana | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/BananaReq.md b/samples/client/petstore/powershell/docs/BananaReq.md new file mode 100644 index 000000000000..88edcf57f200 --- /dev/null +++ b/samples/client/petstore/powershell/docs/BananaReq.md @@ -0,0 +1,23 @@ +# BananaReq +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **Decimal** | | +**Sweet** | **Boolean** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$BananaReq = Initialize-PSPetstoreBananaReq -LengthCm null ` + -Sweet null +``` + +- Convert the resource to JSON +```powershell +$BananaReq | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/BasquePig.md b/samples/client/petstore/powershell/docs/BasquePig.md new file mode 100644 index 000000000000..e0bb8c95b80e --- /dev/null +++ b/samples/client/petstore/powershell/docs/BasquePig.md @@ -0,0 +1,21 @@ +# BasquePig +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$BasquePig = Initialize-PSPetstoreBasquePig -ClassName null +``` + +- Convert the resource to JSON +```powershell +$BasquePig | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Capitalization.md b/samples/client/petstore/powershell/docs/Capitalization.md new file mode 100644 index 000000000000..dbd1d1f92de3 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Capitalization.md @@ -0,0 +1,31 @@ +# Capitalization +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **String** | | [optional] +**CapitalCamel** | **String** | | [optional] +**SmallSnake** | **String** | | [optional] +**CapitalSnake** | **String** | | [optional] +**SCAETHFlowPoints** | **String** | | [optional] +**ATTNAME** | **String** | Name of the pet | [optional] + +## Examples + +- Prepare the resource +```powershell +$Capitalization = Initialize-PSPetstoreCapitalization -SmallCamel null ` + -CapitalCamel null ` + -SmallSnake null ` + -CapitalSnake null ` + -SCAETHFlowPoints null ` + -ATTNAME null +``` + +- Convert the resource to JSON +```powershell +$Capitalization | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Cat.md b/samples/client/petstore/powershell/docs/Cat.md new file mode 100644 index 000000000000..5acf8c5186a7 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Cat.md @@ -0,0 +1,25 @@ +# Cat +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **String** | | +**Color** | **String** | | [optional] [default to "red"] +**Declawed** | **Boolean** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Cat = Initialize-PSPetstoreCat -ClassName null ` + -Color null ` + -Declawed null +``` + +- Convert the resource to JSON +```powershell +$Cat | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/CatAllOf.md b/samples/client/petstore/powershell/docs/CatAllOf.md new file mode 100644 index 000000000000..451db0fa20b7 --- /dev/null +++ b/samples/client/petstore/powershell/docs/CatAllOf.md @@ -0,0 +1,21 @@ +# CatAllOf +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **Boolean** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$CatAllOf = Initialize-PSPetstoreCatAllOf -Declawed null +``` + +- Convert the resource to JSON +```powershell +$CatAllOf | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Category.md b/samples/client/petstore/powershell/docs/Category.md index 96644698838c..01bb6682755c 100644 --- a/samples/client/petstore/powershell/docs/Category.md +++ b/samples/client/petstore/powershell/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **Int64** | | [optional] -**Name** | **String** | | [optional] +**Name** | **String** | | [default to "default-name"] ## Examples diff --git a/samples/client/petstore/powershell/docs/ClassModel.md b/samples/client/petstore/powershell/docs/ClassModel.md new file mode 100644 index 000000000000..c5735d43e7d4 --- /dev/null +++ b/samples/client/petstore/powershell/docs/ClassModel.md @@ -0,0 +1,21 @@ +# ClassModel +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ClassModel = Initialize-PSPetstoreClassModel -Class null +``` + +- Convert the resource to JSON +```powershell +$ClassModel | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Client.md b/samples/client/petstore/powershell/docs/Client.md new file mode 100644 index 000000000000..a447197d49c8 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Client.md @@ -0,0 +1,21 @@ +# Client +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Client** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Client = Initialize-PSPetstoreClient -Client null +``` + +- Convert the resource to JSON +```powershell +$Client | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ComplexQuadrilateral.md b/samples/client/petstore/powershell/docs/ComplexQuadrilateral.md new file mode 100644 index 000000000000..c34b2f9941a6 --- /dev/null +++ b/samples/client/petstore/powershell/docs/ComplexQuadrilateral.md @@ -0,0 +1,23 @@ +# ComplexQuadrilateral +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$ComplexQuadrilateral = Initialize-PSPetstoreComplexQuadrilateral -ShapeType null ` + -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$ComplexQuadrilateral | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/DanishPig.md b/samples/client/petstore/powershell/docs/DanishPig.md new file mode 100644 index 000000000000..f1e5f0ebeafa --- /dev/null +++ b/samples/client/petstore/powershell/docs/DanishPig.md @@ -0,0 +1,21 @@ +# DanishPig +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$DanishPig = Initialize-PSPetstoreDanishPig -ClassName null +``` + +- Convert the resource to JSON +```powershell +$DanishPig | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/DeprecatedObject.md b/samples/client/petstore/powershell/docs/DeprecatedObject.md new file mode 100644 index 000000000000..b0cb2c030aa0 --- /dev/null +++ b/samples/client/petstore/powershell/docs/DeprecatedObject.md @@ -0,0 +1,21 @@ +# DeprecatedObject +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$DeprecatedObject = Initialize-PSPetstoreDeprecatedObject -Name null +``` + +- Convert the resource to JSON +```powershell +$DeprecatedObject | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Dog.md b/samples/client/petstore/powershell/docs/Dog.md new file mode 100644 index 000000000000..fb0a4f48f37b --- /dev/null +++ b/samples/client/petstore/powershell/docs/Dog.md @@ -0,0 +1,25 @@ +# Dog +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **String** | | +**Color** | **String** | | [optional] [default to "red"] +**Breed** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Dog = Initialize-PSPetstoreDog -ClassName null ` + -Color null ` + -Breed null +``` + +- Convert the resource to JSON +```powershell +$Dog | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/DogAllOf.md b/samples/client/petstore/powershell/docs/DogAllOf.md new file mode 100644 index 000000000000..73337ad7405a --- /dev/null +++ b/samples/client/petstore/powershell/docs/DogAllOf.md @@ -0,0 +1,21 @@ +# DogAllOf +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$DogAllOf = Initialize-PSPetstoreDogAllOf -Breed null +``` + +- Convert the resource to JSON +```powershell +$DogAllOf | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Drawing.md b/samples/client/petstore/powershell/docs/Drawing.md new file mode 100644 index 000000000000..362fba5054de --- /dev/null +++ b/samples/client/petstore/powershell/docs/Drawing.md @@ -0,0 +1,27 @@ +# Drawing +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**Shapes** | [**Shape[]**](Shape.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Drawing = Initialize-PSPetstoreDrawing -MainShape null ` + -ShapeOrNull null ` + -NullableShape null ` + -Shapes null +``` + +- Convert the resource to JSON +```powershell +$Drawing | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/EnumArrays.md b/samples/client/petstore/powershell/docs/EnumArrays.md new file mode 100644 index 000000000000..9ba5f540f9e5 --- /dev/null +++ b/samples/client/petstore/powershell/docs/EnumArrays.md @@ -0,0 +1,23 @@ +# EnumArrays +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | **String** | | [optional] +**ArrayEnum** | **String[]** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$EnumArrays = Initialize-PSPetstoreEnumArrays -JustSymbol null ` + -ArrayEnum null +``` + +- Convert the resource to JSON +```powershell +$EnumArrays | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/EnumClass.md b/samples/client/petstore/powershell/docs/EnumClass.md new file mode 100644 index 000000000000..a928ad7c3bf6 --- /dev/null +++ b/samples/client/petstore/powershell/docs/EnumClass.md @@ -0,0 +1,20 @@ +# EnumClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Examples + +- Prepare the resource +```powershell +$EnumClass = Initialize-PSPetstoreEnumClass +``` + +- Convert the resource to JSON +```powershell +$EnumClass | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/EnumTest.md b/samples/client/petstore/powershell/docs/EnumTest.md new file mode 100644 index 000000000000..c0ec1bb6c282 --- /dev/null +++ b/samples/client/petstore/powershell/docs/EnumTest.md @@ -0,0 +1,37 @@ +# EnumTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **String** | | [optional] +**EnumStringRequired** | **String** | | +**EnumInteger** | **Int32** | | [optional] +**EnumIntegerOnly** | **Int32** | | [optional] +**EnumNumber** | **Double** | | [optional] +**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**OuterEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**OuterEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$EnumTest = Initialize-PSPetstoreEnumTest -EnumString null ` + -EnumStringRequired null ` + -EnumInteger null ` + -EnumIntegerOnly null ` + -EnumNumber null ` + -OuterEnum null ` + -OuterEnumInteger null ` + -OuterEnumDefaultValue null ` + -OuterEnumIntegerDefaultValue null +``` + +- Convert the resource to JSON +```powershell +$EnumTest | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/EquilateralTriangle.md b/samples/client/petstore/powershell/docs/EquilateralTriangle.md new file mode 100644 index 000000000000..aeb38986c1ba --- /dev/null +++ b/samples/client/petstore/powershell/docs/EquilateralTriangle.md @@ -0,0 +1,23 @@ +# EquilateralTriangle +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$EquilateralTriangle = Initialize-PSPetstoreEquilateralTriangle -ShapeType null ` + -TriangleType null +``` + +- Convert the resource to JSON +```powershell +$EquilateralTriangle | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/File.md b/samples/client/petstore/powershell/docs/File.md new file mode 100644 index 000000000000..09e1dd3ed8d1 --- /dev/null +++ b/samples/client/petstore/powershell/docs/File.md @@ -0,0 +1,21 @@ +# File +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **String** | Test capitalization | [optional] + +## Examples + +- Prepare the resource +```powershell +$File = Initialize-PSPetstoreFile -SourceURI null +``` + +- Convert the resource to JSON +```powershell +$File | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/FileSchemaTestClass.md b/samples/client/petstore/powershell/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..c350eece6edc --- /dev/null +++ b/samples/client/petstore/powershell/docs/FileSchemaTestClass.md @@ -0,0 +1,23 @@ +# FileSchemaTestClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**File[]**](File.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$FileSchemaTestClass = Initialize-PSPetstoreFileSchemaTestClass -File null ` + -Files null +``` + +- Convert the resource to JSON +```powershell +$FileSchemaTestClass | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Foo.md b/samples/client/petstore/powershell/docs/Foo.md new file mode 100644 index 000000000000..ad152ea32714 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Foo.md @@ -0,0 +1,21 @@ +# Foo +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **String** | | [optional] [default to "bar"] + +## Examples + +- Prepare the resource +```powershell +$Foo = Initialize-PSPetstoreFoo -Bar null +``` + +- Convert the resource to JSON +```powershell +$Foo | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/FormatTest.md b/samples/client/petstore/powershell/docs/FormatTest.md new file mode 100644 index 000000000000..f413641a5eb0 --- /dev/null +++ b/samples/client/petstore/powershell/docs/FormatTest.md @@ -0,0 +1,51 @@ +# FormatTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **Int32** | | [optional] +**Int32** | **Int32** | | [optional] +**Int64** | **Int64** | | [optional] +**Number** | **Decimal** | | +**Float** | **Double** | | [optional] +**Double** | **Double** | | [optional] +**Decimal** | **Decimal** | | [optional] +**String** | **String** | | [optional] +**Byte** | [**SystemByte**](SystemByte.md) | | +**Binary** | **System.IO.FileInfo** | | [optional] +**Date** | **System.DateTime** | | +**DateTime** | **System.DateTime** | | [optional] +**Uuid** | **String** | | [optional] +**Password** | **String** | | +**PatternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +## Examples + +- Prepare the resource +```powershell +$FormatTest = Initialize-PSPetstoreFormatTest -Integer null ` + -Int32 null ` + -Int64 null ` + -Number null ` + -Float null ` + -Double null ` + -Decimal null ` + -String null ` + -Byte null ` + -Binary null ` + -Date Sun Feb 02 00:00:00 UTC 2020 ` + -DateTime 2007-12-03T10:15:30+01:00 ` + -Uuid 72f98069-206d-4f12-9f12-3d1e525a8e84 ` + -Password null ` + -PatternWithDigits null ` + -PatternWithDigitsAndDelimiter null +``` + +- Convert the resource to JSON +```powershell +$FormatTest | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Fruit.md b/samples/client/petstore/powershell/docs/Fruit.md new file mode 100644 index 000000000000..2a6716b42f75 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Fruit.md @@ -0,0 +1,27 @@ +# Fruit +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **String** | | [optional] +**Cultivar** | **String** | | [optional] +**Origin** | **String** | | [optional] +**LengthCm** | **Decimal** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Fruit = Initialize-PSPetstoreFruit -Color null ` + -Cultivar null ` + -Origin null ` + -LengthCm null +``` + +- Convert the resource to JSON +```powershell +$Fruit | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/FruitReq.md b/samples/client/petstore/powershell/docs/FruitReq.md new file mode 100644 index 000000000000..d8fcd89ee5e1 --- /dev/null +++ b/samples/client/petstore/powershell/docs/FruitReq.md @@ -0,0 +1,27 @@ +# FruitReq +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **String** | | +**Mealy** | **Boolean** | | [optional] +**LengthCm** | **Decimal** | | +**Sweet** | **Boolean** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$FruitReq = Initialize-PSPetstoreFruitReq -Cultivar null ` + -Mealy null ` + -LengthCm null ` + -Sweet null +``` + +- Convert the resource to JSON +```powershell +$FruitReq | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/GmFruit.md b/samples/client/petstore/powershell/docs/GmFruit.md new file mode 100644 index 000000000000..db0e1e6476bb --- /dev/null +++ b/samples/client/petstore/powershell/docs/GmFruit.md @@ -0,0 +1,27 @@ +# GmFruit +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **String** | | [optional] +**Cultivar** | **String** | | [optional] +**Origin** | **String** | | [optional] +**LengthCm** | **Decimal** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$GmFruit = Initialize-PSPetstoreGmFruit -Color null ` + -Cultivar null ` + -Origin null ` + -LengthCm null +``` + +- Convert the resource to JSON +```powershell +$GmFruit | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/GrandparentAnimal.md b/samples/client/petstore/powershell/docs/GrandparentAnimal.md new file mode 100644 index 000000000000..c4d0d92efa14 --- /dev/null +++ b/samples/client/petstore/powershell/docs/GrandparentAnimal.md @@ -0,0 +1,21 @@ +# GrandparentAnimal +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$GrandparentAnimal = Initialize-PSPetstoreGrandparentAnimal -PetType null +``` + +- Convert the resource to JSON +```powershell +$GrandparentAnimal | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/HasOnlyReadOnly.md b/samples/client/petstore/powershell/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..b227658de7e4 --- /dev/null +++ b/samples/client/petstore/powershell/docs/HasOnlyReadOnly.md @@ -0,0 +1,23 @@ +# HasOnlyReadOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **String** | | [optional] [readonly] +**Foo** | **String** | | [optional] [readonly] + +## Examples + +- Prepare the resource +```powershell +$HasOnlyReadOnly = Initialize-PSPetstoreHasOnlyReadOnly -Bar null ` + -Foo null +``` + +- Convert the resource to JSON +```powershell +$HasOnlyReadOnly | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/HealthCheckResult.md b/samples/client/petstore/powershell/docs/HealthCheckResult.md new file mode 100644 index 000000000000..beb1d70722c5 --- /dev/null +++ b/samples/client/petstore/powershell/docs/HealthCheckResult.md @@ -0,0 +1,21 @@ +# HealthCheckResult +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$HealthCheckResult = Initialize-PSPetstoreHealthCheckResult -NullableMessage null +``` + +- Convert the resource to JSON +```powershell +$HealthCheckResult | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/InlineResponseDefault.md b/samples/client/petstore/powershell/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..3169148a9324 --- /dev/null +++ b/samples/client/petstore/powershell/docs/InlineResponseDefault.md @@ -0,0 +1,21 @@ +# InlineResponseDefault +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$InlineResponseDefault = Initialize-PSPetstoreInlineResponseDefault -String null +``` + +- Convert the resource to JSON +```powershell +$InlineResponseDefault | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/IsoscelesTriangle.md b/samples/client/petstore/powershell/docs/IsoscelesTriangle.md new file mode 100644 index 000000000000..7f71d9c439aa --- /dev/null +++ b/samples/client/petstore/powershell/docs/IsoscelesTriangle.md @@ -0,0 +1,23 @@ +# IsoscelesTriangle +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$IsoscelesTriangle = Initialize-PSPetstoreIsoscelesTriangle -ShapeType null ` + -TriangleType null +``` + +- Convert the resource to JSON +```powershell +$IsoscelesTriangle | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/List.md b/samples/client/petstore/powershell/docs/List.md new file mode 100644 index 000000000000..625a406020a1 --- /dev/null +++ b/samples/client/petstore/powershell/docs/List.md @@ -0,0 +1,21 @@ +# List +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$List = Initialize-PSPetstoreList -Var123List null +``` + +- Convert the resource to JSON +```powershell +$List | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Mammal.md b/samples/client/petstore/powershell/docs/Mammal.md new file mode 100644 index 000000000000..a3ee83c488ae --- /dev/null +++ b/samples/client/petstore/powershell/docs/Mammal.md @@ -0,0 +1,27 @@ +# Mammal +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **Boolean** | | [optional] +**HasTeeth** | **Boolean** | | [optional] +**ClassName** | **String** | | +**Type** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$Mammal = Initialize-PSPetstoreMammal -HasBaleen null ` + -HasTeeth null ` + -ClassName null ` + -Type null +``` + +- Convert the resource to JSON +```powershell +$Mammal | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/MapTest.md b/samples/client/petstore/powershell/docs/MapTest.md new file mode 100644 index 000000000000..8ac5b4e5321d --- /dev/null +++ b/samples/client/petstore/powershell/docs/MapTest.md @@ -0,0 +1,27 @@ +# MapTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | [**System.Collections.Hashtable**](Map.md) | | [optional] +**MapOfEnumString** | **System.Collections.Hashtable** | | [optional] +**DirectMap** | **System.Collections.Hashtable** | | [optional] +**IndirectMap** | **System.Collections.Hashtable** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$MapTest = Initialize-PSPetstoreMapTest -MapMapOfString null ` + -MapOfEnumString null ` + -DirectMap null ` + -IndirectMap null +``` + +- Convert the resource to JSON +```powershell +$MapTest | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/powershell/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..d6ae68845b8a --- /dev/null +++ b/samples/client/petstore/powershell/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,25 @@ +# MixedPropertiesAndAdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **String** | | [optional] +**DateTime** | **System.DateTime** | | [optional] +**Map** | [**System.Collections.Hashtable**](Animal.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$MixedPropertiesAndAdditionalPropertiesClass = Initialize-PSPetstoreMixedPropertiesAndAdditionalPropertiesClass -Uuid null ` + -DateTime null ` + -Map null +``` + +- Convert the resource to JSON +```powershell +$MixedPropertiesAndAdditionalPropertiesClass | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Name.md b/samples/client/petstore/powershell/docs/Name.md new file mode 100644 index 000000000000..fdae841de883 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Name.md @@ -0,0 +1,27 @@ +# Name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **Int32** | | +**SnakeCase** | **Int32** | | [optional] [readonly] +**Property** | **String** | | [optional] +**Var123Number** | **Int32** | | [optional] [readonly] + +## Examples + +- Prepare the resource +```powershell +$Name = Initialize-PSPetstoreName -Name null ` + -SnakeCase null ` + -Property null ` + -Var123Number null +``` + +- Convert the resource to JSON +```powershell +$Name | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/NullableClass.md b/samples/client/petstore/powershell/docs/NullableClass.md new file mode 100644 index 000000000000..e7c5230140e6 --- /dev/null +++ b/samples/client/petstore/powershell/docs/NullableClass.md @@ -0,0 +1,43 @@ +# NullableClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **Int32** | | [optional] +**NumberProp** | **Decimal** | | [optional] +**BooleanProp** | **Boolean** | | [optional] +**StringProp** | **String** | | [optional] +**DateProp** | **System.DateTime** | | [optional] +**DatetimeProp** | **System.DateTime** | | [optional] +**ArrayNullableProp** | [**SystemCollectionsHashtable[]**](SystemCollectionsHashtable.md) | | [optional] +**ArrayAndItemsNullableProp** | [**SystemCollectionsHashtable[]**](SystemCollectionsHashtable.md) | | [optional] +**ArrayItemsNullable** | [**SystemCollectionsHashtable[]**](SystemCollectionsHashtable.md) | | [optional] +**ObjectNullableProp** | [**System.Collections.Hashtable**](SystemCollectionsHashtable.md) | | [optional] +**ObjectAndItemsNullableProp** | [**System.Collections.Hashtable**](SystemCollectionsHashtable.md) | | [optional] +**ObjectItemsNullable** | [**System.Collections.Hashtable**](SystemCollectionsHashtable.md) | | [optional] + +## Examples + +- Prepare the resource +```powershell +$NullableClass = Initialize-PSPetstoreNullableClass -IntegerProp null ` + -NumberProp null ` + -BooleanProp null ` + -StringProp null ` + -DateProp null ` + -DatetimeProp null ` + -ArrayNullableProp null ` + -ArrayAndItemsNullableProp null ` + -ArrayItemsNullable null ` + -ObjectNullableProp null ` + -ObjectAndItemsNullableProp null ` + -ObjectItemsNullable null +``` + +- Convert the resource to JSON +```powershell +$NullableClass | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/NullableShape.md b/samples/client/petstore/powershell/docs/NullableShape.md new file mode 100644 index 000000000000..127110ad1c0d --- /dev/null +++ b/samples/client/petstore/powershell/docs/NullableShape.md @@ -0,0 +1,25 @@ +# NullableShape +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$NullableShape = Initialize-PSPetstoreNullableShape -ShapeType null ` + -TriangleType null ` + -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$NullableShape | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/NumberOnly.md b/samples/client/petstore/powershell/docs/NumberOnly.md new file mode 100644 index 000000000000..672595343afa --- /dev/null +++ b/samples/client/petstore/powershell/docs/NumberOnly.md @@ -0,0 +1,21 @@ +# NumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **Decimal** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$NumberOnly = Initialize-PSPetstoreNumberOnly -JustNumber null +``` + +- Convert the resource to JSON +```powershell +$NumberOnly | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/powershell/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..e3911c6ecf8e --- /dev/null +++ b/samples/client/petstore/powershell/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,27 @@ +# ObjectWithDeprecatedFields +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **String** | | [optional] +**Id** | **Decimal** | | [optional] +**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**Bars** | **String[]** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ObjectWithDeprecatedFields = Initialize-PSPetstoreObjectWithDeprecatedFields -Uuid null ` + -Id null ` + -DeprecatedRef null ` + -Bars null +``` + +- Convert the resource to JSON +```powershell +$ObjectWithDeprecatedFields | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Order.md b/samples/client/petstore/powershell/docs/Order.md index d7903c621b2d..8da0af886043 100644 --- a/samples/client/petstore/powershell/docs/Order.md +++ b/samples/client/petstore/powershell/docs/Order.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes $Order = Initialize-PSPetstoreOrder -Id null ` -PetId null ` -Quantity null ` - -ShipDate null ` + -ShipDate 2020-02-02T20:20:20.000222Z ` -Status null ` -Complete null ``` diff --git a/samples/client/petstore/powershell/docs/OuterComposite.md b/samples/client/petstore/powershell/docs/OuterComposite.md new file mode 100644 index 000000000000..f9afa36a5242 --- /dev/null +++ b/samples/client/petstore/powershell/docs/OuterComposite.md @@ -0,0 +1,25 @@ +# OuterComposite +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **Decimal** | | [optional] +**MyString** | **String** | | [optional] +**MyBoolean** | **Boolean** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$OuterComposite = Initialize-PSPetstoreOuterComposite -MyNumber null ` + -MyString null ` + -MyBoolean null +``` + +- Convert the resource to JSON +```powershell +$OuterComposite | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/OuterEnum.md b/samples/client/petstore/powershell/docs/OuterEnum.md new file mode 100644 index 000000000000..14f817afe9e9 --- /dev/null +++ b/samples/client/petstore/powershell/docs/OuterEnum.md @@ -0,0 +1,20 @@ +# OuterEnum +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Examples + +- Prepare the resource +```powershell +$OuterEnum = Initialize-PSPetstoreOuterEnum +``` + +- Convert the resource to JSON +```powershell +$OuterEnum | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/OuterEnumDefaultValue.md b/samples/client/petstore/powershell/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..9d4f8e7d0a5e --- /dev/null +++ b/samples/client/petstore/powershell/docs/OuterEnumDefaultValue.md @@ -0,0 +1,20 @@ +# OuterEnumDefaultValue +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Examples + +- Prepare the resource +```powershell +$OuterEnumDefaultValue = Initialize-PSPetstoreOuterEnumDefaultValue +``` + +- Convert the resource to JSON +```powershell +$OuterEnumDefaultValue | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/OuterEnumInteger.md b/samples/client/petstore/powershell/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..85162ed4ddb5 --- /dev/null +++ b/samples/client/petstore/powershell/docs/OuterEnumInteger.md @@ -0,0 +1,20 @@ +# OuterEnumInteger +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Examples + +- Prepare the resource +```powershell +$OuterEnumInteger = Initialize-PSPetstoreOuterEnumInteger +``` + +- Convert the resource to JSON +```powershell +$OuterEnumInteger | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/powershell/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..c3d595f870c2 --- /dev/null +++ b/samples/client/petstore/powershell/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,20 @@ +# OuterEnumIntegerDefaultValue +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Examples + +- Prepare the resource +```powershell +$OuterEnumIntegerDefaultValue = Initialize-PSPetstoreOuterEnumIntegerDefaultValue +``` + +- Convert the resource to JSON +```powershell +$OuterEnumIntegerDefaultValue | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/PSAnotherFakeApi.md b/samples/client/petstore/powershell/docs/PSAnotherFakeApi.md new file mode 100644 index 000000000000..ebdbaf3af0f4 --- /dev/null +++ b/samples/client/petstore/powershell/docs/PSAnotherFakeApi.md @@ -0,0 +1,52 @@ +# PSPetstore.PSPetstore/Api.PSAnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Invoke-PS123TestSpecialTags**](PSAnotherFakeApi.md#Invoke-PS123TestSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **Invoke-PS123TestSpecialTags** +> Client Invoke-PS123TestSpecialTags
+>         [-Client]
+ +To test special tags + +To test special tags and operation ID starting with number + +### Example +```powershell +$Client = Initialize-Client -Client "MyClient" # Client | client model + +# To test special tags +try { + $Result = Invoke-PS123TestSpecialTags -Client $Client +} catch { + Write-Host ("Exception occurred when calling Invoke-PS123TestSpecialTags: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) (PSCustomObject) + +### 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/client/petstore/powershell/docs/PSDefaultApi.md b/samples/client/petstore/powershell/docs/PSDefaultApi.md new file mode 100644 index 000000000000..9c10aff593b6 --- /dev/null +++ b/samples/client/petstore/powershell/docs/PSDefaultApi.md @@ -0,0 +1,44 @@ +# PSPetstore.PSPetstore/Api.PSDefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Invoke-PSFooGet**](PSDefaultApi.md#Invoke-PSFooGet) | **GET** /foo | + + + +# **Invoke-PSFooGet** +> InlineResponseDefault Invoke-PSFooGet
+ + + +### Example +```powershell + +try { + $Result = Invoke-PSFooGet +} catch { + Write-Host ("Exception occurred when calling Invoke-PSFooGet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) (PSCustomObject) + +### 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/client/petstore/powershell/docs/PSFakeApi.md b/samples/client/petstore/powershell/docs/PSFakeApi.md new file mode 100644 index 000000000000..8f22dd6ca054 --- /dev/null +++ b/samples/client/petstore/powershell/docs/PSFakeApi.md @@ -0,0 +1,751 @@ +# PSPetstore.PSPetstore/Api.PSFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Invoke-PSFakeHealthGet**](PSFakeApi.md#Invoke-PSFakeHealthGet) | **GET** /fake/health | Health check endpoint +[**Invoke-PSFakeOuterBooleanSerialize**](PSFakeApi.md#Invoke-PSFakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**Invoke-PSFakeOuterCompositeSerialize**](PSFakeApi.md#Invoke-PSFakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**Invoke-PSFakeOuterNumberSerialize**](PSFakeApi.md#Invoke-PSFakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**Invoke-PSFakeOuterStringSerialize**](PSFakeApi.md#Invoke-PSFakeOuterStringSerialize) | **POST** /fake/outer/string | +[**Get-PSArrayOfEnums**](PSFakeApi.md#Get-PSArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +[**Test-PSBodyWithFileSchema**](PSFakeApi.md#Test-PSBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**Test-PSBodyWithQueryParams**](PSFakeApi.md#Test-PSBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**Test-PSClientModel**](PSFakeApi.md#Test-PSClientModel) | **PATCH** /fake | To test ""client"" model +[**Test-PSEndpointParameters**](PSFakeApi.md#Test-PSEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**Test-PSEnumParameters**](PSFakeApi.md#Test-PSEnumParameters) | **GET** /fake | To test enum parameters +[**Test-PSGroupParameters**](PSFakeApi.md#Test-PSGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**Test-PSInlineAdditionalProperties**](PSFakeApi.md#Test-PSInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**Test-PSJsonFormData**](PSFakeApi.md#Test-PSJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**Test-PSQueryParameterCollectionFormat**](PSFakeApi.md#Test-PSQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | + + + +# **Invoke-PSFakeHealthGet** +> HealthCheckResult Invoke-PSFakeHealthGet
+ +Health check endpoint + +### Example +```powershell + +# Health check endpoint +try { + $Result = Invoke-PSFakeHealthGet +} catch { + Write-Host ("Exception occurred when calling Invoke-PSFakeHealthGet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) (PSCustomObject) + +### 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) + + +# **Invoke-PSFakeOuterBooleanSerialize** +> Boolean Invoke-PSFakeOuterBooleanSerialize
+>         [-Body]
+ + + +Test serialization of outer boolean types + +### Example +```powershell +$Body = $true # Boolean | Input boolean as post body (optional) + +try { + $Result = Invoke-PSFakeOuterBooleanSerialize -Body $Body +} catch { + Write-Host ("Exception occurred when calling Invoke-PSFakeOuterBooleanSerialize: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### 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) + + +# **Invoke-PSFakeOuterCompositeSerialize** +> OuterComposite Invoke-PSFakeOuterCompositeSerialize
+>         [-OuterComposite]
+ + + +Test serialization of object with outer number type + +### Example +```powershell +$OuterComposite = Initialize-OuterComposite -MyNumber 0 -MyString "MyMyString" -MyBoolean $false # OuterComposite | Input composite as post body (optional) + +try { + $Result = Invoke-PSFakeOuterCompositeSerialize -OuterComposite $OuterComposite +} catch { + Write-Host ("Exception occurred when calling Invoke-PSFakeOuterCompositeSerialize: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **OuterComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) (PSCustomObject) + +### 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) + + +# **Invoke-PSFakeOuterNumberSerialize** +> Decimal Invoke-PSFakeOuterNumberSerialize
+>         [-Body]
+ + + +Test serialization of outer number types + +### Example +```powershell +$Body = 8.14 # Decimal | Input number as post body (optional) + +try { + $Result = Invoke-PSFakeOuterNumberSerialize -Body $Body +} catch { + Write-Host ("Exception occurred when calling Invoke-PSFakeOuterNumberSerialize: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Body** | **Decimal**| Input number as post body | [optional] + +### Return type + +**Decimal** + +### 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) + + +# **Invoke-PSFakeOuterStringSerialize** +> String Invoke-PSFakeOuterStringSerialize
+>         [-Body]
+ + + +Test serialization of outer string types + +### Example +```powershell +$Body = "MyBody" # String | Input string as post body (optional) + +try { + $Result = Invoke-PSFakeOuterStringSerialize -Body $Body +} catch { + Write-Host ("Exception occurred when calling Invoke-PSFakeOuterStringSerialize: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### 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) + + +# **Get-PSArrayOfEnums** +> OuterEnum[] Get-PSArrayOfEnums
+ +Array of Enums + +### Example +```powershell + +# Array of Enums +try { + $Result = Get-PSArrayOfEnums +} catch { + Write-Host ("Exception occurred when calling Get-PSArrayOfEnums: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OuterEnum[]**](OuterEnum.md) (PSCustomObject) + +### 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) + + +# **Test-PSBodyWithFileSchema** +> void Test-PSBodyWithFileSchema
+>         [-FileSchemaTestClass]
+ + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```powershell +$File = Initialize-File -SourceURI "MySourceURI" +$FileSchemaTestClass = Initialize-FileSchemaTestClass -File $File -Files $File # FileSchemaTestClass | + +try { + $Result = Test-PSBodyWithFileSchema -FileSchemaTestClass $FileSchemaTestClass +} catch { + Write-Host ("Exception occurred when calling Test-PSBodyWithFileSchema: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **FileSchemaTestClass** | [**FileSchemaTestClass**](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) + + +# **Test-PSBodyWithQueryParams** +> void Test-PSBodyWithQueryParams
+>         [-Query]
+>         [-User]
+ + + +### Example +```powershell +$Query = "MyQuery" # String | +$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 -ObjectWithNoDeclaredProps -ObjectWithNoDeclaredPropsNullable -AnyTypeProp -AnyTypePropNullable # User | + +try { + $Result = Test-PSBodyWithQueryParams -Query $Query -User $User +} catch { + Write-Host ("Exception occurred when calling Test-PSBodyWithQueryParams: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Query** | **String**| | + **User** | [**User**](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) + + +# **Test-PSClientModel** +> Client Test-PSClientModel
+>         [-Client]
+ +To test ""client"" model + +To test ""client"" model + +### Example +```powershell +$Client = Initialize-Client -Client "MyClient" # Client | client model + +# To test ""client"" model +try { + $Result = Test-PSClientModel -Client $Client +} catch { + Write-Host ("Exception occurred when calling Test-PSClientModel: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) (PSCustomObject) + +### 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) + + +# **Test-PSEndpointParameters** +> void Test-PSEndpointParameters
+>         [-Number]
+>         [-Double]
+>         [-PatternWithoutDelimiter]
+>         [-Byte]
+>         [-Integer]
+>         [-Int32]
+>         [-Int64]
+>         [-Float]
+>         [-String]
+>         [-Binary]
+>         [-Date]
+>         [-DateTime]
+>         [-Password]
+>         [-Callback]
+ +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```powershell +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration +# Configure HTTP basic authorization: http_basic_test +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" + +$Number = 8.14 # Decimal | None +$Double = 1.2 # Double | None +$PatternWithoutDelimiter = "MyPatternWithoutDelimiter" # String | None +$Byte = # SystemByte | None +$Integer = 56 # Int32 | None (optional) +$Int32 = 56 # Int32 | None (optional) +$Int64 = 789 # Int64 | None (optional) +$Float = 3.4 # Double | None (optional) +$String = "MyString" # String | None (optional) +$Binary = # System.IO.FileInfo | None (optional) +$Date = (Get-Date) # System.DateTime | None (optional) +$DateTime = (Get-Date) # System.DateTime | None (optional) +$Password = "MyPassword" # String | None (optional) +$Callback = "MyCallback" # String | None (optional) + +# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +try { + $Result = Test-PSEndpointParameters -Number $Number -Double $Double -PatternWithoutDelimiter $PatternWithoutDelimiter -Byte $Byte -Integer $Integer -Int32 $Int32 -Int64 $Int64 -Float $Float -String $String -Binary $Binary -Date $Date -DateTime $DateTime -Password $Password -Callback $Callback +} catch { + Write-Host ("Exception occurred when calling Test-PSEndpointParameters: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Number** | **Decimal**| None | + **Double** | **Double**| None | + **PatternWithoutDelimiter** | **String**| None | + **Byte** | **SystemByte**| None | + **Integer** | **Int32**| None | [optional] + **Int32** | **Int32**| None | [optional] + **Int64** | **Int64**| None | [optional] + **Float** | **Double**| None | [optional] + **String** | **String**| None | [optional] + **Binary** | **System.IO.FileInfo****System.IO.FileInfo**| None | [optional] + **Date** | **System.DateTime**| None | [optional] + **DateTime** | **System.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) + + +# **Test-PSEnumParameters** +> void Test-PSEnumParameters
+>         [-EnumHeaderStringArray]
+>         [-EnumHeaderString]
+>         [-EnumQueryStringArray]
+>         [-EnumQueryString]
+>         [-EnumQueryInteger]
+>         [-EnumQueryDouble]
+>         [-EnumFormStringArray]
+>         [-EnumFormString]
+ +To test enum parameters + +To test enum parameters + +### Example +```powershell +$EnumHeaderStringArray = ">" # String[] | Header parameter enum test (string array) (optional) +$EnumHeaderString = "_abc" # String | Header parameter enum test (string) (optional) (default to "-efg") +$EnumQueryStringArray = ">" # String[] | Query parameter enum test (string array) (optional) +$EnumQueryString = "_abc" # String | Query parameter enum test (string) (optional) (default to "-efg") +$EnumQueryInteger = "1" # Int32 | Query parameter enum test (double) (optional) +$EnumQueryDouble = "1.1" # Double | Query parameter enum test (double) (optional) +$EnumFormStringArray = ">" # String[] | Form parameter enum test (string array) (optional) (default to "$") +$EnumFormString = "_abc" # String | Form parameter enum test (string) (optional) (default to "-efg") + +# To test enum parameters +try { + $Result = Test-PSEnumParameters -EnumHeaderStringArray $EnumHeaderStringArray -EnumHeaderString $EnumHeaderString -EnumQueryStringArray $EnumQueryStringArray -EnumQueryString $EnumQueryString -EnumQueryInteger $EnumQueryInteger -EnumQueryDouble $EnumQueryDouble -EnumFormStringArray $EnumFormStringArray -EnumFormString $EnumFormString +} catch { + Write-Host ("Exception occurred when calling Test-PSEnumParameters: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **EnumHeaderStringArray** | [**String[]**](String.md)| Header parameter enum test (string array) | [optional] + **EnumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to "-efg"] + **EnumQueryStringArray** | [**String[]**](String.md)| Query parameter enum test (string array) | [optional] + **EnumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to "-efg"] + **EnumQueryInteger** | **Int32**| Query parameter enum test (double) | [optional] + **EnumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] + **EnumFormStringArray** | [**String[]**](String.md)| Form parameter enum test (string array) | [optional] [default to "$"] + **EnumFormString** | **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) + + +# **Test-PSGroupParameters** +> void Test-PSGroupParameters
+>         [-RequiredStringGroup]
+>         [-RequiredBooleanGroup]
+>         [-RequiredInt64Group]
+>         [-StringGroup]
+>         [-BooleanGroup]
+>         [-Int64Group]
+ +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```powershell +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration +# Configure HTTP basic authorization: bearer_test +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" + +$RequiredStringGroup = 56 # Int32 | Required String in group parameters +$RequiredBooleanGroup = $true # Boolean | Required Boolean in group parameters +$RequiredInt64Group = 789 # Int64 | Required Integer in group parameters +$StringGroup = 56 # Int32 | String in group parameters (optional) +$BooleanGroup = $true # Boolean | Boolean in group parameters (optional) +$Int64Group = 789 # Int64 | Integer in group parameters (optional) + +# Fake endpoint to test group parameters (optional) +try { + $Result = Test-PSGroupParameters -RequiredStringGroup $RequiredStringGroup -RequiredBooleanGroup $RequiredBooleanGroup -RequiredInt64Group $RequiredInt64Group -StringGroup $StringGroup -BooleanGroup $BooleanGroup -Int64Group $Int64Group +} catch { + Write-Host ("Exception occurred when calling Test-PSGroupParameters: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **RequiredStringGroup** | **Int32**| Required String in group parameters | + **RequiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | + **RequiredInt64Group** | **Int64**| Required Integer in group parameters | + **StringGroup** | **Int32**| String in group parameters | [optional] + **BooleanGroup** | **Boolean**| Boolean in group parameters | [optional] + **Int64Group** | **Int64**| 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) + + +# **Test-PSInlineAdditionalProperties** +> void Test-PSInlineAdditionalProperties
+>         [-RequestBody]
+ +test inline additionalProperties + + + +### Example +```powershell +$RequestBody = @{ key_example = "MyInner" } # System.Collections.Hashtable | request body + +# test inline additionalProperties +try { + $Result = Test-PSInlineAdditionalProperties -RequestBody $RequestBody +} catch { + Write-Host ("Exception occurred when calling Test-PSInlineAdditionalProperties: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **RequestBody** | [**System.Collections.Hashtable**](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) + + +# **Test-PSJsonFormData** +> void Test-PSJsonFormData
+>         [-Param]
+>         [-Param2]
+ +test json serialization of form data + + + +### Example +```powershell +$Param = "MyParam" # String | field1 +$Param2 = "MyParam2" # String | field2 + +# test json serialization of form data +try { + $Result = Test-PSJsonFormData -Param $Param -Param2 $Param2 +} catch { + Write-Host ("Exception occurred when calling Test-PSJsonFormData: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### 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) + + +# **Test-PSQueryParameterCollectionFormat** +> void Test-PSQueryParameterCollectionFormat
+>         [-Pipe]
+>         [-Ioutil]
+>         [-Http]
+>         [-Url]
+>         [-Context]
+ + + +To test the collection format in query parameters + +### Example +```powershell +$Pipe = "MyPipe" # String[] | +$Ioutil = "MyIoutil" # String[] | +$Http = "MyHttp" # String[] | +$Url = "MyUrl" # String[] | +$Context = "MyContext" # String[] | + +try { + $Result = Test-PSQueryParameterCollectionFormat -Pipe $Pipe -Ioutil $Ioutil -Http $Http -Url $Url -Context $Context +} catch { + Write-Host ("Exception occurred when calling Test-PSQueryParameterCollectionFormat: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Pipe** | [**String[]**](String.md)| | + **Ioutil** | [**String[]**](String.md)| | + **Http** | [**String[]**](String.md)| | + **Url** | [**String[]**](String.md)| | + **Context** | [**String[]**](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/client/petstore/powershell/docs/PSFakeClassnameTags123Api.md b/samples/client/petstore/powershell/docs/PSFakeClassnameTags123Api.md new file mode 100644 index 000000000000..5b775f25298f --- /dev/null +++ b/samples/client/petstore/powershell/docs/PSFakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# PSPetstore.PSPetstore/Api.PSFakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Test-PSClassname**](PSFakeClassnameTags123Api.md#Test-PSClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **Test-PSClassname** +> Client Test-PSClassname
+>         [-Client]
+ +To test class name in snake case + +To test class name in snake case + +### Example +```powershell +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration +# Configure API key authorization: api_key_query +$Configuration.ApiKey.api_key_query = "YOUR_API_KEY" +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +#$Configuration.ApiKeyPrefix.api_key_query = "Bearer" + +$Client = Initialize-Client -Client "MyClient" # Client | client model + +# To test class name in snake case +try { + $Result = Test-PSClassname -Client $Client +} catch { + Write-Host ("Exception occurred when calling Test-PSClassname: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **Client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) (PSCustomObject) + +### 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/client/petstore/powershell/docs/PSPetApi.md b/samples/client/petstore/powershell/docs/PSPetApi.md index c24d5de326c5..aa5a2db7167d 100644 --- a/samples/client/petstore/powershell/docs/PSPetApi.md +++ b/samples/client/petstore/powershell/docs/PSPetApi.md @@ -12,11 +12,12 @@ Method | HTTP request | Description [**Update-PSPet**](PSPetApi.md#Update-PSPet) | **PUT** /pet | Update an existing pet [**Update-PSPetWithForm**](PSPetApi.md#Update-PSPetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**Invoke-PSUploadFile**](PSPetApi.md#Invoke-PSUploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**Invoke-PSUploadFileWithRequiredFile**](PSPetApi.md#Invoke-PSUploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **Add-PSPet** -> Pet Add-PSPet
+> void Add-PSPet
>         [-Pet]
Add a new pet to the store @@ -27,6 +28,18 @@ Add a new pet to the store ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc $Configuration = Get-Configuration +# Configure HTTP basic authorization: http_signature_test +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" +# Configure HttpSignature for authorization :http_signature_test +$httpSigningParams = @{ + KeyId = "xxxxxx1776876789ac747/xxxxxxx564612d31a62c01/xxxxxxxa1d7564612d31a66ee8" + KeyFilePath = "C:\SecretKey.txt" + HttpSigningHeader = @("(request-target)","Host","Date","Digest") + HashAlgorithm = "sha256" +} +Set-ConfigurationHttpSigning $httpSigningParams + # Configure OAuth2 access token for authorization: petstore_auth $Configuration.AccessToken = "YOUR_ACCESS_TOKEN" @@ -51,16 +64,16 @@ Name | Type | Description | Notes ### Return type -[**Pet**](Pet.md) (PSCustomObject) +void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, 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) @@ -128,6 +141,18 @@ Multiple status values can be provided with comma separated strings ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc $Configuration = Get-Configuration +# Configure HTTP basic authorization: http_signature_test +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" +# Configure HttpSignature for authorization :http_signature_test +$httpSigningParams = @{ + KeyId = "xxxxxx1776876789ac747/xxxxxxx564612d31a62c01/xxxxxxxa1d7564612d31a66ee8" + KeyFilePath = "C:\SecretKey.txt" + HttpSigningHeader = @("(request-target)","Host","Date","Digest") + HashAlgorithm = "sha256" +} +Set-ConfigurationHttpSigning $httpSigningParams + # Configure OAuth2 access token for authorization: petstore_auth $Configuration.AccessToken = "YOUR_ACCESS_TOKEN" @@ -154,7 +179,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -176,6 +201,18 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc $Configuration = Get-Configuration +# Configure HTTP basic authorization: http_signature_test +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" +# Configure HttpSignature for authorization :http_signature_test +$httpSigningParams = @{ + KeyId = "xxxxxx1776876789ac747/xxxxxxx564612d31a62c01/xxxxxxxa1d7564612d31a66ee8" + KeyFilePath = "C:\SecretKey.txt" + HttpSigningHeader = @("(request-target)","Host","Date","Digest") + HashAlgorithm = "sha256" +} +Set-ConfigurationHttpSigning $httpSigningParams + # Configure OAuth2 access token for authorization: petstore_auth $Configuration.AccessToken = "YOUR_ACCESS_TOKEN" @@ -202,7 +239,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -263,7 +300,7 @@ Name | Type | Description | Notes # **Update-PSPet** -> Pet Update-PSPet
+> void Update-PSPet
>         [-Pet]
Update an existing pet @@ -274,6 +311,18 @@ Update an existing pet ```powershell # general setting of the PowerShell module, e.g. base URL, authentication, etc $Configuration = Get-Configuration +# Configure HTTP basic authorization: http_signature_test +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" +# Configure HttpSignature for authorization :http_signature_test +$httpSigningParams = @{ + KeyId = "xxxxxx1776876789ac747/xxxxxxx564612d31a62c01/xxxxxxxa1d7564612d31a66ee8" + KeyFilePath = "C:\SecretKey.txt" + HttpSigningHeader = @("(request-target)","Host","Date","Digest") + HashAlgorithm = "sha256" +} +Set-ConfigurationHttpSigning $httpSigningParams + # Configure OAuth2 access token for authorization: petstore_auth $Configuration.AccessToken = "YOUR_ACCESS_TOKEN" @@ -298,16 +347,16 @@ Name | Type | Description | Notes ### Return type -[**Pet**](Pet.md) (PSCustomObject) +void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, 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) @@ -419,3 +468,57 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **Invoke-PSUploadFileWithRequiredFile** +> ApiResponse Invoke-PSUploadFileWithRequiredFile
+>         [-PetId]
+>         [-RequiredFile]
+>         [-AdditionalMetadata]
+ +uploads an image (required) + + + +### Example +```powershell +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration +# Configure OAuth2 access token for authorization: petstore_auth +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" + +$PetId = 789 # Int64 | ID of pet to update +$RequiredFile = # System.IO.FileInfo | file to upload +$AdditionalMetadata = "MyAdditionalMetadata" # String | Additional data to pass to server (optional) + +# uploads an image (required) +try { + $Result = Invoke-PSUploadFileWithRequiredFile -PetId $PetId -RequiredFile $RequiredFile -AdditionalMetadata $AdditionalMetadata +} catch { + Write-Host ("Exception occurred when calling Invoke-PSUploadFileWithRequiredFile: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) + Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **PetId** | **Int64**| ID of pet to update | + **RequiredFile** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | + **AdditionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) (PSCustomObject) + +### 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/client/petstore/powershell/docs/PSStoreApi.md b/samples/client/petstore/powershell/docs/PSStoreApi.md index 2bcc27fd7491..6f7dac409bdd 100644 --- a/samples/client/petstore/powershell/docs/PSStoreApi.md +++ b/samples/client/petstore/powershell/docs/PSStoreApi.md @@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**Remove-PSOrder**](PSStoreApi.md#Remove-PSOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**Remove-PSOrder**](PSStoreApi.md#Remove-PSOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**Get-PSInventory**](PSStoreApi.md#Get-PSInventory) | **GET** /store/inventory | Returns pet inventories by status -[**Get-PSOrderById**](PSStoreApi.md#Get-PSOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**Get-PSOrderById**](PSStoreApi.md#Get-PSOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**Invoke-PSPlaceOrder**](PSStoreApi.md#Invoke-PSPlaceOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/powershell/docs/PSUserApi.md b/samples/client/petstore/powershell/docs/PSUserApi.md index ba7c2b092869..567ad5098511 100644 --- a/samples/client/petstore/powershell/docs/PSUserApi.md +++ b/samples/client/petstore/powershell/docs/PSUserApi.md @@ -25,14 +25,7 @@ This can only be done by the logged in user. ### Example ```powershell -# general setting of the PowerShell module, e.g. base URL, authentication, etc -$Configuration = Get-Configuration -# Configure API key authorization: auth_cookie -$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - -$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 # User | Created user object +$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 -ObjectWithNoDeclaredProps -ObjectWithNoDeclaredPropsNullable -AnyTypeProp -AnyTypePropNullable # User | Created user object # Create user try { @@ -55,7 +48,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -75,14 +68,7 @@ Creates list of users with given input array ### Example ```powershell -# general setting of the PowerShell module, e.g. base URL, authentication, etc -$Configuration = Get-Configuration -# Configure API key authorization: auth_cookie -$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - -$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 # User[] | List of user object +$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 -ObjectWithNoDeclaredProps -ObjectWithNoDeclaredPropsNullable -AnyTypeProp -AnyTypePropNullable # User[] | List of user object # Creates list of users with given input array try { @@ -105,7 +91,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -125,14 +111,7 @@ Creates list of users with given input array ### Example ```powershell -# general setting of the PowerShell module, e.g. base URL, authentication, etc -$Configuration = Get-Configuration -# Configure API key authorization: auth_cookie -$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - -$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 # User[] | List of user object +$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 -ObjectWithNoDeclaredProps -ObjectWithNoDeclaredPropsNullable -AnyTypeProp -AnyTypePropNullable # User[] | List of user object # Creates list of users with given input array try { @@ -155,7 +134,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -175,13 +154,6 @@ This can only be done by the logged in user. ### Example ```powershell -# general setting of the PowerShell module, e.g. base URL, authentication, etc -$Configuration = Get-Configuration -# Configure API key authorization: auth_cookie -$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - $Username = "MyUsername" # String | The name that needs to be deleted # Delete user @@ -205,7 +177,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -313,13 +285,6 @@ Logs out current logged in user session ### Example ```powershell -# general setting of the PowerShell module, e.g. base URL, authentication, etc -$Configuration = Get-Configuration -# Configure API key authorization: auth_cookie -$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - # Logs out current logged in user session try { @@ -339,7 +304,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -360,15 +325,8 @@ This can only be done by the logged in user. ### Example ```powershell -# general setting of the PowerShell module, e.g. base URL, authentication, etc -$Configuration = Get-Configuration -# Configure API key authorization: auth_cookie -$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - $Username = "MyUsername" # String | name that need to be deleted -$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 # User | Updated user object +$User = Initialize-User -Id 0 -Username "MyUsername" -FirstName "MyFirstName" -LastName "MyLastName" -Email "MyEmail" -Password "MyPassword" -Phone "MyPhone" -UserStatus 0 -ObjectWithNoDeclaredProps -ObjectWithNoDeclaredPropsNullable -AnyTypeProp -AnyTypePropNullable # User | Updated user object # Updated user try { @@ -392,7 +350,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers diff --git a/samples/client/petstore/powershell/docs/ParentPet.md b/samples/client/petstore/powershell/docs/ParentPet.md new file mode 100644 index 000000000000..f058cc20b7fb --- /dev/null +++ b/samples/client/petstore/powershell/docs/ParentPet.md @@ -0,0 +1,21 @@ +# ParentPet +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$ParentPet = Initialize-PSPetstoreParentPet -PetType null +``` + +- Convert the resource to JSON +```powershell +$ParentPet | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/PetWithRequiredTags.md b/samples/client/petstore/powershell/docs/PetWithRequiredTags.md new file mode 100644 index 000000000000..b85716daa4c5 --- /dev/null +++ b/samples/client/petstore/powershell/docs/PetWithRequiredTags.md @@ -0,0 +1,31 @@ +# PetWithRequiredTags +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **Int64** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **String** | | +**PhotoUrls** | **String[]** | | +**Tags** | [**Tag[]**](Tag.md) | | +**Status** | **String** | pet status in the store | [optional] + +## Examples + +- Prepare the resource +```powershell +$PetWithRequiredTags = Initialize-PSPetstorePetWithRequiredTags -Id null ` + -Category null ` + -Name doggie ` + -PhotoUrls null ` + -Tags null ` + -Status null +``` + +- Convert the resource to JSON +```powershell +$PetWithRequiredTags | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Pig.md b/samples/client/petstore/powershell/docs/Pig.md new file mode 100644 index 000000000000..705259e7501a --- /dev/null +++ b/samples/client/petstore/powershell/docs/Pig.md @@ -0,0 +1,21 @@ +# Pig +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$Pig = Initialize-PSPetstorePig -ClassName null +``` + +- Convert the resource to JSON +```powershell +$Pig | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Quadrilateral.md b/samples/client/petstore/powershell/docs/Quadrilateral.md new file mode 100644 index 000000000000..7df7e807dc3d --- /dev/null +++ b/samples/client/petstore/powershell/docs/Quadrilateral.md @@ -0,0 +1,23 @@ +# Quadrilateral +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$Quadrilateral = Initialize-PSPetstoreQuadrilateral -ShapeType null ` + -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$Quadrilateral | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/QuadrilateralInterface.md b/samples/client/petstore/powershell/docs/QuadrilateralInterface.md new file mode 100644 index 000000000000..c5cd0a220854 --- /dev/null +++ b/samples/client/petstore/powershell/docs/QuadrilateralInterface.md @@ -0,0 +1,21 @@ +# QuadrilateralInterface +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$QuadrilateralInterface = Initialize-PSPetstoreQuadrilateralInterface -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$QuadrilateralInterface | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ReadOnlyFirst.md b/samples/client/petstore/powershell/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..d31235396d3f --- /dev/null +++ b/samples/client/petstore/powershell/docs/ReadOnlyFirst.md @@ -0,0 +1,23 @@ +# ReadOnlyFirst +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **String** | | [optional] [readonly] +**Baz** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ReadOnlyFirst = Initialize-PSPetstoreReadOnlyFirst -Bar null ` + -Baz null +``` + +- Convert the resource to JSON +```powershell +$ReadOnlyFirst | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Return.md b/samples/client/petstore/powershell/docs/Return.md new file mode 100644 index 000000000000..461d10547c8b --- /dev/null +++ b/samples/client/petstore/powershell/docs/Return.md @@ -0,0 +1,21 @@ +# ModelReturn +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarReturn** | **Int32** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$ModelReturn = Initialize-PSPetstoreModelReturn -VarReturn null +``` + +- Convert the resource to JSON +```powershell +$ModelReturn | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ScaleneTriangle.md b/samples/client/petstore/powershell/docs/ScaleneTriangle.md new file mode 100644 index 000000000000..df0a826f4682 --- /dev/null +++ b/samples/client/petstore/powershell/docs/ScaleneTriangle.md @@ -0,0 +1,23 @@ +# ScaleneTriangle +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$ScaleneTriangle = Initialize-PSPetstoreScaleneTriangle -ShapeType null ` + -TriangleType null +``` + +- Convert the resource to JSON +```powershell +$ScaleneTriangle | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Shape.md b/samples/client/petstore/powershell/docs/Shape.md new file mode 100644 index 000000000000..42b008286a5d --- /dev/null +++ b/samples/client/petstore/powershell/docs/Shape.md @@ -0,0 +1,25 @@ +# Shape +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$Shape = Initialize-PSPetstoreShape -ShapeType null ` + -TriangleType null ` + -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$Shape | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ShapeInterface.md b/samples/client/petstore/powershell/docs/ShapeInterface.md new file mode 100644 index 000000000000..cba56744b3db --- /dev/null +++ b/samples/client/petstore/powershell/docs/ShapeInterface.md @@ -0,0 +1,21 @@ +# ShapeInterface +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$ShapeInterface = Initialize-PSPetstoreShapeInterface -ShapeType null +``` + +- Convert the resource to JSON +```powershell +$ShapeInterface | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/ShapeOrNull.md b/samples/client/petstore/powershell/docs/ShapeOrNull.md new file mode 100644 index 000000000000..e237db3c1155 --- /dev/null +++ b/samples/client/petstore/powershell/docs/ShapeOrNull.md @@ -0,0 +1,25 @@ +# ShapeOrNull +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$ShapeOrNull = Initialize-PSPetstoreShapeOrNull -ShapeType null ` + -TriangleType null ` + -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$ShapeOrNull | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/SimpleQuadrilateral.md b/samples/client/petstore/powershell/docs/SimpleQuadrilateral.md new file mode 100644 index 000000000000..df5bdea7f0cd --- /dev/null +++ b/samples/client/petstore/powershell/docs/SimpleQuadrilateral.md @@ -0,0 +1,23 @@ +# SimpleQuadrilateral +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**QuadrilateralType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$SimpleQuadrilateral = Initialize-PSPetstoreSimpleQuadrilateral -ShapeType null ` + -QuadrilateralType null +``` + +- Convert the resource to JSON +```powershell +$SimpleQuadrilateral | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/SpecialModelName.md b/samples/client/petstore/powershell/docs/SpecialModelName.md new file mode 100644 index 000000000000..02562eeabbbc --- /dev/null +++ b/samples/client/petstore/powershell/docs/SpecialModelName.md @@ -0,0 +1,23 @@ +# SpecialModelName +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **Int64** | | [optional] +**SpecialModelName** | **String** | | [optional] + +## Examples + +- Prepare the resource +```powershell +$SpecialModelName = Initialize-PSPetstoreSpecialModelName -SpecialPropertyName null ` + -SpecialModelName null +``` + +- Convert the resource to JSON +```powershell +$SpecialModelName | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Triangle.md b/samples/client/petstore/powershell/docs/Triangle.md new file mode 100644 index 000000000000..cfdebe89c17f --- /dev/null +++ b/samples/client/petstore/powershell/docs/Triangle.md @@ -0,0 +1,23 @@ +# Triangle +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **String** | | +**TriangleType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$Triangle = Initialize-PSPetstoreTriangle -ShapeType null ` + -TriangleType null +``` + +- Convert the resource to JSON +```powershell +$Triangle | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/TriangleInterface.md b/samples/client/petstore/powershell/docs/TriangleInterface.md new file mode 100644 index 000000000000..d984318cf6db --- /dev/null +++ b/samples/client/petstore/powershell/docs/TriangleInterface.md @@ -0,0 +1,21 @@ +# TriangleInterface +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$TriangleInterface = Initialize-PSPetstoreTriangleInterface -TriangleType null +``` + +- Convert the resource to JSON +```powershell +$TriangleInterface | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/User.md b/samples/client/petstore/powershell/docs/User.md index 42b31bc9f007..8c6319df5d21 100644 --- a/samples/client/petstore/powershell/docs/User.md +++ b/samples/client/petstore/powershell/docs/User.md @@ -11,6 +11,10 @@ Name | Type | Description | Notes **Password** | **String** | | [optional] **Phone** | **String** | | [optional] **UserStatus** | **Int32** | User Status | [optional] +**ObjectWithNoDeclaredProps** | [**SystemCollectionsHashtable**](.md) | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | [**SystemCollectionsHashtable**](.md) | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**AnyTypeProp** | [**AnyType**](.md) | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | [**AnyType**](.md) | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] ## Examples @@ -23,7 +27,11 @@ $User = Initialize-PSPetstoreUser -Id null ` -Email null ` -Password null ` -Phone null ` - -UserStatus null + -UserStatus null ` + -ObjectWithNoDeclaredProps null ` + -ObjectWithNoDeclaredPropsNullable null ` + -AnyTypeProp null ` + -AnyTypePropNullable null ``` - Convert the resource to JSON diff --git a/samples/client/petstore/powershell/docs/Whale.md b/samples/client/petstore/powershell/docs/Whale.md new file mode 100644 index 000000000000..e671dcc10c17 --- /dev/null +++ b/samples/client/petstore/powershell/docs/Whale.md @@ -0,0 +1,25 @@ +# Whale +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **Boolean** | | [optional] +**HasTeeth** | **Boolean** | | [optional] +**ClassName** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$Whale = Initialize-PSPetstoreWhale -HasBaleen null ` + -HasTeeth null ` + -ClassName null +``` + +- Convert the resource to JSON +```powershell +$Whale | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/docs/Zebra.md b/samples/client/petstore/powershell/docs/Zebra.md new file mode 100644 index 000000000000..3c52ed299f4c --- /dev/null +++ b/samples/client/petstore/powershell/docs/Zebra.md @@ -0,0 +1,23 @@ +# Zebra +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **String** | | [optional] +**ClassName** | **String** | | + +## Examples + +- Prepare the resource +```powershell +$Zebra = Initialize-PSPetstoreZebra -Type null ` + -ClassName null +``` + +- Convert the resource to JSON +```powershell +$Zebra | ConvertTo-JSON +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSAnotherFakeApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSAnotherFakeApi.ps1 new file mode 100644 index 000000000000..bea25f35712c --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSAnotherFakeApi.ps1 @@ -0,0 +1,85 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +To test special tags + +.DESCRIPTION + +No description available. + +.PARAMETER Client +client model + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +Client +#> +function Invoke-PS123TestSpecialTags { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${Client}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PS123TestSpecialTags' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/another-fake/dummy' + + if (!$Client) { + throw "Error! The required parameter `Client` missing when calling 123TestSpecialTags." + } + + $LocalVarBodyParameter = $Client | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'PATCH' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "Client" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSDefaultApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSDefaultApi.ps1 new file mode 100644 index 000000000000..9153f38bcc30 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSDefaultApi.ps1 @@ -0,0 +1,70 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +InlineResponseDefault +#> +function Invoke-PSFooGet { + [CmdletBinding()] + Param ( + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSFooGet' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + $LocalVarUri = '/foo' + + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "InlineResponseDefault" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 new file mode 100644 index 000000000000..7d2c4596574b --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeApi.ps1 @@ -0,0 +1,1436 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +Health check endpoint + +.DESCRIPTION + +No description available. + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +HealthCheckResult +#> +function Invoke-PSFakeHealthGet { + [CmdletBinding()] + Param ( + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSFakeHealthGet' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + $LocalVarUri = '/fake/health' + + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "HealthCheckResult" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Body +Input boolean as post body + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +Boolean +#> +function Invoke-PSFakeOuterBooleanSerialize { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Boolean]] + ${Body}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSFakeOuterBooleanSerialize' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('*/*') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/outer/boolean' + + $LocalVarBodyParameter = $Body | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "Boolean" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER OuterComposite +Input composite as post body + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +OuterComposite +#> +function Invoke-PSFakeOuterCompositeSerialize { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${OuterComposite}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSFakeOuterCompositeSerialize' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('*/*') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/outer/composite' + + $LocalVarBodyParameter = $OuterComposite | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "OuterComposite" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Body +Input number as post body + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +Decimal +#> +function Invoke-PSFakeOuterNumberSerialize { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Decimal]] + ${Body}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSFakeOuterNumberSerialize' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('*/*') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/outer/number' + + $LocalVarBodyParameter = $Body | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "Decimal" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Body +Input string as post body + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +String +#> +function Invoke-PSFakeOuterStringSerialize { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${Body}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSFakeOuterStringSerialize' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('*/*') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/outer/string' + + $LocalVarBodyParameter = $Body | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "String" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +Array of Enums + +.DESCRIPTION + +No description available. + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +OuterEnum[] +#> +function Get-PSArrayOfEnums { + [CmdletBinding()] + Param ( + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Get-PSArrayOfEnums' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + $LocalVarUri = '/fake/array-of-enums' + + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "OuterEnum[]" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER FileSchemaTestClass +No description available. + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSBodyWithFileSchema { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${FileSchemaTestClass}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSBodyWithFileSchema' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/body-with-file-schema' + + if (!$FileSchemaTestClass) { + throw "Error! The required parameter `FileSchemaTestClass` missing when calling testBodyWithFileSchema." + } + + $LocalVarBodyParameter = $FileSchemaTestClass | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'PUT' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Query +No description available. + +.PARAMETER User +No description available. + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSBodyWithQueryParams { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${Query}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${User}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSBodyWithQueryParams' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/body-with-query-params' + + if (!$Query) { + throw "Error! The required parameter `Query` missing when calling testBodyWithQueryParams." + } + $LocalVarQueryParameters['query'] = $Query + + if (!$User) { + throw "Error! The required parameter `User` missing when calling testBodyWithQueryParams." + } + + $LocalVarBodyParameter = $User | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'PUT' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +To test ""client"" model + +.DESCRIPTION + +No description available. + +.PARAMETER Client +client model + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +Client +#> +function Test-PSClientModel { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${Client}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSClientModel' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake' + + if (!$Client) { + throw "Error! The required parameter `Client` missing when calling testClientModel." + } + + $LocalVarBodyParameter = $Client | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'PATCH' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "Client" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +.DESCRIPTION + +No description available. + +.PARAMETER Number +None + +.PARAMETER Double +None + +.PARAMETER PatternWithoutDelimiter +None + +.PARAMETER Byte +None + +.PARAMETER Integer +None + +.PARAMETER Int32 +None + +.PARAMETER Int64 +None + +.PARAMETER Float +None + +.PARAMETER String +None + +.PARAMETER Binary +None + +.PARAMETER Date +None + +.PARAMETER DateTime +None + +.PARAMETER Password +None + +.PARAMETER Callback +None + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSEndpointParameters { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Decimal] + ${Number}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Double] + ${Double}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${PatternWithoutDelimiter}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [SystemByte] + ${Byte}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Int32]] + ${Integer}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Int32]] + ${Int32}, + [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Int64]] + ${Int64}, + [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Double]] + ${Float}, + [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${String}, + [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.IO.FileInfo] + ${Binary}, + [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[System.DateTime]] + ${Date}, + [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[System.DateTime]] + ${DateTime}, + [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${Password}, + [Parameter(Position = 13, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${Callback}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSEndpointParameters' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/x-www-form-urlencoded') + + $LocalVarUri = '/fake' + + if ($Integer) { + $LocalVarFormParameters['integer'] = $Integer + } + + if ($Int32) { + $LocalVarFormParameters['int32'] = $Int32 + } + + if ($Int64) { + $LocalVarFormParameters['int64'] = $Int64 + } + + if (!$Number) { + throw "Error! The required parameter `Number` missing when calling testEndpointParameters." + } + $LocalVarFormParameters['number'] = $Number + + if ($Float) { + $LocalVarFormParameters['float'] = $Float + } + + if (!$Double) { + throw "Error! The required parameter `Double` missing when calling testEndpointParameters." + } + $LocalVarFormParameters['double'] = $Double + + if ($String) { + $LocalVarFormParameters['string'] = $String + } + + if (!$PatternWithoutDelimiter) { + throw "Error! The required parameter `PatternWithoutDelimiter` missing when calling testEndpointParameters." + } + $LocalVarFormParameters['pattern_without_delimiter'] = $PatternWithoutDelimiter + + if (!$Byte) { + throw "Error! The required parameter `Byte` missing when calling testEndpointParameters." + } + $LocalVarFormParameters['byte'] = $Byte + + if ($Binary) { + $LocalVarFormParameters['binary'] = $Binary + } + + if ($Date) { + $LocalVarFormParameters['date'] = $Date + } + + if ($DateTime) { + $LocalVarFormParameters['dateTime'] = $DateTime + } + + if ($Password) { + $LocalVarFormParameters['password'] = $Password + } + + if ($Callback) { + $LocalVarFormParameters['callback'] = $Callback + } + + if ($Configuration["Username"] -and $Configuration["Password"]) { + $LocalVarBytes = [System.Text.Encoding]::UTF8.GetBytes($Configuration["Username"] + ":" + $Configuration["Password"]) + $LocalVarBase64Text =[Convert]::ToBase64String($LocalVarBytes) + $LocalVarHeaderParameters['Authorization'] = "Basic " + $LocalVarBase64Text + Write-Verbose ("Using HTTP basic authentication in {0}" -f $MyInvocation.MyCommand) + } + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +To test enum parameters + +.DESCRIPTION + +No description available. + +.PARAMETER EnumHeaderStringArray +Header parameter enum test (string array) + +.PARAMETER EnumHeaderString +Header parameter enum test (string) + +.PARAMETER EnumQueryStringArray +Query parameter enum test (string array) + +.PARAMETER EnumQueryString +Query parameter enum test (string) + +.PARAMETER EnumQueryInteger +Query parameter enum test (double) + +.PARAMETER EnumQueryDouble +Query parameter enum test (double) + +.PARAMETER EnumFormStringArray +Form parameter enum test (string array) + +.PARAMETER EnumFormString +Form parameter enum test (string) + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSEnumParameters { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet(">", "$")] + [String[]] + ${EnumHeaderStringArray}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet("_abc", "-efg", "(xyz)")] + [String] + ${EnumHeaderString}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet(">", "$")] + [String[]] + ${EnumQueryStringArray}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet("_abc", "-efg", "(xyz)")] + [String] + ${EnumQueryString}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet("1", "-2")] + [System.Nullable[Int32]] + ${EnumQueryInteger}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet("1.1", "-1.2")] + [System.Nullable[Double]] + ${EnumQueryDouble}, + [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet(">", "$")] + [String[]] + ${EnumFormStringArray}, + [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [ValidateSet("_abc", "-efg", "(xyz)")] + [String] + ${EnumFormString}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSEnumParameters' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/x-www-form-urlencoded') + + $LocalVarUri = '/fake' + + if ($EnumHeaderStringArray) { + $LocalVarHeaderParameters['enum_header_string_array'] = $EnumHeaderStringArray + } + + if ($EnumHeaderString) { + $LocalVarHeaderParameters['enum_header_string'] = $EnumHeaderString + } + + if ($EnumQueryStringArray) { + $LocalVarQueryParameters['enum_query_string_array'] = $EnumQueryStringArray + } + + if ($EnumQueryString) { + $LocalVarQueryParameters['enum_query_string'] = $EnumQueryString + } + + if ($EnumQueryInteger) { + $LocalVarQueryParameters['enum_query_integer'] = $EnumQueryInteger + } + + if ($EnumQueryDouble) { + $LocalVarQueryParameters['enum_query_double'] = $EnumQueryDouble + } + + if ($EnumFormStringArray) { + $LocalVarFormParameters['enum_form_string_array'] = $EnumFormStringArray + } + + if ($EnumFormString) { + $LocalVarFormParameters['enum_form_string'] = $EnumFormString + } + + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +Fake endpoint to test group parameters (optional) + +.DESCRIPTION + +No description available. + +.PARAMETER RequiredStringGroup +Required String in group parameters + +.PARAMETER RequiredBooleanGroup +Required Boolean in group parameters + +.PARAMETER RequiredInt64Group +Required Integer in group parameters + +.PARAMETER StringGroup +String in group parameters + +.PARAMETER BooleanGroup +Boolean in group parameters + +.PARAMETER Int64Group +Integer in group parameters + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSGroupParameters { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Int32] + ${RequiredStringGroup}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Boolean] + ${RequiredBooleanGroup}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Int64] + ${RequiredInt64Group}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Int32]] + ${StringGroup}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Boolean]] + ${BooleanGroup}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Nullable[Int64]] + ${Int64Group}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSGroupParameters' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + $LocalVarUri = '/fake' + + if (!$RequiredBooleanGroup) { + throw "Error! The required parameter `RequiredBooleanGroup` missing when calling testGroupParameters." + } + $LocalVarHeaderParameters['required_boolean_group'] = $RequiredBooleanGroup + + if ($BooleanGroup) { + $LocalVarHeaderParameters['boolean_group'] = $BooleanGroup + } + + if (!$RequiredStringGroup) { + throw "Error! The required parameter `RequiredStringGroup` missing when calling testGroupParameters." + } + $LocalVarQueryParameters['required_string_group'] = $RequiredStringGroup + + if (!$RequiredInt64Group) { + throw "Error! The required parameter `RequiredInt64Group` missing when calling testGroupParameters." + } + $LocalVarQueryParameters['required_int64_group'] = $RequiredInt64Group + + if ($StringGroup) { + $LocalVarQueryParameters['string_group'] = $StringGroup + } + + if ($Int64Group) { + $LocalVarQueryParameters['int64_group'] = $Int64Group + } + + if ($Configuration["AccessToken"]) { + $LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"] + Write-Verbose ("Using Bearer authentication in {0}" -f $MyInvocation.MyCommand) + } + + $LocalVarResult = Invoke-PSApiClient -Method 'DELETE' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +test inline additionalProperties + +.DESCRIPTION + +No description available. + +.PARAMETER RequestBody +request body + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSInlineAdditionalProperties { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.Collections.Hashtable] + ${RequestBody}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSInlineAdditionalProperties' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake/inline-additionalProperties' + + if (!$RequestBody) { + throw "Error! The required parameter `RequestBody` missing when calling testInlineAdditionalProperties." + } + + $LocalVarBodyParameter = $RequestBody | ConvertTo-Json -Depth 100 + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +test json serialization of form data + +.DESCRIPTION + +No description available. + +.PARAMETER Param +field1 + +.PARAMETER Param2 +field2 + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSJsonFormData { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${Param}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${Param2}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSJsonFormData' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/x-www-form-urlencoded') + + $LocalVarUri = '/fake/jsonFormData' + + if (!$Param) { + throw "Error! The required parameter `Param` missing when calling testJsonFormData." + } + $LocalVarFormParameters['param'] = $Param + + if (!$Param2) { + throw "Error! The required parameter `Param2` missing when calling testJsonFormData." + } + $LocalVarFormParameters['param2'] = $Param2 + + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Pipe +No description available. + +.PARAMETER Ioutil +No description available. + +.PARAMETER Http +No description available. + +.PARAMETER Url +No description available. + +.PARAMETER Context +No description available. + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +None +#> +function Test-PSQueryParameterCollectionFormat { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String[]] + ${Pipe}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String[]] + ${Ioutil}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String[]] + ${Http}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String[]] + ${Url}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String[]] + ${Context}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSQueryParameterCollectionFormat' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + $LocalVarUri = '/fake/test-query-parameters' + + if (!$Pipe) { + throw "Error! The required parameter `Pipe` missing when calling testQueryParameterCollectionFormat." + } + $LocalVarQueryParameters['pipe'] = $Pipe + + if (!$Ioutil) { + throw "Error! The required parameter `Ioutil` missing when calling testQueryParameterCollectionFormat." + } + $LocalVarQueryParameters['ioutil'] = $Ioutil + + if (!$Http) { + throw "Error! The required parameter `Http` missing when calling testQueryParameterCollectionFormat." + } + $LocalVarQueryParameters['http'] = $Http + + if (!$Url) { + throw "Error! The required parameter `Url` missing when calling testQueryParameterCollectionFormat." + } + $LocalVarQueryParameters['url'] = $Url + + if (!$Context) { + throw "Error! The required parameter `Context` missing when calling testQueryParameterCollectionFormat." + } + $LocalVarQueryParameters['context'] = $Context + + $LocalVarResult = Invoke-PSApiClient -Method 'PUT' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 new file mode 100644 index 000000000000..35f1186fcce4 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 @@ -0,0 +1,90 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +To test class name in snake case + +.DESCRIPTION + +No description available. + +.PARAMETER Client +client model + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +Client +#> +function Test-PSClassname { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [PSCustomObject] + ${Client}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Test-PSClassname' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('application/json') + + $LocalVarUri = '/fake_classname_test' + + if (!$Client) { + throw "Error! The required parameter `Client` missing when calling testClassname." + } + + $LocalVarBodyParameter = $Client | ConvertTo-Json -Depth 100 + + if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_query"]) { + $LocalVarQueryParameters['api_key_query'] = $Configuration["ApiKey"]["api_key_query"] + Write-Verbose ("Using API key `api_key_query` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand) + } + + $LocalVarResult = Invoke-PSApiClient -Method 'PATCH' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "Client" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 index b6c13d19fb19..3542112c914d 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -17,17 +17,13 @@ No description available. .PARAMETER Pet Pet object that needs to be added to the store -.PARAMETER ReturnType - -Select the return type (optional): application/xml, application/json - .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS -Pet +None #> function Add-PSPet { [CmdletBinding()] @@ -35,9 +31,6 @@ function Add-PSPet { [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Pet}, - [String] - [ValidateSet("application/xml", "application/json")] - $ReturnType, [Switch] $WithHttpInfo ) @@ -56,14 +49,6 @@ function Add-PSPet { $LocalVarBodyParameter = $null $Configuration = Get-PSConfiguration - # HTTP header 'Accept' (if needed) - $LocalVarAccepts = @('application/xml', 'application/json') - - if ($ReturnType) { - # use the return type (MIME) provided by the user - $LocalVarAccepts = @($ReturnType) - } - # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json', 'application/xml') @@ -76,6 +61,7 @@ function Add-PSPet { $LocalVarBodyParameter = $Pet | ConvertTo-Json -Depth 100 + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -85,7 +71,7 @@ function Add-PSPet { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet" ` + -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { @@ -245,6 +231,7 @@ function Find-PSPetsByStatus { $LocalVarQueryParameters['status'] = $Status + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -332,6 +319,7 @@ function Find-PSPetsByTags { $LocalVarQueryParameters['tags'] = $Tags + $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -454,17 +442,13 @@ No description available. .PARAMETER Pet Pet object that needs to be added to the store -.PARAMETER ReturnType - -Select the return type (optional): application/xml, application/json - .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS -Pet +None #> function Update-PSPet { [CmdletBinding()] @@ -472,9 +456,6 @@ function Update-PSPet { [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Pet}, - [String] - [ValidateSet("application/xml", "application/json")] - $ReturnType, [Switch] $WithHttpInfo ) @@ -493,14 +474,6 @@ function Update-PSPet { $LocalVarBodyParameter = $null $Configuration = Get-PSConfiguration - # HTTP header 'Accept' (if needed) - $LocalVarAccepts = @('application/xml', 'application/json') - - if ($ReturnType) { - # use the return type (MIME) provided by the user - $LocalVarAccepts = @($ReturnType) - } - # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json', 'application/xml') @@ -513,6 +486,7 @@ function Update-PSPet { $LocalVarBodyParameter = $Pet | ConvertTo-Json -Depth 100 + $LocalVarResult = Invoke-PSApiClient -Method 'PUT' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -522,7 +496,7 @@ function Update-PSPet { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet" ` + -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { @@ -724,3 +698,101 @@ function Invoke-PSUploadFile { } } +<# +.SYNOPSIS + +uploads an image (required) + +.DESCRIPTION + +No description available. + +.PARAMETER PetId +ID of pet to update + +.PARAMETER RequiredFile +file to upload + +.PARAMETER AdditionalMetadata +Additional data to pass to server + +.PARAMETER WithHttpInfo + +A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response + +.OUTPUTS + +ApiResponse +#> +function Invoke-PSUploadFileWithRequiredFile { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Int64] + ${PetId}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [System.IO.FileInfo] + ${RequiredFile}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [String] + ${AdditionalMetadata}, + [Switch] + $WithHttpInfo + ) + + Process { + 'Calling method: Invoke-PSUploadFileWithRequiredFile' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $LocalVarAccepts = @() + $LocalVarContentTypes = @() + $LocalVarQueryParameters = @{} + $LocalVarHeaderParameters = @{} + $LocalVarFormParameters = @{} + $LocalVarPathParameters = @{} + $LocalVarCookieParameters = @{} + $LocalVarBodyParameter = $null + + $Configuration = Get-PSConfiguration + # HTTP header 'Accept' (if needed) + $LocalVarAccepts = @('application/json') + + # HTTP header 'Content-Type' + $LocalVarContentTypes = @('multipart/form-data') + + $LocalVarUri = '/fake/{petId}/uploadImageWithRequiredFile' + if (!$PetId) { + throw "Error! The required parameter `PetId` missing when calling uploadFileWithRequiredFile." + } + $LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId)) + + if ($AdditionalMetadata) { + $LocalVarFormParameters['additionalMetadata'] = $AdditionalMetadata + } + + if (!$RequiredFile) { + throw "Error! The required parameter `RequiredFile` missing when calling uploadFileWithRequiredFile." + } + $LocalVarFormParameters['requiredFile'] = $RequiredFile + + + $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` + -Uri $LocalVarUri ` + -Accepts $LocalVarAccepts ` + -ContentTypes $LocalVarContentTypes ` + -Body $LocalVarBodyParameter ` + -HeaderParameters $LocalVarHeaderParameters ` + -QueryParameters $LocalVarQueryParameters ` + -FormParameters $LocalVarFormParameters ` + -CookieParameters $LocalVarCookieParameters ` + -ReturnType "ApiResponse" ` + -IsBodyNullable $false + + if ($WithHttpInfo.IsPresent) { + return $LocalVarResult + } else { + return $LocalVarResult["Response"] + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 index da64d177edd3..a0f88138a48d 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -49,11 +49,11 @@ function Remove-PSOrder { $LocalVarBodyParameter = $null $Configuration = Get-PSConfiguration - $LocalVarUri = '/store/order/{orderId}' + $LocalVarUri = '/store/order/{order_id}' if (!$OrderId) { throw "Error! The required parameter `OrderId` missing when calling deleteOrder." } - $LocalVarUri = $LocalVarUri.replace('{orderId}', [System.Web.HTTPUtility]::UrlEncode($OrderId)) + $LocalVarUri = $LocalVarUri.replace('{order_id}', [System.Web.HTTPUtility]::UrlEncode($OrderId)) $LocalVarResult = Invoke-PSApiClient -Method 'DELETE' ` -Uri $LocalVarUri ` @@ -202,11 +202,11 @@ function Get-PSOrderById { $LocalVarAccepts = @($ReturnType) } - $LocalVarUri = '/store/order/{orderId}' + $LocalVarUri = '/store/order/{order_id}' if (!$OrderId) { throw "Error! The required parameter `OrderId` missing when calling getOrderById." } - $LocalVarUri = $LocalVarUri.replace('{orderId}', [System.Web.HTTPUtility]::UrlEncode($OrderId)) + $LocalVarUri = $LocalVarUri.replace('{order_id}', [System.Web.HTTPUtility]::UrlEncode($OrderId)) $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` -Uri $LocalVarUri ` diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 index b1bf3241a100..6d3be8f1037e 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -60,11 +60,6 @@ function New-PSUser { $LocalVarBodyParameter = $User | ConvertTo-Json -Depth 100 - if ($Configuration["Cookie"]) { - $LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"] - Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand) - } - $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -140,11 +135,6 @@ function New-PSUsersWithArrayInput { $LocalVarBodyParameter = $User | ConvertTo-Json -Depth 100 - if ($Configuration["Cookie"]) { - $LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"] - Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand) - } - $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -220,11 +210,6 @@ function New-PSUsersWithListInput { $LocalVarBodyParameter = $User | ConvertTo-Json -Depth 100 - if ($Configuration["Cookie"]) { - $LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"] - Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand) - } - $LocalVarResult = Invoke-PSApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -295,11 +280,6 @@ function Remove-PSUser { } $LocalVarUri = $LocalVarUri.replace('{username}', [System.Web.HTTPUtility]::UrlEncode($Username)) - if ($Configuration["Cookie"]) { - $LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"] - Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand) - } - $LocalVarResult = Invoke-PSApiClient -Method 'DELETE' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -542,11 +522,6 @@ function Invoke-PSLogoutUser { $Configuration = Get-PSConfiguration $LocalVarUri = '/user/logout' - if ($Configuration["Cookie"]) { - $LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"] - Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand) - } - $LocalVarResult = Invoke-PSApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` @@ -632,11 +607,6 @@ function Update-PSUser { $LocalVarBodyParameter = $User | ConvertTo-Json -Depth 100 - if ($Configuration["Cookie"]) { - $LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"] - Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand) - } - $LocalVarResult = Invoke-PSApiClient -Method 'PUT' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` diff --git a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 index d24a405660da..d655e6f997b2 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -347,6 +347,10 @@ function Get-PSHostSetting { ) } } + }, + @{ + "Url" = "https://127.0.0.1/no_variable"; + "Description" = "The local server without variables"; } ) diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/AdditionalPropertiesClass.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/AdditionalPropertiesClass.ps1 new file mode 100644 index 000000000000..517281366f80 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/AdditionalPropertiesClass.ps1 @@ -0,0 +1,188 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER MapProperty +No description available. +.PARAMETER MapOfMapProperty +No description available. +.PARAMETER Anytype1 +No description available. +.PARAMETER MapWithUndeclaredPropertiesAnytype1 +No description available. +.PARAMETER MapWithUndeclaredPropertiesAnytype2 +No description available. +.PARAMETER MapWithUndeclaredPropertiesAnytype3 +No description available. +.PARAMETER EmptyMap +an object with no declared properties and no undeclared properties, hence it's an empty map. +.PARAMETER MapWithUndeclaredPropertiesString +No description available. +.OUTPUTS + +AdditionalPropertiesClass +#> + +function Initialize-PSAdditionalPropertiesClass { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${MapProperty}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${MapOfMapProperty}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${Anytype1}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${MapWithUndeclaredPropertiesAnytype1}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${MapWithUndeclaredPropertiesAnytype2}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${MapWithUndeclaredPropertiesAnytype3}, + [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${EmptyMap}, + [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${MapWithUndeclaredPropertiesString} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSAdditionalPropertiesClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "map_property" = ${MapProperty} + "map_of_map_property" = ${MapOfMapProperty} + "anytype_1" = ${Anytype1} + "map_with_undeclared_properties_anytype_1" = ${MapWithUndeclaredPropertiesAnytype1} + "map_with_undeclared_properties_anytype_2" = ${MapWithUndeclaredPropertiesAnytype2} + "map_with_undeclared_properties_anytype_3" = ${MapWithUndeclaredPropertiesAnytype3} + "empty_map" = ${EmptyMap} + "map_with_undeclared_properties_string" = ${MapWithUndeclaredPropertiesString} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to AdditionalPropertiesClass + +.DESCRIPTION + +Convert from JSON to AdditionalPropertiesClass + +.PARAMETER Json + +Json object + +.OUTPUTS + +AdditionalPropertiesClass +#> +function ConvertFrom-PSJsonToAdditionalPropertiesClass { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSAdditionalPropertiesClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSAdditionalPropertiesClass + $AllProperties = ("map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_property"))) { #optional property not found + $MapProperty = $null + } else { + $MapProperty = $JsonParameters.PSobject.Properties["map_property"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_of_map_property"))) { #optional property not found + $MapOfMapProperty = $null + } else { + $MapOfMapProperty = $JsonParameters.PSobject.Properties["map_of_map_property"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "anytype_1"))) { #optional property not found + $Anytype1 = $null + } else { + $Anytype1 = $JsonParameters.PSobject.Properties["anytype_1"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_with_undeclared_properties_anytype_1"))) { #optional property not found + $MapWithUndeclaredPropertiesAnytype1 = $null + } else { + $MapWithUndeclaredPropertiesAnytype1 = $JsonParameters.PSobject.Properties["map_with_undeclared_properties_anytype_1"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_with_undeclared_properties_anytype_2"))) { #optional property not found + $MapWithUndeclaredPropertiesAnytype2 = $null + } else { + $MapWithUndeclaredPropertiesAnytype2 = $JsonParameters.PSobject.Properties["map_with_undeclared_properties_anytype_2"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_with_undeclared_properties_anytype_3"))) { #optional property not found + $MapWithUndeclaredPropertiesAnytype3 = $null + } else { + $MapWithUndeclaredPropertiesAnytype3 = $JsonParameters.PSobject.Properties["map_with_undeclared_properties_anytype_3"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "empty_map"))) { #optional property not found + $EmptyMap = $null + } else { + $EmptyMap = $JsonParameters.PSobject.Properties["empty_map"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_with_undeclared_properties_string"))) { #optional property not found + $MapWithUndeclaredPropertiesString = $null + } else { + $MapWithUndeclaredPropertiesString = $JsonParameters.PSobject.Properties["map_with_undeclared_properties_string"].value + } + + $PSO = [PSCustomObject]@{ + "map_property" = ${MapProperty} + "map_of_map_property" = ${MapOfMapProperty} + "anytype_1" = ${Anytype1} + "map_with_undeclared_properties_anytype_1" = ${MapWithUndeclaredPropertiesAnytype1} + "map_with_undeclared_properties_anytype_2" = ${MapWithUndeclaredPropertiesAnytype2} + "map_with_undeclared_properties_anytype_3" = ${MapWithUndeclaredPropertiesAnytype3} + "empty_map" = ${EmptyMap} + "map_with_undeclared_properties_string" = ${MapWithUndeclaredPropertiesString} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Animal.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Animal.ps1 new file mode 100644 index 000000000000..1da516f041bf --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Animal.ps1 @@ -0,0 +1,118 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ClassName +No description available. +.PARAMETER Color +No description available. +.OUTPUTS + +Animal +#> + +function Initialize-PSAnimal { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${Color} = "red" + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSAnimal' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + "color" = ${Color} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Animal + +.DESCRIPTION + +Convert from JSON to Animal + +.PARAMETER Json + +Json object + +.OUTPUTS + +Animal +#> +function ConvertFrom-PSJsonToAnimal { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSAnimal' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSAnimal + $AllProperties = ("className", "color") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "color"))) { #optional property not found + $Color = $null + } else { + $Color = $JsonParameters.PSobject.Properties["color"].value + } + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + "color" = ${Color} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 index 44be11154a37..4569b4ce4501 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -12,7 +12,7 @@ No summary available. .DESCRIPTION -Describes the result of uploading an image resource +No description available. .PARAMETER Code No description available. diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Apple.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Apple.ps1 new file mode 100644 index 000000000000..049bfec4495d --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Apple.ps1 @@ -0,0 +1,112 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Cultivar +No description available. +.PARAMETER Origin +No description available. +.OUTPUTS + +Apple +#> + +function Initialize-PSApple { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ValidatePattern("^[a-zA-Z\s]*$")] + [String] + ${Cultivar}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ValidatePattern("/^[A-Z\s]*$/i")] + [String] + ${Origin} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSApple' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "cultivar" = ${Cultivar} + "origin" = ${Origin} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Apple + +.DESCRIPTION + +Convert from JSON to Apple + +.PARAMETER Json + +Json object + +.OUTPUTS + +Apple +#> +function ConvertFrom-PSJsonToApple { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSApple' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSApple + $AllProperties = ("cultivar", "origin") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "cultivar"))) { #optional property not found + $Cultivar = $null + } else { + $Cultivar = $JsonParameters.PSobject.Properties["cultivar"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "origin"))) { #optional property not found + $Origin = $null + } else { + $Origin = $JsonParameters.PSobject.Properties["origin"].value + } + + $PSO = [PSCustomObject]@{ + "cultivar" = ${Cultivar} + "origin" = ${Origin} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/AppleReq.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/AppleReq.ps1 new file mode 100644 index 000000000000..10604433c184 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/AppleReq.ps1 @@ -0,0 +1,118 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Cultivar +No description available. +.PARAMETER Mealy +No description available. +.OUTPUTS + +AppleReq +#> + +function Initialize-PSAppleReq { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Cultivar}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${Mealy} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSAppleReq' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $Cultivar) { + throw "invalid value for 'Cultivar', 'Cultivar' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "cultivar" = ${Cultivar} + "mealy" = ${Mealy} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to AppleReq + +.DESCRIPTION + +Convert from JSON to AppleReq + +.PARAMETER Json + +Json object + +.OUTPUTS + +AppleReq +#> +function ConvertFrom-PSJsonToAppleReq { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSAppleReq' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSAppleReq + $AllProperties = ("cultivar", "mealy") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'cultivar' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "cultivar"))) { + throw "Error! JSON cannot be serialized due to the required property 'cultivar' missing." + } else { + $Cultivar = $JsonParameters.PSobject.Properties["cultivar"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "mealy"))) { #optional property not found + $Mealy = $null + } else { + $Mealy = $JsonParameters.PSobject.Properties["mealy"].value + } + + $PSO = [PSCustomObject]@{ + "cultivar" = ${Cultivar} + "mealy" = ${Mealy} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfArrayOfNumberOnly.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfArrayOfNumberOnly.ps1 new file mode 100644 index 000000000000..15762b5aef59 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfArrayOfNumberOnly.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ArrayArrayNumber +No description available. +.OUTPUTS + +ArrayOfArrayOfNumberOnly +#> + +function Initialize-PSArrayOfArrayOfNumberOnly { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [Decimal[][]] + ${ArrayArrayNumber} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSArrayOfArrayOfNumberOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "ArrayArrayNumber" = ${ArrayArrayNumber} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ArrayOfArrayOfNumberOnly + +.DESCRIPTION + +Convert from JSON to ArrayOfArrayOfNumberOnly + +.PARAMETER Json + +Json object + +.OUTPUTS + +ArrayOfArrayOfNumberOnly +#> +function ConvertFrom-PSJsonToArrayOfArrayOfNumberOnly { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSArrayOfArrayOfNumberOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSArrayOfArrayOfNumberOnly + $AllProperties = ("ArrayArrayNumber") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "ArrayArrayNumber"))) { #optional property not found + $ArrayArrayNumber = $null + } else { + $ArrayArrayNumber = $JsonParameters.PSobject.Properties["ArrayArrayNumber"].value + } + + $PSO = [PSCustomObject]@{ + "ArrayArrayNumber" = ${ArrayArrayNumber} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfNumberOnly.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfNumberOnly.ps1 new file mode 100644 index 000000000000..d952e5e914a7 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayOfNumberOnly.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ArrayNumber +No description available. +.OUTPUTS + +ArrayOfNumberOnly +#> + +function Initialize-PSArrayOfNumberOnly { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [Decimal[]] + ${ArrayNumber} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSArrayOfNumberOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "ArrayNumber" = ${ArrayNumber} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ArrayOfNumberOnly + +.DESCRIPTION + +Convert from JSON to ArrayOfNumberOnly + +.PARAMETER Json + +Json object + +.OUTPUTS + +ArrayOfNumberOnly +#> +function ConvertFrom-PSJsonToArrayOfNumberOnly { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSArrayOfNumberOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSArrayOfNumberOnly + $AllProperties = ("ArrayNumber") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "ArrayNumber"))) { #optional property not found + $ArrayNumber = $null + } else { + $ArrayNumber = $JsonParameters.PSobject.Properties["ArrayNumber"].value + } + + $PSO = [PSCustomObject]@{ + "ArrayNumber" = ${ArrayNumber} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayTest.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayTest.ps1 new file mode 100644 index 000000000000..bd20031b93a2 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ArrayTest.ps1 @@ -0,0 +1,123 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ArrayOfString +No description available. +.PARAMETER ArrayArrayOfInteger +No description available. +.PARAMETER ArrayArrayOfModel +No description available. +.OUTPUTS + +ArrayTest +#> + +function Initialize-PSArrayTest { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String[]] + ${ArrayOfString}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [Int64[][]] + ${ArrayArrayOfInteger}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[][]] + ${ArrayArrayOfModel} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSArrayTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "array_of_string" = ${ArrayOfString} + "array_array_of_integer" = ${ArrayArrayOfInteger} + "array_array_of_model" = ${ArrayArrayOfModel} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ArrayTest + +.DESCRIPTION + +Convert from JSON to ArrayTest + +.PARAMETER Json + +Json object + +.OUTPUTS + +ArrayTest +#> +function ConvertFrom-PSJsonToArrayTest { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSArrayTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSArrayTest + $AllProperties = ("array_of_string", "array_array_of_integer", "array_array_of_model") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_of_string"))) { #optional property not found + $ArrayOfString = $null + } else { + $ArrayOfString = $JsonParameters.PSobject.Properties["array_of_string"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_array_of_integer"))) { #optional property not found + $ArrayArrayOfInteger = $null + } else { + $ArrayArrayOfInteger = $JsonParameters.PSobject.Properties["array_array_of_integer"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_array_of_model"))) { #optional property not found + $ArrayArrayOfModel = $null + } else { + $ArrayArrayOfModel = $JsonParameters.PSobject.Properties["array_array_of_model"].value + } + + $PSO = [PSCustomObject]@{ + "array_of_string" = ${ArrayOfString} + "array_array_of_integer" = ${ArrayArrayOfInteger} + "array_array_of_model" = ${ArrayArrayOfModel} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Banana.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Banana.ps1 new file mode 100644 index 000000000000..55e9a55978fa --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Banana.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER LengthCm +No description available. +.OUTPUTS + +Banana +#> + +function Initialize-PSBanana { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Decimal]] + ${LengthCm} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSBanana' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "lengthCm" = ${LengthCm} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Banana + +.DESCRIPTION + +Convert from JSON to Banana + +.PARAMETER Json + +Json object + +.OUTPUTS + +Banana +#> +function ConvertFrom-PSJsonToBanana { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSBanana' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSBanana + $AllProperties = ("lengthCm") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "lengthCm"))) { #optional property not found + $LengthCm = $null + } else { + $LengthCm = $JsonParameters.PSobject.Properties["lengthCm"].value + } + + $PSO = [PSCustomObject]@{ + "lengthCm" = ${LengthCm} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/BananaReq.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/BananaReq.ps1 new file mode 100644 index 000000000000..21dee7f98766 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/BananaReq.ps1 @@ -0,0 +1,118 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER LengthCm +No description available. +.PARAMETER Sweet +No description available. +.OUTPUTS + +BananaReq +#> + +function Initialize-PSBananaReq { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [Decimal] + ${LengthCm}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${Sweet} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSBananaReq' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $LengthCm) { + throw "invalid value for 'LengthCm', 'LengthCm' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "lengthCm" = ${LengthCm} + "sweet" = ${Sweet} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to BananaReq + +.DESCRIPTION + +Convert from JSON to BananaReq + +.PARAMETER Json + +Json object + +.OUTPUTS + +BananaReq +#> +function ConvertFrom-PSJsonToBananaReq { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSBananaReq' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSBananaReq + $AllProperties = ("lengthCm", "sweet") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'lengthCm' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "lengthCm"))) { + throw "Error! JSON cannot be serialized due to the required property 'lengthCm' missing." + } else { + $LengthCm = $JsonParameters.PSobject.Properties["lengthCm"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "sweet"))) { #optional property not found + $Sweet = $null + } else { + $Sweet = $JsonParameters.PSobject.Properties["sweet"].value + } + + $PSO = [PSCustomObject]@{ + "lengthCm" = ${LengthCm} + "sweet" = ${Sweet} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/BasquePig.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/BasquePig.ps1 new file mode 100644 index 000000000000..d6bfff878420 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/BasquePig.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ClassName +No description available. +.OUTPUTS + +BasquePig +#> + +function Initialize-PSBasquePig { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSBasquePig' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to BasquePig + +.DESCRIPTION + +Convert from JSON to BasquePig + +.PARAMETER Json + +Json object + +.OUTPUTS + +BasquePig +#> +function ConvertFrom-PSJsonToBasquePig { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSBasquePig' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSBasquePig + $AllProperties = ("className") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Capitalization.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Capitalization.ps1 new file mode 100644 index 000000000000..d71810788fd3 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Capitalization.ps1 @@ -0,0 +1,162 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER SmallCamel +No description available. +.PARAMETER CapitalCamel +No description available. +.PARAMETER SmallSnake +No description available. +.PARAMETER CapitalSnake +No description available. +.PARAMETER SCAETHFlowPoints +No description available. +.PARAMETER ATTNAME +Name of the pet +.OUTPUTS + +Capitalization +#> + +function Initialize-PSCapitalization { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${SmallCamel}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${CapitalCamel}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [String] + ${SmallSnake}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [String] + ${CapitalSnake}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] + [String] + ${SCAETHFlowPoints}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] + [String] + ${ATTNAME} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSCapitalization' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "smallCamel" = ${SmallCamel} + "CapitalCamel" = ${CapitalCamel} + "small_Snake" = ${SmallSnake} + "Capital_Snake" = ${CapitalSnake} + "SCA_ETH_Flow_Points" = ${SCAETHFlowPoints} + "ATT_NAME" = ${ATTNAME} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Capitalization + +.DESCRIPTION + +Convert from JSON to Capitalization + +.PARAMETER Json + +Json object + +.OUTPUTS + +Capitalization +#> +function ConvertFrom-PSJsonToCapitalization { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSCapitalization' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSCapitalization + $AllProperties = ("smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "smallCamel"))) { #optional property not found + $SmallCamel = $null + } else { + $SmallCamel = $JsonParameters.PSobject.Properties["smallCamel"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "CapitalCamel"))) { #optional property not found + $CapitalCamel = $null + } else { + $CapitalCamel = $JsonParameters.PSobject.Properties["CapitalCamel"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "small_Snake"))) { #optional property not found + $SmallSnake = $null + } else { + $SmallSnake = $JsonParameters.PSobject.Properties["small_Snake"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "Capital_Snake"))) { #optional property not found + $CapitalSnake = $null + } else { + $CapitalSnake = $JsonParameters.PSobject.Properties["Capital_Snake"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "SCA_ETH_Flow_Points"))) { #optional property not found + $SCAETHFlowPoints = $null + } else { + $SCAETHFlowPoints = $JsonParameters.PSobject.Properties["SCA_ETH_Flow_Points"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "ATT_NAME"))) { #optional property not found + $ATTNAME = $null + } else { + $ATTNAME = $JsonParameters.PSobject.Properties["ATT_NAME"].value + } + + $PSO = [PSCustomObject]@{ + "smallCamel" = ${SmallCamel} + "CapitalCamel" = ${CapitalCamel} + "small_Snake" = ${SmallSnake} + "Capital_Snake" = ${CapitalSnake} + "SCA_ETH_Flow_Points" = ${SCAETHFlowPoints} + "ATT_NAME" = ${ATTNAME} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Cat.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Cat.ps1 new file mode 100644 index 000000000000..a9c94e32336a --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Cat.ps1 @@ -0,0 +1,131 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ClassName +No description available. +.PARAMETER Color +No description available. +.PARAMETER Declawed +No description available. +.OUTPUTS + +Cat +#> + +function Initialize-PSCat { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${Color} = "red", + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${Declawed} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSCat' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + "color" = ${Color} + "declawed" = ${Declawed} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Cat + +.DESCRIPTION + +Convert from JSON to Cat + +.PARAMETER Json + +Json object + +.OUTPUTS + +Cat +#> +function ConvertFrom-PSJsonToCat { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSCat' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSCat + $AllProperties = ("className", "color", "declawed") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "color"))) { #optional property not found + $Color = $null + } else { + $Color = $JsonParameters.PSobject.Properties["color"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "declawed"))) { #optional property not found + $Declawed = $null + } else { + $Declawed = $JsonParameters.PSobject.Properties["declawed"].value + } + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + "color" = ${Color} + "declawed" = ${Declawed} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/CatAllOf.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/CatAllOf.ps1 new file mode 100644 index 000000000000..1e57f437b5f0 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/CatAllOf.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Declawed +No description available. +.OUTPUTS + +CatAllOf +#> + +function Initialize-PSCatAllOf { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${Declawed} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSCatAllOf' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "declawed" = ${Declawed} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to CatAllOf + +.DESCRIPTION + +Convert from JSON to CatAllOf + +.PARAMETER Json + +Json object + +.OUTPUTS + +CatAllOf +#> +function ConvertFrom-PSJsonToCatAllOf { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSCatAllOf' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSCatAllOf + $AllProperties = ("declawed") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "declawed"))) { #optional property not found + $Declawed = $null + } else { + $Declawed = $JsonParameters.PSobject.Properties["declawed"].value + } + + $PSO = [PSCustomObject]@{ + "declawed" = ${Declawed} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 index 3c3bcf860f9c..2386dd8543c4 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -12,7 +12,7 @@ No summary available. .DESCRIPTION -A category for a pet +No description available. .PARAMETER Id No description available. @@ -30,15 +30,18 @@ function Initialize-PSCategory { [System.Nullable[Int64]] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] - [ValidatePattern("^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$")] [String] - ${Name} + ${Name} = "default-name" ) Process { 'Creating PSCustomObject: PSPetstore => PSCategory' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug + if ($null -eq $Name) { + throw "invalid value for 'Name', 'Name' cannot be null." + } + $PSO = [PSCustomObject]@{ "id" = ${Id} @@ -87,18 +90,22 @@ function ConvertFrom-PSJsonToCategory { } } - if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found - $Id = $null - } else { - $Id = $JsonParameters.PSobject.Properties["id"].value + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'name' missing." } - if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found - $Name = $null + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { + throw "Error! JSON cannot be serialized due to the required property 'name' missing." } else { $Name = $JsonParameters.PSobject.Properties["name"].value } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ClassModel.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ClassModel.ps1 new file mode 100644 index 000000000000..eea87f4ac57b --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ClassModel.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +Model for testing model with ""_class"" property + +.PARAMETER Class +No description available. +.OUTPUTS + +ClassModel +#> + +function Initialize-PSClassModel { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Class} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSClassModel' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "_class" = ${Class} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ClassModel + +.DESCRIPTION + +Convert from JSON to ClassModel + +.PARAMETER Json + +Json object + +.OUTPUTS + +ClassModel +#> +function ConvertFrom-PSJsonToClassModel { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSClassModel' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSClassModel + $AllProperties = ("_class") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "_class"))) { #optional property not found + $Class = $null + } else { + $Class = $JsonParameters.PSobject.Properties["_class"].value + } + + $PSO = [PSCustomObject]@{ + "_class" = ${Class} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Client.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Client.ps1 new file mode 100644 index 000000000000..13059074de64 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Client.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Client +No description available. +.OUTPUTS + +Client +#> + +function Initialize-PSClient { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Client} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSClient' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "client" = ${Client} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Client + +.DESCRIPTION + +Convert from JSON to Client + +.PARAMETER Json + +Json object + +.OUTPUTS + +Client +#> +function ConvertFrom-PSJsonToClient { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSClient' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSClient + $AllProperties = ("client") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "client"))) { #optional property not found + $Client = $null + } else { + $Client = $JsonParameters.PSobject.Properties["client"].value + } + + $PSO = [PSCustomObject]@{ + "client" = ${Client} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ComplexQuadrilateral.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ComplexQuadrilateral.ps1 new file mode 100644 index 000000000000..bfa0839116f0 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ComplexQuadrilateral.ps1 @@ -0,0 +1,122 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ShapeType +No description available. +.PARAMETER QuadrilateralType +No description available. +.OUTPUTS + +ComplexQuadrilateral +#> + +function Initialize-PSComplexQuadrilateral { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ShapeType}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${QuadrilateralType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSComplexQuadrilateral' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ShapeType) { + throw "invalid value for 'ShapeType', 'ShapeType' cannot be null." + } + + if ($null -eq $QuadrilateralType) { + throw "invalid value for 'QuadrilateralType', 'QuadrilateralType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "quadrilateralType" = ${QuadrilateralType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ComplexQuadrilateral + +.DESCRIPTION + +Convert from JSON to ComplexQuadrilateral + +.PARAMETER Json + +Json object + +.OUTPUTS + +ComplexQuadrilateral +#> +function ConvertFrom-PSJsonToComplexQuadrilateral { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSComplexQuadrilateral' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSComplexQuadrilateral + $AllProperties = ("shapeType", "quadrilateralType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'shapeType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeType"))) { + throw "Error! JSON cannot be serialized due to the required property 'shapeType' missing." + } else { + $ShapeType = $JsonParameters.PSobject.Properties["shapeType"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "quadrilateralType"))) { + throw "Error! JSON cannot be serialized due to the required property 'quadrilateralType' missing." + } else { + $QuadrilateralType = $JsonParameters.PSobject.Properties["quadrilateralType"].value + } + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "quadrilateralType" = ${QuadrilateralType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/DanishPig.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/DanishPig.ps1 new file mode 100644 index 000000000000..f30268da519c --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/DanishPig.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ClassName +No description available. +.OUTPUTS + +DanishPig +#> + +function Initialize-PSDanishPig { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSDanishPig' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to DanishPig + +.DESCRIPTION + +Convert from JSON to DanishPig + +.PARAMETER Json + +Json object + +.OUTPUTS + +DanishPig +#> +function ConvertFrom-PSJsonToDanishPig { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSDanishPig' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSDanishPig + $AllProperties = ("className") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/DeprecatedObject.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/DeprecatedObject.ps1 new file mode 100644 index 000000000000..f2a88c0416a5 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/DeprecatedObject.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Name +No description available. +.OUTPUTS + +DeprecatedObject +#> + +function Initialize-PSDeprecatedObject { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Name} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSDeprecatedObject' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to DeprecatedObject + +.DESCRIPTION + +Convert from JSON to DeprecatedObject + +.PARAMETER Json + +Json object + +.OUTPUTS + +DeprecatedObject +#> +function ConvertFrom-PSJsonToDeprecatedObject { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSDeprecatedObject' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSDeprecatedObject + $AllProperties = ("name") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found + $Name = $null + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Dog.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Dog.ps1 new file mode 100644 index 000000000000..3e33a6c23e65 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Dog.ps1 @@ -0,0 +1,131 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ClassName +No description available. +.PARAMETER Color +No description available. +.PARAMETER Breed +No description available. +.OUTPUTS + +Dog +#> + +function Initialize-PSDog { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${Color} = "red", + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [String] + ${Breed} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSDog' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + "color" = ${Color} + "breed" = ${Breed} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Dog + +.DESCRIPTION + +Convert from JSON to Dog + +.PARAMETER Json + +Json object + +.OUTPUTS + +Dog +#> +function ConvertFrom-PSJsonToDog { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSDog' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSDog + $AllProperties = ("className", "color", "breed") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "color"))) { #optional property not found + $Color = $null + } else { + $Color = $JsonParameters.PSobject.Properties["color"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "breed"))) { #optional property not found + $Breed = $null + } else { + $Breed = $JsonParameters.PSobject.Properties["breed"].value + } + + $PSO = [PSCustomObject]@{ + "className" = ${ClassName} + "color" = ${Color} + "breed" = ${Breed} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/DogAllOf.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/DogAllOf.ps1 new file mode 100644 index 000000000000..7737af53e414 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/DogAllOf.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Breed +No description available. +.OUTPUTS + +DogAllOf +#> + +function Initialize-PSDogAllOf { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Breed} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSDogAllOf' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "breed" = ${Breed} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to DogAllOf + +.DESCRIPTION + +Convert from JSON to DogAllOf + +.PARAMETER Json + +Json object + +.OUTPUTS + +DogAllOf +#> +function ConvertFrom-PSJsonToDogAllOf { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSDogAllOf' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSDogAllOf + $AllProperties = ("breed") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "breed"))) { #optional property not found + $Breed = $null + } else { + $Breed = $JsonParameters.PSobject.Properties["breed"].value + } + + $PSO = [PSCustomObject]@{ + "breed" = ${Breed} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Drawing.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Drawing.ps1 new file mode 100644 index 000000000000..3db24f69486d --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Drawing.ps1 @@ -0,0 +1,136 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER MainShape +No description available. +.PARAMETER ShapeOrNull +No description available. +.PARAMETER NullableShape +No description available. +.PARAMETER Shapes +No description available. +.OUTPUTS + +Drawing +#> + +function Initialize-PSDrawing { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${MainShape}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${ShapeOrNull}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${NullableShape}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[]] + ${Shapes} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSDrawing' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "mainShape" = ${MainShape} + "shapeOrNull" = ${ShapeOrNull} + "nullableShape" = ${NullableShape} + "shapes" = ${Shapes} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Drawing + +.DESCRIPTION + +Convert from JSON to Drawing + +.PARAMETER Json + +Json object + +.OUTPUTS + +Drawing +#> +function ConvertFrom-PSJsonToDrawing { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSDrawing' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSDrawing + $AllProperties = ("mainShape", "shapeOrNull", "nullableShape", "shapes") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "mainShape"))) { #optional property not found + $MainShape = $null + } else { + $MainShape = $JsonParameters.PSobject.Properties["mainShape"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeOrNull"))) { #optional property not found + $ShapeOrNull = $null + } else { + $ShapeOrNull = $JsonParameters.PSobject.Properties["shapeOrNull"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "nullableShape"))) { #optional property not found + $NullableShape = $null + } else { + $NullableShape = $JsonParameters.PSobject.Properties["nullableShape"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapes"))) { #optional property not found + $Shapes = $null + } else { + $Shapes = $JsonParameters.PSobject.Properties["shapes"].value + } + + $PSO = [PSCustomObject]@{ + "mainShape" = ${MainShape} + "shapeOrNull" = ${ShapeOrNull} + "nullableShape" = ${NullableShape} + "shapes" = ${Shapes} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/EnumArrays.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/EnumArrays.ps1 new file mode 100644 index 000000000000..0dc089ae6b4b --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/EnumArrays.ps1 @@ -0,0 +1,112 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER JustSymbol +No description available. +.PARAMETER ArrayEnum +No description available. +.OUTPUTS + +EnumArrays +#> + +function Initialize-PSEnumArrays { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ValidateSet(">=", "$")] + [String] + ${JustSymbol}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("fish", "crab")] + [String[]] + ${ArrayEnum} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSEnumArrays' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "just_symbol" = ${JustSymbol} + "array_enum" = ${ArrayEnum} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to EnumArrays + +.DESCRIPTION + +Convert from JSON to EnumArrays + +.PARAMETER Json + +Json object + +.OUTPUTS + +EnumArrays +#> +function ConvertFrom-PSJsonToEnumArrays { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSEnumArrays' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSEnumArrays + $AllProperties = ("just_symbol", "array_enum") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "just_symbol"))) { #optional property not found + $JustSymbol = $null + } else { + $JustSymbol = $JsonParameters.PSobject.Properties["just_symbol"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_enum"))) { #optional property not found + $ArrayEnum = $null + } else { + $ArrayEnum = $JsonParameters.PSobject.Properties["array_enum"].value + } + + $PSO = [PSCustomObject]@{ + "just_symbol" = ${JustSymbol} + "array_enum" = ${ArrayEnum} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/EnumTest.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/EnumTest.ps1 new file mode 100644 index 000000000000..fdb1139d4f49 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/EnumTest.ps1 @@ -0,0 +1,214 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER EnumString +No description available. +.PARAMETER EnumStringRequired +No description available. +.PARAMETER EnumInteger +No description available. +.PARAMETER EnumIntegerOnly +No description available. +.PARAMETER EnumNumber +No description available. +.PARAMETER OuterEnum +No description available. +.PARAMETER OuterEnumInteger +No description available. +.PARAMETER OuterEnumDefaultValue +No description available. +.PARAMETER OuterEnumIntegerDefaultValue +No description available. +.OUTPUTS + +EnumTest +#> + +function Initialize-PSEnumTest { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("UPPER", "lower", "")] + [String] + ${EnumString}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("UPPER", "lower", "")] + [String] + ${EnumStringRequired}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("1", "-1")] + [System.Nullable[Int32]] + ${EnumInteger}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("2", "-2")] + [System.Nullable[Int32]] + ${EnumIntegerOnly}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("1.1", "-1.2")] + [System.Nullable[Double]] + ${EnumNumber}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${OuterEnum}, + [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${OuterEnumInteger}, + [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${OuterEnumDefaultValue}, + [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${OuterEnumIntegerDefaultValue} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSEnumTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $EnumStringRequired) { + throw "invalid value for 'EnumStringRequired', 'EnumStringRequired' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "enum_string" = ${EnumString} + "enum_string_required" = ${EnumStringRequired} + "enum_integer" = ${EnumInteger} + "enum_integer_only" = ${EnumIntegerOnly} + "enum_number" = ${EnumNumber} + "outerEnum" = ${OuterEnum} + "outerEnumInteger" = ${OuterEnumInteger} + "outerEnumDefaultValue" = ${OuterEnumDefaultValue} + "outerEnumIntegerDefaultValue" = ${OuterEnumIntegerDefaultValue} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to EnumTest + +.DESCRIPTION + +Convert from JSON to EnumTest + +.PARAMETER Json + +Json object + +.OUTPUTS + +EnumTest +#> +function ConvertFrom-PSJsonToEnumTest { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSEnumTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSEnumTest + $AllProperties = ("enum_string", "enum_string_required", "enum_integer", "enum_integer_only", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'enum_string_required' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "enum_string_required"))) { + throw "Error! JSON cannot be serialized due to the required property 'enum_string_required' missing." + } else { + $EnumStringRequired = $JsonParameters.PSobject.Properties["enum_string_required"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "enum_string"))) { #optional property not found + $EnumString = $null + } else { + $EnumString = $JsonParameters.PSobject.Properties["enum_string"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "enum_integer"))) { #optional property not found + $EnumInteger = $null + } else { + $EnumInteger = $JsonParameters.PSobject.Properties["enum_integer"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "enum_integer_only"))) { #optional property not found + $EnumIntegerOnly = $null + } else { + $EnumIntegerOnly = $JsonParameters.PSobject.Properties["enum_integer_only"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "enum_number"))) { #optional property not found + $EnumNumber = $null + } else { + $EnumNumber = $JsonParameters.PSobject.Properties["enum_number"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "outerEnum"))) { #optional property not found + $OuterEnum = $null + } else { + $OuterEnum = $JsonParameters.PSobject.Properties["outerEnum"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "outerEnumInteger"))) { #optional property not found + $OuterEnumInteger = $null + } else { + $OuterEnumInteger = $JsonParameters.PSobject.Properties["outerEnumInteger"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "outerEnumDefaultValue"))) { #optional property not found + $OuterEnumDefaultValue = $null + } else { + $OuterEnumDefaultValue = $JsonParameters.PSobject.Properties["outerEnumDefaultValue"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "outerEnumIntegerDefaultValue"))) { #optional property not found + $OuterEnumIntegerDefaultValue = $null + } else { + $OuterEnumIntegerDefaultValue = $JsonParameters.PSobject.Properties["outerEnumIntegerDefaultValue"].value + } + + $PSO = [PSCustomObject]@{ + "enum_string" = ${EnumString} + "enum_string_required" = ${EnumStringRequired} + "enum_integer" = ${EnumInteger} + "enum_integer_only" = ${EnumIntegerOnly} + "enum_number" = ${EnumNumber} + "outerEnum" = ${OuterEnum} + "outerEnumInteger" = ${OuterEnumInteger} + "outerEnumDefaultValue" = ${OuterEnumDefaultValue} + "outerEnumIntegerDefaultValue" = ${OuterEnumIntegerDefaultValue} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/EquilateralTriangle.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/EquilateralTriangle.ps1 new file mode 100644 index 000000000000..68d1536147f1 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/EquilateralTriangle.ps1 @@ -0,0 +1,122 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ShapeType +No description available. +.PARAMETER TriangleType +No description available. +.OUTPUTS + +EquilateralTriangle +#> + +function Initialize-PSEquilateralTriangle { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ShapeType}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${TriangleType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSEquilateralTriangle' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ShapeType) { + throw "invalid value for 'ShapeType', 'ShapeType' cannot be null." + } + + if ($null -eq $TriangleType) { + throw "invalid value for 'TriangleType', 'TriangleType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "triangleType" = ${TriangleType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to EquilateralTriangle + +.DESCRIPTION + +Convert from JSON to EquilateralTriangle + +.PARAMETER Json + +Json object + +.OUTPUTS + +EquilateralTriangle +#> +function ConvertFrom-PSJsonToEquilateralTriangle { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSEquilateralTriangle' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSEquilateralTriangle + $AllProperties = ("shapeType", "triangleType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'shapeType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeType"))) { + throw "Error! JSON cannot be serialized due to the required property 'shapeType' missing." + } else { + $ShapeType = $JsonParameters.PSobject.Properties["shapeType"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "triangleType"))) { + throw "Error! JSON cannot be serialized due to the required property 'triangleType' missing." + } else { + $TriangleType = $JsonParameters.PSobject.Properties["triangleType"].value + } + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "triangleType" = ${TriangleType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/File.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/File.ps1 new file mode 100644 index 000000000000..b9531e65f9cb --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/File.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +Must be named `File` for test. + +.PARAMETER SourceURI +Test capitalization +.OUTPUTS + +File +#> + +function Initialize-PSFile { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${SourceURI} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSFile' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "sourceURI" = ${SourceURI} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to File + +.DESCRIPTION + +Convert from JSON to File + +.PARAMETER Json + +Json object + +.OUTPUTS + +File +#> +function ConvertFrom-PSJsonToFile { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSFile' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSFile + $AllProperties = ("sourceURI") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "sourceURI"))) { #optional property not found + $SourceURI = $null + } else { + $SourceURI = $JsonParameters.PSobject.Properties["sourceURI"].value + } + + $PSO = [PSCustomObject]@{ + "sourceURI" = ${SourceURI} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/FileSchemaTestClass.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/FileSchemaTestClass.ps1 new file mode 100644 index 000000000000..19641687121a --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/FileSchemaTestClass.ps1 @@ -0,0 +1,110 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER File +No description available. +.PARAMETER Files +No description available. +.OUTPUTS + +FileSchemaTestClass +#> + +function Initialize-PSFileSchemaTestClass { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${File}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[]] + ${Files} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSFileSchemaTestClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "file" = ${File} + "files" = ${Files} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to FileSchemaTestClass + +.DESCRIPTION + +Convert from JSON to FileSchemaTestClass + +.PARAMETER Json + +Json object + +.OUTPUTS + +FileSchemaTestClass +#> +function ConvertFrom-PSJsonToFileSchemaTestClass { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSFileSchemaTestClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSFileSchemaTestClass + $AllProperties = ("file", "files") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "file"))) { #optional property not found + $File = $null + } else { + $File = $JsonParameters.PSobject.Properties["file"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "files"))) { #optional property not found + $Files = $null + } else { + $Files = $JsonParameters.PSobject.Properties["files"].value + } + + $PSO = [PSCustomObject]@{ + "file" = ${File} + "files" = ${Files} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Foo.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Foo.ps1 new file mode 100644 index 000000000000..4e1adcf5e2a7 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Foo.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Bar +No description available. +.OUTPUTS + +Foo +#> + +function Initialize-PSFoo { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Bar} = "bar" + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSFoo' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "bar" = ${Bar} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Foo + +.DESCRIPTION + +Convert from JSON to Foo + +.PARAMETER Json + +Json object + +.OUTPUTS + +Foo +#> +function ConvertFrom-PSJsonToFoo { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSFoo' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSFoo + $AllProperties = ("bar") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "bar"))) { #optional property not found + $Bar = $null + } else { + $Bar = $JsonParameters.PSobject.Properties["bar"].value + } + + $PSO = [PSCustomObject]@{ + "bar" = ${Bar} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/FormatTest.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/FormatTest.ps1 new file mode 100644 index 000000000000..b0202bf07737 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/FormatTest.ps1 @@ -0,0 +1,363 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Integer +No description available. +.PARAMETER Int32 +No description available. +.PARAMETER Int64 +No description available. +.PARAMETER Number +No description available. +.PARAMETER Float +No description available. +.PARAMETER Double +No description available. +.PARAMETER Decimal +No description available. +.PARAMETER String +No description available. +.PARAMETER Byte +No description available. +.PARAMETER Binary +No description available. +.PARAMETER Date +No description available. +.PARAMETER DateTime +No description available. +.PARAMETER Uuid +No description available. +.PARAMETER Password +No description available. +.PARAMETER PatternWithDigits +A string that is a 10 digit number. Can have leading zeros. +.PARAMETER PatternWithDigitsAndDelimiter +A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. +.OUTPUTS + +FormatTest +#> + +function Initialize-PSFormatTest { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${Integer}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${Int32}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int64]] + ${Int64}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [Decimal] + ${Number}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Double]] + ${Float}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Double]] + ${Double}, + [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Decimal]] + ${Decimal}, + [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)] + [ValidatePattern("/[a-z]/i")] + [String] + ${String}, + [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${Byte}, + [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)] + [System.IO.FileInfo] + ${Binary}, + [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)] + [System.DateTime] + ${Date}, + [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.DateTime]] + ${DateTime}, + [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true)] + [String] + ${Uuid}, + [Parameter(Position = 13, ValueFromPipelineByPropertyName = $true)] + [String] + ${Password}, + [Parameter(Position = 14, ValueFromPipelineByPropertyName = $true)] + [ValidatePattern("^\d{10}$")] + [String] + ${PatternWithDigits}, + [Parameter(Position = 15, ValueFromPipelineByPropertyName = $true)] + [ValidatePattern("/^image_\d{1,3}$/i")] + [String] + ${PatternWithDigitsAndDelimiter} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSFormatTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($Integer -and $Integer -gt 100) { + throw "invalid value for 'Integer', must be smaller than or equal to 100." + } + + if ($Integer -and $Integer -lt 10) { + throw "invalid value for 'Integer', must be greater than or equal to 10." + } + + if ($Int32 -and $Int32 -gt 200) { + throw "invalid value for 'Int32', must be smaller than or equal to 200." + } + + if ($Int32 -and $Int32 -lt 20) { + throw "invalid value for 'Int32', must be greater than or equal to 20." + } + + if ($null -eq $Number) { + throw "invalid value for 'Number', 'Number' cannot be null." + } + + if ($Number -gt 543.2) { + throw "invalid value for 'Number', must be smaller than or equal to 543.2." + } + + if ($Number -lt 32.1) { + throw "invalid value for 'Number', must be greater than or equal to 32.1." + } + + if ($Float -and $Float -gt 987.6) { + throw "invalid value for 'Float', must be smaller than or equal to 987.6." + } + + if ($Float -and $Float -lt 54.3) { + throw "invalid value for 'Float', must be greater than or equal to 54.3." + } + + if ($Double -and $Double -gt 123.4) { + throw "invalid value for 'Double', must be smaller than or equal to 123.4." + } + + if ($Double -and $Double -lt 67.8) { + throw "invalid value for 'Double', must be greater than or equal to 67.8." + } + + if ($null -eq $Byte) { + throw "invalid value for 'Byte', 'Byte' cannot be null." + } + + if ($null -eq $Date) { + throw "invalid value for 'Date', 'Date' cannot be null." + } + + if ($null -eq $Password) { + throw "invalid value for 'Password', 'Password' cannot be null." + } + + if ($Password.length -gt 64) { + throw "invalid value for 'Password', the character length must be smaller than or equal to 64." + } + + if ($Password.length -lt 10) { + throw "invalid value for 'Password', the character length must be great than or equal to 10." + } + + + $PSO = [PSCustomObject]@{ + "integer" = ${Integer} + "int32" = ${Int32} + "int64" = ${Int64} + "number" = ${Number} + "float" = ${Float} + "double" = ${Double} + "decimal" = ${Decimal} + "string" = ${String} + "byte" = ${Byte} + "binary" = ${Binary} + "date" = ${Date} + "dateTime" = ${DateTime} + "uuid" = ${Uuid} + "password" = ${Password} + "pattern_with_digits" = ${PatternWithDigits} + "pattern_with_digits_and_delimiter" = ${PatternWithDigitsAndDelimiter} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to FormatTest + +.DESCRIPTION + +Convert from JSON to FormatTest + +.PARAMETER Json + +Json object + +.OUTPUTS + +FormatTest +#> +function ConvertFrom-PSJsonToFormatTest { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSFormatTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSFormatTest + $AllProperties = ("integer", "int32", "int64", "number", "float", "double", "decimal", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'number' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "number"))) { + throw "Error! JSON cannot be serialized due to the required property 'number' missing." + } else { + $Number = $JsonParameters.PSobject.Properties["number"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "byte"))) { + throw "Error! JSON cannot be serialized due to the required property 'byte' missing." + } else { + $Byte = $JsonParameters.PSobject.Properties["byte"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "date"))) { + throw "Error! JSON cannot be serialized due to the required property 'date' missing." + } else { + $Date = $JsonParameters.PSobject.Properties["date"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "password"))) { + throw "Error! JSON cannot be serialized due to the required property 'password' missing." + } else { + $Password = $JsonParameters.PSobject.Properties["password"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "integer"))) { #optional property not found + $Integer = $null + } else { + $Integer = $JsonParameters.PSobject.Properties["integer"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "int32"))) { #optional property not found + $Int32 = $null + } else { + $Int32 = $JsonParameters.PSobject.Properties["int32"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "int64"))) { #optional property not found + $Int64 = $null + } else { + $Int64 = $JsonParameters.PSobject.Properties["int64"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "float"))) { #optional property not found + $Float = $null + } else { + $Float = $JsonParameters.PSobject.Properties["float"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "double"))) { #optional property not found + $Double = $null + } else { + $Double = $JsonParameters.PSobject.Properties["double"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "decimal"))) { #optional property not found + $Decimal = $null + } else { + $Decimal = $JsonParameters.PSobject.Properties["decimal"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "string"))) { #optional property not found + $String = $null + } else { + $String = $JsonParameters.PSobject.Properties["string"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "binary"))) { #optional property not found + $Binary = $null + } else { + $Binary = $JsonParameters.PSobject.Properties["binary"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "dateTime"))) { #optional property not found + $DateTime = $null + } else { + $DateTime = $JsonParameters.PSobject.Properties["dateTime"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "uuid"))) { #optional property not found + $Uuid = $null + } else { + $Uuid = $JsonParameters.PSobject.Properties["uuid"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "pattern_with_digits"))) { #optional property not found + $PatternWithDigits = $null + } else { + $PatternWithDigits = $JsonParameters.PSobject.Properties["pattern_with_digits"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "pattern_with_digits_and_delimiter"))) { #optional property not found + $PatternWithDigitsAndDelimiter = $null + } else { + $PatternWithDigitsAndDelimiter = $JsonParameters.PSobject.Properties["pattern_with_digits_and_delimiter"].value + } + + $PSO = [PSCustomObject]@{ + "integer" = ${Integer} + "int32" = ${Int32} + "int64" = ${Int64} + "number" = ${Number} + "float" = ${Float} + "double" = ${Double} + "decimal" = ${Decimal} + "string" = ${String} + "byte" = ${Byte} + "binary" = ${Binary} + "date" = ${Date} + "dateTime" = ${DateTime} + "uuid" = ${Uuid} + "password" = ${Password} + "pattern_with_digits" = ${PatternWithDigits} + "pattern_with_digits_and_delimiter" = ${PatternWithDigitsAndDelimiter} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Fruit.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Fruit.ps1 new file mode 100644 index 000000000000..0f25aed96cc8 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Fruit.ps1 @@ -0,0 +1,82 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +Fruit +#> +function ConvertFrom-PSJsonToFruit { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # try to match Apple defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToApple $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Apple" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Apple' defined in oneOf (PSFruit). Proceeding to the next one if any." + } + + # try to match Banana defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToBanana $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Banana" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Banana' defined in oneOf (PSFruit). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([Apple, Banana]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("Apple", "Banana") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Apple, Banana]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/FruitReq.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/FruitReq.ps1 new file mode 100644 index 000000000000..40eaaaf088c4 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/FruitReq.ps1 @@ -0,0 +1,91 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +FruitReq +#> +function ConvertFrom-PSJsonToFruitReq { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # nullable check + if ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { + return [PSCustomObject]@{ + "ActualType" = $null + "ActualInstance" = $null + "OneOfSchemas" = @("AppleReq", "BananaReq") + } + } + + # try to match AppleReq defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToAppleReq $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "AppleReq" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'AppleReq' defined in oneOf (PSFruitReq). Proceeding to the next one if any." + } + + # try to match BananaReq defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToBananaReq $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "BananaReq" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'BananaReq' defined in oneOf (PSFruitReq). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([AppleReq, BananaReq]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("AppleReq", "BananaReq") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([AppleReq, BananaReq]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/GmFruit.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/GmFruit.ps1 new file mode 100644 index 000000000000..ee88e644a359 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/GmFruit.ps1 @@ -0,0 +1,84 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +GmFruit +#> +function ConvertFrom-PSJsonToGmFruit { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + if ($match -ne 0) { # no match yet + # try to match Apple defined in the anyOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToApple $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Apple" + $match++ + break + } + } + } catch { + # fail to match the schema defined in anyOf, proceed to the next one + Write-Debug "Failed to match 'Apple' defined in anyOf (PSGmFruit). Proceeding to the next one if any." + } + } + + if ($match -ne 0) { # no match yet + # try to match Banana defined in the anyOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToBanana $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Banana" + $match++ + break + } + } + } catch { + # fail to match the schema defined in anyOf, proceed to the next one + Write-Debug "Failed to match 'Banana' defined in anyOf (PSGmFruit). Proceeding to the next one if any." + } + } + + if ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "anyOfSchemas" = @("Apple", "Banana") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in anyOf schemas ([Apple, Banana]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/GrandparentAnimal.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/GrandparentAnimal.ps1 new file mode 100644 index 000000000000..2a73a6651f84 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/GrandparentAnimal.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER PetType +No description available. +.OUTPUTS + +GrandparentAnimal +#> + +function Initialize-PSGrandparentAnimal { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${PetType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSGrandparentAnimal' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $PetType) { + throw "invalid value for 'PetType', 'PetType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "pet_type" = ${PetType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to GrandparentAnimal + +.DESCRIPTION + +Convert from JSON to GrandparentAnimal + +.PARAMETER Json + +Json object + +.OUTPUTS + +GrandparentAnimal +#> +function ConvertFrom-PSJsonToGrandparentAnimal { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSGrandparentAnimal' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSGrandparentAnimal + $AllProperties = ("pet_type") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'pet_type' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "pet_type"))) { + throw "Error! JSON cannot be serialized due to the required property 'pet_type' missing." + } else { + $PetType = $JsonParameters.PSobject.Properties["pet_type"].value + } + + $PSO = [PSCustomObject]@{ + "pet_type" = ${PetType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/HasOnlyReadOnly.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/HasOnlyReadOnly.ps1 new file mode 100644 index 000000000000..5a92c3469177 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/HasOnlyReadOnly.ps1 @@ -0,0 +1,110 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Bar +No description available. +.PARAMETER Foo +No description available. +.OUTPUTS + +HasOnlyReadOnly +#> + +function Initialize-PSHasOnlyReadOnly { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Bar}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${Foo} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSHasOnlyReadOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "bar" = ${Bar} + "foo" = ${Foo} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to HasOnlyReadOnly + +.DESCRIPTION + +Convert from JSON to HasOnlyReadOnly + +.PARAMETER Json + +Json object + +.OUTPUTS + +HasOnlyReadOnly +#> +function ConvertFrom-PSJsonToHasOnlyReadOnly { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSHasOnlyReadOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSHasOnlyReadOnly + $AllProperties = ("bar", "foo") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "bar"))) { #optional property not found + $Bar = $null + } else { + $Bar = $JsonParameters.PSobject.Properties["bar"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "foo"))) { #optional property not found + $Foo = $null + } else { + $Foo = $JsonParameters.PSobject.Properties["foo"].value + } + + $PSO = [PSCustomObject]@{ + "bar" = ${Bar} + "foo" = ${Foo} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/HealthCheckResult.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/HealthCheckResult.ps1 new file mode 100644 index 000000000000..fc87580b895c --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/HealthCheckResult.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +.PARAMETER NullableMessage +No description available. +.OUTPUTS + +HealthCheckResult +#> + +function Initialize-PSHealthCheckResult { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${NullableMessage} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSHealthCheckResult' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "NullableMessage" = ${NullableMessage} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to HealthCheckResult + +.DESCRIPTION + +Convert from JSON to HealthCheckResult + +.PARAMETER Json + +Json object + +.OUTPUTS + +HealthCheckResult +#> +function ConvertFrom-PSJsonToHealthCheckResult { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSHealthCheckResult' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSHealthCheckResult + $AllProperties = ("NullableMessage") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "NullableMessage"))) { #optional property not found + $NullableMessage = $null + } else { + $NullableMessage = $JsonParameters.PSobject.Properties["NullableMessage"].value + } + + $PSO = [PSCustomObject]@{ + "NullableMessage" = ${NullableMessage} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineResponseDefault.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineResponseDefault.ps1 new file mode 100644 index 000000000000..382bb408adda --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineResponseDefault.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER String +No description available. +.OUTPUTS + +InlineResponseDefault +#> + +function Initialize-PSInlineResponseDefault { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${String} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSInlineResponseDefault' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "string" = ${String} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to InlineResponseDefault + +.DESCRIPTION + +Convert from JSON to InlineResponseDefault + +.PARAMETER Json + +Json object + +.OUTPUTS + +InlineResponseDefault +#> +function ConvertFrom-PSJsonToInlineResponseDefault { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSInlineResponseDefault' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSInlineResponseDefault + $AllProperties = ("string") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "string"))) { #optional property not found + $String = $null + } else { + $String = $JsonParameters.PSobject.Properties["string"].value + } + + $PSO = [PSCustomObject]@{ + "string" = ${String} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/IsoscelesTriangle.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/IsoscelesTriangle.ps1 new file mode 100644 index 000000000000..14aeb22beb81 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/IsoscelesTriangle.ps1 @@ -0,0 +1,122 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ShapeType +No description available. +.PARAMETER TriangleType +No description available. +.OUTPUTS + +IsoscelesTriangle +#> + +function Initialize-PSIsoscelesTriangle { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ShapeType}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${TriangleType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSIsoscelesTriangle' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ShapeType) { + throw "invalid value for 'ShapeType', 'ShapeType' cannot be null." + } + + if ($null -eq $TriangleType) { + throw "invalid value for 'TriangleType', 'TriangleType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "triangleType" = ${TriangleType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to IsoscelesTriangle + +.DESCRIPTION + +Convert from JSON to IsoscelesTriangle + +.PARAMETER Json + +Json object + +.OUTPUTS + +IsoscelesTriangle +#> +function ConvertFrom-PSJsonToIsoscelesTriangle { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSIsoscelesTriangle' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSIsoscelesTriangle + $AllProperties = ("shapeType", "triangleType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'shapeType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeType"))) { + throw "Error! JSON cannot be serialized due to the required property 'shapeType' missing." + } else { + $ShapeType = $JsonParameters.PSobject.Properties["shapeType"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "triangleType"))) { + throw "Error! JSON cannot be serialized due to the required property 'triangleType' missing." + } else { + $TriangleType = $JsonParameters.PSobject.Properties["triangleType"].value + } + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "triangleType" = ${TriangleType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/List.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/List.ps1 new file mode 100644 index 000000000000..5691aa037eaa --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/List.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Var123List +No description available. +.OUTPUTS + +List +#> + +function Initialize-PSList { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Var123List} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSList' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "123-list" = ${Var123List} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to List + +.DESCRIPTION + +Convert from JSON to List + +.PARAMETER Json + +Json object + +.OUTPUTS + +List +#> +function ConvertFrom-PSJsonToList { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSList' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSList + $AllProperties = ("123-list") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "123-list"))) { #optional property not found + $Var123List = $null + } else { + $Var123List = $JsonParameters.PSobject.Properties["123-list"].value + } + + $PSO = [PSCustomObject]@{ + "123-list" = ${Var123List} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Mammal.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Mammal.ps1 new file mode 100644 index 000000000000..21d8e373f588 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Mammal.ps1 @@ -0,0 +1,98 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +Mammal +#> +function ConvertFrom-PSJsonToMammal { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # try to match Pig defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToPig $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Pig" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Pig' defined in oneOf (PSMammal). Proceeding to the next one if any." + } + + # try to match Whale defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToWhale $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Whale" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Whale' defined in oneOf (PSMammal). Proceeding to the next one if any." + } + + # try to match Zebra defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToZebra $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Zebra" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Zebra' defined in oneOf (PSMammal). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([Pig, Whale, Zebra]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("Pig", "Whale", "Zebra") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Pig, Whale, Zebra]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/MapTest.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/MapTest.ps1 new file mode 100644 index 000000000000..1bbd680d68cc --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/MapTest.ps1 @@ -0,0 +1,137 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER MapMapOfString +No description available. +.PARAMETER MapOfEnumString +No description available. +.PARAMETER DirectMap +No description available. +.PARAMETER IndirectMap +No description available. +.OUTPUTS + +MapTest +#> + +function Initialize-PSMapTest { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${MapMapOfString}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("UPPER", "lower")] + [System.Collections.Hashtable] + ${MapOfEnumString}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${DirectMap}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${IndirectMap} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSMapTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "map_map_of_string" = ${MapMapOfString} + "map_of_enum_string" = ${MapOfEnumString} + "direct_map" = ${DirectMap} + "indirect_map" = ${IndirectMap} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to MapTest + +.DESCRIPTION + +Convert from JSON to MapTest + +.PARAMETER Json + +Json object + +.OUTPUTS + +MapTest +#> +function ConvertFrom-PSJsonToMapTest { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSMapTest' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSMapTest + $AllProperties = ("map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_map_of_string"))) { #optional property not found + $MapMapOfString = $null + } else { + $MapMapOfString = $JsonParameters.PSobject.Properties["map_map_of_string"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map_of_enum_string"))) { #optional property not found + $MapOfEnumString = $null + } else { + $MapOfEnumString = $JsonParameters.PSobject.Properties["map_of_enum_string"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "direct_map"))) { #optional property not found + $DirectMap = $null + } else { + $DirectMap = $JsonParameters.PSobject.Properties["direct_map"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "indirect_map"))) { #optional property not found + $IndirectMap = $null + } else { + $IndirectMap = $JsonParameters.PSobject.Properties["indirect_map"].value + } + + $PSO = [PSCustomObject]@{ + "map_map_of_string" = ${MapMapOfString} + "map_of_enum_string" = ${MapOfEnumString} + "direct_map" = ${DirectMap} + "indirect_map" = ${IndirectMap} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/MixedPropertiesAndAdditionalPropertiesClass.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/MixedPropertiesAndAdditionalPropertiesClass.ps1 new file mode 100644 index 000000000000..d8bd97ded588 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/MixedPropertiesAndAdditionalPropertiesClass.ps1 @@ -0,0 +1,123 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Uuid +No description available. +.PARAMETER DateTime +No description available. +.PARAMETER Map +No description available. +.OUTPUTS + +MixedPropertiesAndAdditionalPropertiesClass +#> + +function Initialize-PSMixedPropertiesAndAdditionalPropertiesClass { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Uuid}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.DateTime]] + ${DateTime}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${Map} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSMixedPropertiesAndAdditionalPropertiesClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "uuid" = ${Uuid} + "dateTime" = ${DateTime} + "map" = ${Map} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to MixedPropertiesAndAdditionalPropertiesClass + +.DESCRIPTION + +Convert from JSON to MixedPropertiesAndAdditionalPropertiesClass + +.PARAMETER Json + +Json object + +.OUTPUTS + +MixedPropertiesAndAdditionalPropertiesClass +#> +function ConvertFrom-PSJsonToMixedPropertiesAndAdditionalPropertiesClass { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSMixedPropertiesAndAdditionalPropertiesClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSMixedPropertiesAndAdditionalPropertiesClass + $AllProperties = ("uuid", "dateTime", "map") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "uuid"))) { #optional property not found + $Uuid = $null + } else { + $Uuid = $JsonParameters.PSobject.Properties["uuid"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "dateTime"))) { #optional property not found + $DateTime = $null + } else { + $DateTime = $JsonParameters.PSobject.Properties["dateTime"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "map"))) { #optional property not found + $Map = $null + } else { + $Map = $JsonParameters.PSobject.Properties["map"].value + } + + $PSO = [PSCustomObject]@{ + "uuid" = ${Uuid} + "dateTime" = ${DateTime} + "map" = ${Map} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Model200Response.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Model200Response.ps1 new file mode 100644 index 000000000000..27a61d0fb48a --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Model200Response.ps1 @@ -0,0 +1,110 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +Model for testing model name starting with number + +.PARAMETER Name +No description available. +.PARAMETER Class +No description available. +.OUTPUTS + +Model200Response +#> + +function Initialize-PSModel200Response { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${Name}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${Class} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSModel200Response' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + "class" = ${Class} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Model200Response + +.DESCRIPTION + +Convert from JSON to Model200Response + +.PARAMETER Json + +Json object + +.OUTPUTS + +Model200Response +#> +function ConvertFrom-PSJsonToModel200Response { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSModel200Response' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSModel200Response + $AllProperties = ("name", "class") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found + $Name = $null + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "class"))) { #optional property not found + $Class = $null + } else { + $Class = $JsonParameters.PSobject.Properties["class"].value + } + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + "class" = ${Class} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ModelReturn.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ModelReturn.ps1 new file mode 100644 index 000000000000..1a45745f0f26 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ModelReturn.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +Model for testing reserved words + +.PARAMETER VarReturn +No description available. +.OUTPUTS + +ModelReturn +#> + +function Initialize-PSModelReturn { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${VarReturn} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSModelReturn' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "return" = ${VarReturn} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ModelReturn + +.DESCRIPTION + +Convert from JSON to ModelReturn + +.PARAMETER Json + +Json object + +.OUTPUTS + +ModelReturn +#> +function ConvertFrom-PSJsonToModelReturn { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSModelReturn' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSModelReturn + $AllProperties = ("return") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "return"))) { #optional property not found + $VarReturn = $null + } else { + $VarReturn = $JsonParameters.PSobject.Properties["return"].value + } + + $PSO = [PSCustomObject]@{ + "return" = ${VarReturn} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Name.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Name.ps1 new file mode 100644 index 000000000000..44a74e598846 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Name.ps1 @@ -0,0 +1,144 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +Model for testing model name same as property name + +.PARAMETER Name +No description available. +.PARAMETER SnakeCase +No description available. +.PARAMETER Property +No description available. +.PARAMETER Var123Number +No description available. +.OUTPUTS + +Name +#> + +function Initialize-PSName { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [Int32] + ${Name}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${SnakeCase}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [String] + ${Property}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${Var123Number} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSName' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $Name) { + throw "invalid value for 'Name', 'Name' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + "snake_case" = ${SnakeCase} + "property" = ${Property} + "123Number" = ${Var123Number} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Name + +.DESCRIPTION + +Convert from JSON to Name + +.PARAMETER Json + +Json object + +.OUTPUTS + +Name +#> +function ConvertFrom-PSJsonToName { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSName' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSName + $AllProperties = ("name", "snake_case", "property", "123Number") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'name' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { + throw "Error! JSON cannot be serialized due to the required property 'name' missing." + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "snake_case"))) { #optional property not found + $SnakeCase = $null + } else { + $SnakeCase = $JsonParameters.PSobject.Properties["snake_case"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "property"))) { #optional property not found + $Property = $null + } else { + $Property = $JsonParameters.PSobject.Properties["property"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "123Number"))) { #optional property not found + $Var123Number = $null + } else { + $Var123Number = $JsonParameters.PSobject.Properties["123Number"].value + } + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + "snake_case" = ${SnakeCase} + "property" = ${Property} + "123Number" = ${Var123Number} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/NullableClass.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/NullableClass.ps1 new file mode 100644 index 000000000000..21755910978e --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/NullableClass.ps1 @@ -0,0 +1,240 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER IntegerProp +No description available. +.PARAMETER NumberProp +No description available. +.PARAMETER BooleanProp +No description available. +.PARAMETER StringProp +No description available. +.PARAMETER DateProp +No description available. +.PARAMETER DatetimeProp +No description available. +.PARAMETER ArrayNullableProp +No description available. +.PARAMETER ArrayAndItemsNullableProp +No description available. +.PARAMETER ArrayItemsNullable +No description available. +.PARAMETER ObjectNullableProp +No description available. +.PARAMETER ObjectAndItemsNullableProp +No description available. +.PARAMETER ObjectItemsNullable +No description available. +.OUTPUTS + +NullableClass +#> + +function Initialize-PSNullableClass { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int32]] + ${IntegerProp}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Decimal]] + ${NumberProp}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${BooleanProp}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [String] + ${StringProp}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.DateTime]] + ${DateProp}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.DateTime]] + ${DatetimeProp}, + [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[]] + ${ArrayNullableProp}, + [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[]] + ${ArrayAndItemsNullableProp}, + [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[]] + ${ArrayItemsNullable}, + [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${ObjectNullableProp}, + [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${ObjectAndItemsNullableProp}, + [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)] + [System.Collections.Hashtable] + ${ObjectItemsNullable} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSNullableClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "integer_prop" = ${IntegerProp} + "number_prop" = ${NumberProp} + "boolean_prop" = ${BooleanProp} + "string_prop" = ${StringProp} + "date_prop" = ${DateProp} + "datetime_prop" = ${DatetimeProp} + "array_nullable_prop" = ${ArrayNullableProp} + "array_and_items_nullable_prop" = ${ArrayAndItemsNullableProp} + "array_items_nullable" = ${ArrayItemsNullable} + "object_nullable_prop" = ${ObjectNullableProp} + "object_and_items_nullable_prop" = ${ObjectAndItemsNullableProp} + "object_items_nullable" = ${ObjectItemsNullable} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to NullableClass + +.DESCRIPTION + +Convert from JSON to NullableClass + +.PARAMETER Json + +Json object + +.OUTPUTS + +NullableClass +#> +function ConvertFrom-PSJsonToNullableClass { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSNullableClass' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSNullableClass + $AllProperties = ("integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "integer_prop"))) { #optional property not found + $IntegerProp = $null + } else { + $IntegerProp = $JsonParameters.PSobject.Properties["integer_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "number_prop"))) { #optional property not found + $NumberProp = $null + } else { + $NumberProp = $JsonParameters.PSobject.Properties["number_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "boolean_prop"))) { #optional property not found + $BooleanProp = $null + } else { + $BooleanProp = $JsonParameters.PSobject.Properties["boolean_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "string_prop"))) { #optional property not found + $StringProp = $null + } else { + $StringProp = $JsonParameters.PSobject.Properties["string_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "date_prop"))) { #optional property not found + $DateProp = $null + } else { + $DateProp = $JsonParameters.PSobject.Properties["date_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "datetime_prop"))) { #optional property not found + $DatetimeProp = $null + } else { + $DatetimeProp = $JsonParameters.PSobject.Properties["datetime_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_nullable_prop"))) { #optional property not found + $ArrayNullableProp = $null + } else { + $ArrayNullableProp = $JsonParameters.PSobject.Properties["array_nullable_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_and_items_nullable_prop"))) { #optional property not found + $ArrayAndItemsNullableProp = $null + } else { + $ArrayAndItemsNullableProp = $JsonParameters.PSobject.Properties["array_and_items_nullable_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "array_items_nullable"))) { #optional property not found + $ArrayItemsNullable = $null + } else { + $ArrayItemsNullable = $JsonParameters.PSobject.Properties["array_items_nullable"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "object_nullable_prop"))) { #optional property not found + $ObjectNullableProp = $null + } else { + $ObjectNullableProp = $JsonParameters.PSobject.Properties["object_nullable_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "object_and_items_nullable_prop"))) { #optional property not found + $ObjectAndItemsNullableProp = $null + } else { + $ObjectAndItemsNullableProp = $JsonParameters.PSobject.Properties["object_and_items_nullable_prop"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "object_items_nullable"))) { #optional property not found + $ObjectItemsNullable = $null + } else { + $ObjectItemsNullable = $JsonParameters.PSobject.Properties["object_items_nullable"].value + } + + $PSO = [PSCustomObject]@{ + "integer_prop" = ${IntegerProp} + "number_prop" = ${NumberProp} + "boolean_prop" = ${BooleanProp} + "string_prop" = ${StringProp} + "date_prop" = ${DateProp} + "datetime_prop" = ${DatetimeProp} + "array_nullable_prop" = ${ArrayNullableProp} + "array_and_items_nullable_prop" = ${ArrayAndItemsNullableProp} + "array_items_nullable" = ${ArrayItemsNullable} + "object_nullable_prop" = ${ObjectNullableProp} + "object_and_items_nullable_prop" = ${ObjectAndItemsNullableProp} + "object_items_nullable" = ${ObjectItemsNullable} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/NullableShape.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/NullableShape.ps1 new file mode 100644 index 000000000000..c7a12cb8cf95 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/NullableShape.ps1 @@ -0,0 +1,91 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +NullableShape +#> +function ConvertFrom-PSJsonToNullableShape { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # nullable check + if ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { + return [PSCustomObject]@{ + "ActualType" = $null + "ActualInstance" = $null + "OneOfSchemas" = @("Quadrilateral", "Triangle") + } + } + + # try to match Quadrilateral defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToQuadrilateral $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Quadrilateral" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Quadrilateral' defined in oneOf (PSNullableShape). Proceeding to the next one if any." + } + + # try to match Triangle defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToTriangle $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Triangle" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Triangle' defined in oneOf (PSNullableShape). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([Quadrilateral, Triangle]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("Quadrilateral", "Triangle") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Quadrilateral, Triangle]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/NumberOnly.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/NumberOnly.ps1 new file mode 100644 index 000000000000..d90506edf63c --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/NumberOnly.ps1 @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER JustNumber +No description available. +.OUTPUTS + +NumberOnly +#> + +function Initialize-PSNumberOnly { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Decimal]] + ${JustNumber} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSNumberOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "JustNumber" = ${JustNumber} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to NumberOnly + +.DESCRIPTION + +Convert from JSON to NumberOnly + +.PARAMETER Json + +Json object + +.OUTPUTS + +NumberOnly +#> +function ConvertFrom-PSJsonToNumberOnly { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSNumberOnly' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSNumberOnly + $AllProperties = ("JustNumber") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "JustNumber"))) { #optional property not found + $JustNumber = $null + } else { + $JustNumber = $JsonParameters.PSobject.Properties["JustNumber"].value + } + + $PSO = [PSCustomObject]@{ + "JustNumber" = ${JustNumber} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ObjectWithDeprecatedFields.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ObjectWithDeprecatedFields.ps1 new file mode 100644 index 000000000000..22d222edeb0e --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ObjectWithDeprecatedFields.ps1 @@ -0,0 +1,136 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Uuid +No description available. +.PARAMETER Id +No description available. +.PARAMETER DeprecatedRef +No description available. +.PARAMETER Bars +No description available. +.OUTPUTS + +ObjectWithDeprecatedFields +#> + +function Initialize-PSObjectWithDeprecatedFields { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Uuid}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Decimal]] + ${Id}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${DeprecatedRef}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [String[]] + ${Bars} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSObjectWithDeprecatedFields' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "uuid" = ${Uuid} + "id" = ${Id} + "deprecatedRef" = ${DeprecatedRef} + "bars" = ${Bars} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ObjectWithDeprecatedFields + +.DESCRIPTION + +Convert from JSON to ObjectWithDeprecatedFields + +.PARAMETER Json + +Json object + +.OUTPUTS + +ObjectWithDeprecatedFields +#> +function ConvertFrom-PSJsonToObjectWithDeprecatedFields { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSObjectWithDeprecatedFields' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSObjectWithDeprecatedFields + $AllProperties = ("uuid", "id", "deprecatedRef", "bars") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "uuid"))) { #optional property not found + $Uuid = $null + } else { + $Uuid = $JsonParameters.PSobject.Properties["uuid"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "deprecatedRef"))) { #optional property not found + $DeprecatedRef = $null + } else { + $DeprecatedRef = $JsonParameters.PSobject.Properties["deprecatedRef"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "bars"))) { #optional property not found + $Bars = $null + } else { + $Bars = $JsonParameters.PSobject.Properties["bars"].value + } + + $PSO = [PSCustomObject]@{ + "uuid" = ${Uuid} + "id" = ${Id} + "deprecatedRef" = ${DeprecatedRef} + "bars" = ${Bars} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 index 1b931e6b197f..991563dad427 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -12,7 +12,7 @@ No summary available. .DESCRIPTION -An order for a pets from the pet store +No description available. .PARAMETER Id No description available. diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/OuterComposite.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/OuterComposite.ps1 new file mode 100644 index 000000000000..7b695edfa5b3 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/OuterComposite.ps1 @@ -0,0 +1,123 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER MyNumber +No description available. +.PARAMETER MyString +No description available. +.PARAMETER MyBoolean +No description available. +.OUTPUTS + +OuterComposite +#> + +function Initialize-PSOuterComposite { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Decimal]] + ${MyNumber}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${MyString}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${MyBoolean} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSOuterComposite' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "my_number" = ${MyNumber} + "my_string" = ${MyString} + "my_boolean" = ${MyBoolean} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to OuterComposite + +.DESCRIPTION + +Convert from JSON to OuterComposite + +.PARAMETER Json + +Json object + +.OUTPUTS + +OuterComposite +#> +function ConvertFrom-PSJsonToOuterComposite { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSOuterComposite' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSOuterComposite + $AllProperties = ("my_number", "my_string", "my_boolean") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "my_number"))) { #optional property not found + $MyNumber = $null + } else { + $MyNumber = $JsonParameters.PSobject.Properties["my_number"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "my_string"))) { #optional property not found + $MyString = $null + } else { + $MyString = $JsonParameters.PSobject.Properties["my_string"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "my_boolean"))) { #optional property not found + $MyBoolean = $null + } else { + $MyBoolean = $JsonParameters.PSobject.Properties["my_boolean"].value + } + + $PSO = [PSCustomObject]@{ + "my_number" = ${MyNumber} + "my_string" = ${MyString} + "my_boolean" = ${MyBoolean} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ParentPet.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ParentPet.ps1 new file mode 100644 index 000000000000..4b985cbec0ca --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ParentPet.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER PetType +No description available. +.OUTPUTS + +ParentPet +#> + +function Initialize-PSParentPet { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${PetType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSParentPet' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $PetType) { + throw "invalid value for 'PetType', 'PetType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "pet_type" = ${PetType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ParentPet + +.DESCRIPTION + +Convert from JSON to ParentPet + +.PARAMETER Json + +Json object + +.OUTPUTS + +ParentPet +#> +function ConvertFrom-PSJsonToParentPet { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSParentPet' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSParentPet + $AllProperties = ("pet_type") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'pet_type' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "pet_type"))) { + throw "Error! JSON cannot be serialized due to the required property 'pet_type' missing." + } else { + $PetType = $JsonParameters.PSobject.Properties["pet_type"].value + } + + $PSO = [PSCustomObject]@{ + "pet_type" = ${PetType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 index 5207e6986f6e..18e5e39c684f 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -12,7 +12,7 @@ No summary available. .DESCRIPTION -A pet for sale in the pet store +No description available. .PARAMETER Id No description available. diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/PetWithRequiredTags.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/PetWithRequiredTags.ps1 new file mode 100644 index 000000000000..af9595746385 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/PetWithRequiredTags.ps1 @@ -0,0 +1,179 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Id +No description available. +.PARAMETER Category +No description available. +.PARAMETER Name +No description available. +.PARAMETER PhotoUrls +No description available. +.PARAMETER Tags +No description available. +.PARAMETER Status +pet status in the store +.OUTPUTS + +PetWithRequiredTags +#> + +function Initialize-PSPetWithRequiredTags { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int64]] + ${Id}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${Category}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [String] + ${Name}, + [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] + [String[]] + ${PhotoUrls}, + [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject[]] + ${Tags}, + [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("available", "pending", "sold")] + [String] + ${Status} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSPetWithRequiredTags' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $Name) { + throw "invalid value for 'Name', 'Name' cannot be null." + } + + if ($null -eq $PhotoUrls) { + throw "invalid value for 'PhotoUrls', 'PhotoUrls' cannot be null." + } + + if ($null -eq $Tags) { + throw "invalid value for 'Tags', 'Tags' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "category" = ${Category} + "name" = ${Name} + "photoUrls" = ${PhotoUrls} + "tags" = ${Tags} + "status" = ${Status} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to PetWithRequiredTags + +.DESCRIPTION + +Convert from JSON to PetWithRequiredTags + +.PARAMETER Json + +Json object + +.OUTPUTS + +PetWithRequiredTags +#> +function ConvertFrom-PSJsonToPetWithRequiredTags { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSPetWithRequiredTags' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSPetWithRequiredTags + $AllProperties = ("id", "category", "name", "photoUrls", "tags", "status") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'name' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { + throw "Error! JSON cannot be serialized due to the required property 'name' missing." + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "photoUrls"))) { + throw "Error! JSON cannot be serialized due to the required property 'photoUrls' missing." + } else { + $PhotoUrls = $JsonParameters.PSobject.Properties["photoUrls"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "tags"))) { + throw "Error! JSON cannot be serialized due to the required property 'tags' missing." + } else { + $Tags = $JsonParameters.PSobject.Properties["tags"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "category"))) { #optional property not found + $Category = $null + } else { + $Category = $JsonParameters.PSobject.Properties["category"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { #optional property not found + $Status = $null + } else { + $Status = $JsonParameters.PSobject.Properties["status"].value + } + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "category" = ${Category} + "name" = ${Name} + "photoUrls" = ${PhotoUrls} + "tags" = ${Tags} + "status" = ${Status} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Pig.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Pig.ps1 new file mode 100644 index 000000000000..7d65ffdeb926 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Pig.ps1 @@ -0,0 +1,82 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +Pig +#> +function ConvertFrom-PSJsonToPig { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # try to match BasquePig defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToBasquePig $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "BasquePig" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'BasquePig' defined in oneOf (PSPig). Proceeding to the next one if any." + } + + # try to match DanishPig defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToDanishPig $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "DanishPig" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'DanishPig' defined in oneOf (PSPig). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([BasquePig, DanishPig]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("BasquePig", "DanishPig") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([BasquePig, DanishPig]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Quadrilateral.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Quadrilateral.ps1 new file mode 100644 index 000000000000..86c8f1742553 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Quadrilateral.ps1 @@ -0,0 +1,82 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +Quadrilateral +#> +function ConvertFrom-PSJsonToQuadrilateral { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # try to match ComplexQuadrilateral defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToComplexQuadrilateral $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "ComplexQuadrilateral" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'ComplexQuadrilateral' defined in oneOf (PSQuadrilateral). Proceeding to the next one if any." + } + + # try to match SimpleQuadrilateral defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToSimpleQuadrilateral $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "SimpleQuadrilateral" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'SimpleQuadrilateral' defined in oneOf (PSQuadrilateral). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([ComplexQuadrilateral, SimpleQuadrilateral]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("ComplexQuadrilateral", "SimpleQuadrilateral") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([ComplexQuadrilateral, SimpleQuadrilateral]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/QuadrilateralInterface.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/QuadrilateralInterface.ps1 new file mode 100644 index 000000000000..31903af8c6a2 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/QuadrilateralInterface.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER QuadrilateralType +No description available. +.OUTPUTS + +QuadrilateralInterface +#> + +function Initialize-PSQuadrilateralInterface { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${QuadrilateralType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSQuadrilateralInterface' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $QuadrilateralType) { + throw "invalid value for 'QuadrilateralType', 'QuadrilateralType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "quadrilateralType" = ${QuadrilateralType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to QuadrilateralInterface + +.DESCRIPTION + +Convert from JSON to QuadrilateralInterface + +.PARAMETER Json + +Json object + +.OUTPUTS + +QuadrilateralInterface +#> +function ConvertFrom-PSJsonToQuadrilateralInterface { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSQuadrilateralInterface' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSQuadrilateralInterface + $AllProperties = ("quadrilateralType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'quadrilateralType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "quadrilateralType"))) { + throw "Error! JSON cannot be serialized due to the required property 'quadrilateralType' missing." + } else { + $QuadrilateralType = $JsonParameters.PSobject.Properties["quadrilateralType"].value + } + + $PSO = [PSCustomObject]@{ + "quadrilateralType" = ${QuadrilateralType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ReadOnlyFirst.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ReadOnlyFirst.ps1 new file mode 100644 index 000000000000..b400e18374f6 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ReadOnlyFirst.ps1 @@ -0,0 +1,110 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Bar +No description available. +.PARAMETER Baz +No description available. +.OUTPUTS + +ReadOnlyFirst +#> + +function Initialize-PSReadOnlyFirst { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${Bar}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${Baz} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSReadOnlyFirst' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "bar" = ${Bar} + "baz" = ${Baz} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ReadOnlyFirst + +.DESCRIPTION + +Convert from JSON to ReadOnlyFirst + +.PARAMETER Json + +Json object + +.OUTPUTS + +ReadOnlyFirst +#> +function ConvertFrom-PSJsonToReadOnlyFirst { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSReadOnlyFirst' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSReadOnlyFirst + $AllProperties = ("bar", "baz") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "bar"))) { #optional property not found + $Bar = $null + } else { + $Bar = $JsonParameters.PSobject.Properties["bar"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "baz"))) { #optional property not found + $Baz = $null + } else { + $Baz = $JsonParameters.PSobject.Properties["baz"].value + } + + $PSO = [PSCustomObject]@{ + "bar" = ${Bar} + "baz" = ${Baz} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ScaleneTriangle.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ScaleneTriangle.ps1 new file mode 100644 index 000000000000..1bc425954b89 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ScaleneTriangle.ps1 @@ -0,0 +1,122 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ShapeType +No description available. +.PARAMETER TriangleType +No description available. +.OUTPUTS + +ScaleneTriangle +#> + +function Initialize-PSScaleneTriangle { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ShapeType}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${TriangleType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSScaleneTriangle' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ShapeType) { + throw "invalid value for 'ShapeType', 'ShapeType' cannot be null." + } + + if ($null -eq $TriangleType) { + throw "invalid value for 'TriangleType', 'TriangleType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "triangleType" = ${TriangleType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ScaleneTriangle + +.DESCRIPTION + +Convert from JSON to ScaleneTriangle + +.PARAMETER Json + +Json object + +.OUTPUTS + +ScaleneTriangle +#> +function ConvertFrom-PSJsonToScaleneTriangle { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSScaleneTriangle' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSScaleneTriangle + $AllProperties = ("shapeType", "triangleType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'shapeType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeType"))) { + throw "Error! JSON cannot be serialized due to the required property 'shapeType' missing." + } else { + $ShapeType = $JsonParameters.PSobject.Properties["shapeType"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "triangleType"))) { + throw "Error! JSON cannot be serialized due to the required property 'triangleType' missing." + } else { + $TriangleType = $JsonParameters.PSobject.Properties["triangleType"].value + } + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "triangleType" = ${TriangleType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Shape.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Shape.ps1 new file mode 100644 index 000000000000..babd880c4857 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Shape.ps1 @@ -0,0 +1,82 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +Shape +#> +function ConvertFrom-PSJsonToShape { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # try to match Quadrilateral defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToQuadrilateral $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Quadrilateral" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Quadrilateral' defined in oneOf (PSShape). Proceeding to the next one if any." + } + + # try to match Triangle defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToTriangle $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Triangle" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Triangle' defined in oneOf (PSShape). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([Quadrilateral, Triangle]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("Quadrilateral", "Triangle") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Quadrilateral, Triangle]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ShapeInterface.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ShapeInterface.ps1 new file mode 100644 index 000000000000..58865bc4a5f5 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ShapeInterface.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ShapeType +No description available. +.OUTPUTS + +ShapeInterface +#> + +function Initialize-PSShapeInterface { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ShapeType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSShapeInterface' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ShapeType) { + throw "invalid value for 'ShapeType', 'ShapeType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to ShapeInterface + +.DESCRIPTION + +Convert from JSON to ShapeInterface + +.PARAMETER Json + +Json object + +.OUTPUTS + +ShapeInterface +#> +function ConvertFrom-PSJsonToShapeInterface { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSShapeInterface' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSShapeInterface + $AllProperties = ("shapeType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'shapeType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeType"))) { + throw "Error! JSON cannot be serialized due to the required property 'shapeType' missing." + } else { + $ShapeType = $JsonParameters.PSobject.Properties["shapeType"].value + } + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ShapeOrNull.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ShapeOrNull.ps1 new file mode 100644 index 000000000000..e630c4806ec1 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ShapeOrNull.ps1 @@ -0,0 +1,91 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +ShapeOrNull +#> +function ConvertFrom-PSJsonToShapeOrNull { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # nullable check + if ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { + return [PSCustomObject]@{ + "ActualType" = $null + "ActualInstance" = $null + "OneOfSchemas" = @("Quadrilateral", "Triangle") + } + } + + # try to match Quadrilateral defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToQuadrilateral $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Quadrilateral" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Quadrilateral' defined in oneOf (PSShapeOrNull). Proceeding to the next one if any." + } + + # try to match Triangle defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToTriangle $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Triangle" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'Triangle' defined in oneOf (PSShapeOrNull). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([Quadrilateral, Triangle]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("Quadrilateral", "Triangle") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([Quadrilateral, Triangle]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/SimpleQuadrilateral.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/SimpleQuadrilateral.ps1 new file mode 100644 index 000000000000..456dbb50e0c6 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/SimpleQuadrilateral.ps1 @@ -0,0 +1,122 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER ShapeType +No description available. +.PARAMETER QuadrilateralType +No description available. +.OUTPUTS + +SimpleQuadrilateral +#> + +function Initialize-PSSimpleQuadrilateral { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${ShapeType}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${QuadrilateralType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSSimpleQuadrilateral' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ShapeType) { + throw "invalid value for 'ShapeType', 'ShapeType' cannot be null." + } + + if ($null -eq $QuadrilateralType) { + throw "invalid value for 'QuadrilateralType', 'QuadrilateralType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "quadrilateralType" = ${QuadrilateralType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to SimpleQuadrilateral + +.DESCRIPTION + +Convert from JSON to SimpleQuadrilateral + +.PARAMETER Json + +Json object + +.OUTPUTS + +SimpleQuadrilateral +#> +function ConvertFrom-PSJsonToSimpleQuadrilateral { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSSimpleQuadrilateral' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSSimpleQuadrilateral + $AllProperties = ("shapeType", "quadrilateralType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'shapeType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shapeType"))) { + throw "Error! JSON cannot be serialized due to the required property 'shapeType' missing." + } else { + $ShapeType = $JsonParameters.PSobject.Properties["shapeType"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "quadrilateralType"))) { + throw "Error! JSON cannot be serialized due to the required property 'quadrilateralType' missing." + } else { + $QuadrilateralType = $JsonParameters.PSobject.Properties["quadrilateralType"].value + } + + $PSO = [PSCustomObject]@{ + "shapeType" = ${ShapeType} + "quadrilateralType" = ${QuadrilateralType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/SpecialModelName.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/SpecialModelName.ps1 new file mode 100644 index 000000000000..53f76346d130 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/SpecialModelName.ps1 @@ -0,0 +1,110 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER SpecialPropertyName +No description available. +.PARAMETER SpecialModelName +No description available. +.OUTPUTS + +SpecialModelName +#> + +function Initialize-PSSpecialModelName { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Int64]] + ${SpecialPropertyName}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${SpecialModelName} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSSpecialModelName' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + + $PSO = [PSCustomObject]@{ + "$special[property.name]" = ${SpecialPropertyName} + "_special_model.name_" = ${SpecialModelName} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to SpecialModelName + +.DESCRIPTION + +Convert from JSON to SpecialModelName + +.PARAMETER Json + +Json object + +.OUTPUTS + +SpecialModelName +#> +function ConvertFrom-PSJsonToSpecialModelName { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSSpecialModelName' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSSpecialModelName + $AllProperties = ("$special[property.name]", "_special_model.name_") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "$special[property.name]"))) { #optional property not found + $SpecialPropertyName = $null + } else { + $SpecialPropertyName = $JsonParameters.PSobject.Properties["$special[property.name]"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "_special_model.name_"))) { #optional property not found + $SpecialModelName = $null + } else { + $SpecialModelName = $JsonParameters.PSobject.Properties["_special_model.name_"].value + } + + $PSO = [PSCustomObject]@{ + "$special[property.name]" = ${SpecialPropertyName} + "_special_model.name_" = ${SpecialModelName} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 index 5a2d92bdb7c1..4f82edbd99b2 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -12,7 +12,7 @@ No summary available. .DESCRIPTION -A tag for a pet +No description available. .PARAMETER Id No description available. @@ -77,14 +77,12 @@ function ConvertFrom-PSJsonToTag { $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json - $PSTagAdditionalProperties = @{} # check if Json contains properties not defined in PSTag $AllProperties = ("id", "name") foreach ($name in $JsonParameters.PsObject.Properties.Name) { - # store undefined properties in additionalProperties if (!($AllProperties.Contains($name))) { - $PSTagAdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } } @@ -103,7 +101,6 @@ function ConvertFrom-PSJsonToTag { $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} - "AdditionalProperties" = $PSTagAdditionalProperties } return $PSO diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Triangle.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Triangle.ps1 new file mode 100644 index 000000000000..c184b72fed9e --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Triangle.ps1 @@ -0,0 +1,98 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Json + +JSON object + +.OUTPUTS + +Triangle +#> +function ConvertFrom-PSJsonToTriangle { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + # try to match EquilateralTriangle defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToEquilateralTriangle $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "EquilateralTriangle" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'EquilateralTriangle' defined in oneOf (PSTriangle). Proceeding to the next one if any." + } + + # try to match IsoscelesTriangle defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToIsoscelesTriangle $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "IsoscelesTriangle" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'IsoscelesTriangle' defined in oneOf (PSTriangle). Proceeding to the next one if any." + } + + # try to match ScaleneTriangle defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-PSJsonToScaleneTriangle $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "ScaleneTriangle" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match 'ScaleneTriangle' defined in oneOf (PSTriangle). Proceeding to the next one if any." + } + + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ([EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle]). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @("EquilateralTriangle", "IsoscelesTriangle", "ScaleneTriangle") + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ([EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle]). JSON Payload: $($Json)" + } + } +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/TriangleInterface.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/TriangleInterface.ps1 new file mode 100644 index 000000000000..229b67a3f63a --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/TriangleInterface.ps1 @@ -0,0 +1,105 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER TriangleType +No description available. +.OUTPUTS + +TriangleInterface +#> + +function Initialize-PSTriangleInterface { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${TriangleType} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSTriangleInterface' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $TriangleType) { + throw "invalid value for 'TriangleType', 'TriangleType' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "triangleType" = ${TriangleType} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to TriangleInterface + +.DESCRIPTION + +Convert from JSON to TriangleInterface + +.PARAMETER Json + +Json object + +.OUTPUTS + +TriangleInterface +#> +function ConvertFrom-PSJsonToTriangleInterface { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSTriangleInterface' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSTriangleInterface + $AllProperties = ("triangleType") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'triangleType' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "triangleType"))) { + throw "Error! JSON cannot be serialized due to the required property 'triangleType' missing." + } else { + $TriangleType = $JsonParameters.PSobject.Properties["triangleType"].value + } + + $PSO = [PSCustomObject]@{ + "triangleType" = ${TriangleType} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 index a021b75ec4c9..83086452cfe8 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -12,7 +12,7 @@ No summary available. .DESCRIPTION -A User who is purchasing from the pet store +No description available. .PARAMETER Id No description available. @@ -30,6 +30,14 @@ No description available. No description available. .PARAMETER UserStatus User Status +.PARAMETER ObjectWithNoDeclaredProps +test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. +.PARAMETER ObjectWithNoDeclaredPropsNullable +test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. +.PARAMETER AnyTypeProp +test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 +.PARAMETER AnyTypePropNullable +test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. .OUTPUTS User @@ -54,7 +62,6 @@ function Initialize-PSUser { [String] ${Email}, [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] - [ValidatePattern("[""A-Z]+-[0-9][0-9]")] [String] ${Password}, [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)] @@ -62,7 +69,19 @@ function Initialize-PSUser { ${Phone}, [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] - ${UserStatus} + ${UserStatus}, + [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${ObjectWithNoDeclaredProps}, + [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${ObjectWithNoDeclaredPropsNullable}, + [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${AnyTypeProp}, + [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)] + [PSCustomObject] + ${AnyTypePropNullable} ) Process { @@ -79,6 +98,10 @@ function Initialize-PSUser { "password" = ${Password} "phone" = ${Phone} "userStatus" = ${UserStatus} + "objectWithNoDeclaredProps" = ${ObjectWithNoDeclaredProps} + "objectWithNoDeclaredPropsNullable" = ${ObjectWithNoDeclaredPropsNullable} + "anyTypeProp" = ${AnyTypeProp} + "anyTypePropNullable" = ${AnyTypePropNullable} } @@ -116,7 +139,7 @@ function ConvertFrom-PSJsonToUser { $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in PSUser - $AllProperties = ("id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus") + $AllProperties = ("id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypePropNullable") foreach ($name in $JsonParameters.PsObject.Properties.Name) { if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" @@ -171,6 +194,30 @@ function ConvertFrom-PSJsonToUser { $UserStatus = $JsonParameters.PSobject.Properties["userStatus"].value } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "objectWithNoDeclaredProps"))) { #optional property not found + $ObjectWithNoDeclaredProps = $null + } else { + $ObjectWithNoDeclaredProps = $JsonParameters.PSobject.Properties["objectWithNoDeclaredProps"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "objectWithNoDeclaredPropsNullable"))) { #optional property not found + $ObjectWithNoDeclaredPropsNullable = $null + } else { + $ObjectWithNoDeclaredPropsNullable = $JsonParameters.PSobject.Properties["objectWithNoDeclaredPropsNullable"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "anyTypeProp"))) { #optional property not found + $AnyTypeProp = $null + } else { + $AnyTypeProp = $JsonParameters.PSobject.Properties["anyTypeProp"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "anyTypePropNullable"))) { #optional property not found + $AnyTypePropNullable = $null + } else { + $AnyTypePropNullable = $JsonParameters.PSobject.Properties["anyTypePropNullable"].value + } + $PSO = [PSCustomObject]@{ "id" = ${Id} "username" = ${Username} @@ -180,6 +227,10 @@ function ConvertFrom-PSJsonToUser { "password" = ${Password} "phone" = ${Phone} "userStatus" = ${UserStatus} + "objectWithNoDeclaredProps" = ${ObjectWithNoDeclaredProps} + "objectWithNoDeclaredPropsNullable" = ${ObjectWithNoDeclaredPropsNullable} + "anyTypeProp" = ${AnyTypeProp} + "anyTypePropNullable" = ${AnyTypePropNullable} } return $PSO diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Whale.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Whale.ps1 new file mode 100644 index 000000000000..a87cfea4e735 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Whale.ps1 @@ -0,0 +1,131 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER HasBaleen +No description available. +.PARAMETER HasTeeth +No description available. +.PARAMETER ClassName +No description available. +.OUTPUTS + +Whale +#> + +function Initialize-PSWhale { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${HasBaleen}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[Boolean]] + ${HasTeeth}, + [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSWhale' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "hasBaleen" = ${HasBaleen} + "hasTeeth" = ${HasTeeth} + "className" = ${ClassName} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Whale + +.DESCRIPTION + +Convert from JSON to Whale + +.PARAMETER Json + +Json object + +.OUTPUTS + +Whale +#> +function ConvertFrom-PSJsonToWhale { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSWhale' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + # check if Json contains properties not defined in PSWhale + $AllProperties = ("hasBaleen", "hasTeeth", "className") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "hasBaleen"))) { #optional property not found + $HasBaleen = $null + } else { + $HasBaleen = $JsonParameters.PSobject.Properties["hasBaleen"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "hasTeeth"))) { #optional property not found + $HasTeeth = $null + } else { + $HasTeeth = $JsonParameters.PSobject.Properties["hasTeeth"].value + } + + $PSO = [PSCustomObject]@{ + "hasBaleen" = ${HasBaleen} + "hasTeeth" = ${HasTeeth} + "className" = ${ClassName} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Zebra.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Zebra.ps1 new file mode 100644 index 000000000000..5bf388695db0 --- /dev/null +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Zebra.ps1 @@ -0,0 +1,122 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +<# +.SYNOPSIS + +No summary available. + +.DESCRIPTION + +No description available. + +.PARAMETER Type +No description available. +.PARAMETER ClassName +No description available. +.OUTPUTS + +Zebra +#> + +function Initialize-PSZebra { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [ValidateSet("plains", "mountain", "grevys")] + [String] + ${Type}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${ClassName} + ) + + Process { + 'Creating PSCustomObject: PSPetstore => PSZebra' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + if ($null -eq $ClassName) { + throw "invalid value for 'ClassName', 'ClassName' cannot be null." + } + + + $PSO = [PSCustomObject]@{ + "type" = ${Type} + "className" = ${ClassName} + } + + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to Zebra + +.DESCRIPTION + +Convert from JSON to Zebra + +.PARAMETER Json + +Json object + +.OUTPUTS + +Zebra +#> +function ConvertFrom-PSJsonToZebra { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSZebra' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + $PSZebraAdditionalProperties = @{} + + # check if Json contains properties not defined in PSZebra + $AllProperties = ("type", "className") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + # store undefined properties in additionalProperties + if (!($AllProperties.Contains($name))) { + $PSZebraAdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value + } + } + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property 'className' missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "className"))) { + throw "Error! JSON cannot be serialized due to the required property 'className' missing." + } else { + $ClassName = $JsonParameters.PSobject.Properties["className"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { #optional property not found + $Type = $null + } else { + $Type = $JsonParameters.PSobject.Properties["type"].value + } + + $PSO = [PSCustomObject]@{ + "type" = ${Type} + "className" = ${ClassName} + "AdditionalProperties" = $PSZebraAdditionalProperties + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 index 2860418807da..ffe8692ce3b0 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 +++ b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 @@ -3,7 +3,7 @@ # # Generated by: OpenAPI Generator Team # -# Generated on: 10/30/2021 +# Generated on: 04/06/2022 # @{ @@ -69,21 +69,107 @@ PowerShellVersion = '5.0' # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = 'Add-PSPet', 'Remove-Pet', 'Find-PSPetsByStatus', 'Find-PSPetsByTags', +FunctionsToExport = 'Invoke-PS123TestSpecialTags', 'Invoke-PSFooGet', + 'Invoke-PSFakeHealthGet', 'Invoke-PSFakeOuterBooleanSerialize', + 'Invoke-PSFakeOuterCompositeSerialize', + 'Invoke-PSFakeOuterNumberSerialize', + 'Invoke-PSFakeOuterStringSerialize', 'Get-PSArrayOfEnums', + 'Test-PSBodyWithFileSchema', 'Test-PSBodyWithQueryParams', + 'Test-PSClientModel', 'Test-PSEndpointParameters', + 'Test-PSEnumParameters', 'Test-PSGroupParameters', + 'Test-PSInlineAdditionalProperties', 'Test-PSJsonFormData', + 'Test-PSQueryParameterCollectionFormat', 'Test-PSClassname', + 'Add-PSPet', 'Remove-Pet', 'Find-PSPetsByStatus', 'Find-PSPetsByTags', 'Get-PSPetById', 'Update-PSPet', 'Update-PSPetWithForm', - 'Invoke-PSUploadFile', 'Remove-PSOrder', 'Get-PSInventory', - 'Get-PSOrderById', 'Invoke-PSPlaceOrder', 'New-PSUser', - 'New-PSUsersWithArrayInput', 'New-PSUsersWithListInput', - 'Remove-PSUser', 'Get-PSUserByName', 'Invoke-PSLoginUser', - 'Invoke-PSLogoutUser', 'Update-PSUser', 'Initialize-PSApiResponse', - 'ConvertFrom-PSJsonToApiResponse', 'Initialize-PSCategory', - 'ConvertFrom-PSJsonToCategory', 'Initialize-PSInlineObject', - 'ConvertFrom-PSJsonToInlineObject', 'Initialize-PSInlineObject1', - 'ConvertFrom-PSJsonToInlineObject1', 'Initialize-PSOrder', - 'ConvertFrom-PSJsonToOrder', 'Initialize-PSPet', - 'ConvertFrom-PSJsonToPet', 'Initialize-PSTag', - 'ConvertFrom-PSJsonToTag', 'Initialize-PSUser', - 'ConvertFrom-PSJsonToUser', 'Get-PSConfiguration', + 'Invoke-PSUploadFile', 'Invoke-PSUploadFileWithRequiredFile', + 'Remove-PSOrder', 'Get-PSInventory', 'Get-PSOrderById', + 'Invoke-PSPlaceOrder', 'New-PSUser', 'New-PSUsersWithArrayInput', + 'New-PSUsersWithListInput', 'Remove-PSUser', 'Get-PSUserByName', + 'Invoke-PSLoginUser', 'Invoke-PSLogoutUser', 'Update-PSUser', + 'Initialize-PSAdditionalPropertiesClass', + 'ConvertFrom-PSJsonToAdditionalPropertiesClass', + 'Initialize-PSAnimal', 'ConvertFrom-PSJsonToAnimal', + 'Initialize-PSApiResponse', 'ConvertFrom-PSJsonToApiResponse', + 'Initialize-PSApple', 'ConvertFrom-PSJsonToApple', + 'Initialize-PSAppleReq', 'ConvertFrom-PSJsonToAppleReq', + 'Initialize-PSArrayOfArrayOfNumberOnly', + 'ConvertFrom-PSJsonToArrayOfArrayOfNumberOnly', + 'Initialize-PSArrayOfNumberOnly', + 'ConvertFrom-PSJsonToArrayOfNumberOnly', 'Initialize-PSArrayTest', + 'ConvertFrom-PSJsonToArrayTest', 'Initialize-PSBanana', + 'ConvertFrom-PSJsonToBanana', 'Initialize-PSBananaReq', + 'ConvertFrom-PSJsonToBananaReq', 'Initialize-PSBasquePig', + 'ConvertFrom-PSJsonToBasquePig', 'Initialize-PSCapitalization', + 'ConvertFrom-PSJsonToCapitalization', 'Initialize-PSCat', + 'ConvertFrom-PSJsonToCat', 'Initialize-PSCatAllOf', + 'ConvertFrom-PSJsonToCatAllOf', 'Initialize-PSCategory', + 'ConvertFrom-PSJsonToCategory', 'Initialize-PSClassModel', + 'ConvertFrom-PSJsonToClassModel', 'Initialize-PSClient', + 'ConvertFrom-PSJsonToClient', 'Initialize-PSComplexQuadrilateral', + 'ConvertFrom-PSJsonToComplexQuadrilateral', + 'Initialize-PSDanishPig', 'ConvertFrom-PSJsonToDanishPig', + 'Initialize-PSDeprecatedObject', + 'ConvertFrom-PSJsonToDeprecatedObject', 'Initialize-PSDog', + 'ConvertFrom-PSJsonToDog', 'Initialize-PSDogAllOf', + 'ConvertFrom-PSJsonToDogAllOf', 'Initialize-PSDrawing', + 'ConvertFrom-PSJsonToDrawing', 'Initialize-PSEnumArrays', + 'ConvertFrom-PSJsonToEnumArrays', 'Initialize-PSEnumTest', + 'ConvertFrom-PSJsonToEnumTest', 'Initialize-PSEquilateralTriangle', + 'ConvertFrom-PSJsonToEquilateralTriangle', 'Initialize-PSFile', + 'ConvertFrom-PSJsonToFile', 'Initialize-PSFileSchemaTestClass', + 'ConvertFrom-PSJsonToFileSchemaTestClass', 'Initialize-PSFoo', + 'ConvertFrom-PSJsonToFoo', 'Initialize-PSFormatTest', + 'ConvertFrom-PSJsonToFormatTest', 'ConvertFrom-PSJsonToFruit', + 'ConvertFrom-PSJsonToFruitReq', 'ConvertFrom-PSJsonToGmFruit', + 'Initialize-PSGrandparentAnimal', + 'ConvertFrom-PSJsonToGrandparentAnimal', + 'Initialize-PSHasOnlyReadOnly', + 'ConvertFrom-PSJsonToHasOnlyReadOnly', + 'Initialize-PSHealthCheckResult', + 'ConvertFrom-PSJsonToHealthCheckResult', + 'Initialize-PSInlineObject', 'ConvertFrom-PSJsonToInlineObject', + 'Initialize-PSInlineObject1', 'ConvertFrom-PSJsonToInlineObject1', + 'Initialize-PSInlineResponseDefault', + 'ConvertFrom-PSJsonToInlineResponseDefault', + 'Initialize-PSIsoscelesTriangle', + 'ConvertFrom-PSJsonToIsoscelesTriangle', 'Initialize-PSList', + 'ConvertFrom-PSJsonToList', 'ConvertFrom-PSJsonToMammal', + 'Initialize-PSMapTest', 'ConvertFrom-PSJsonToMapTest', + 'Initialize-PSMixedPropertiesAndAdditionalPropertiesClass', + 'ConvertFrom-PSJsonToMixedPropertiesAndAdditionalPropertiesClass', + 'Initialize-PSModel200Response', + 'ConvertFrom-PSJsonToModel200Response', 'Initialize-PSModelReturn', + 'ConvertFrom-PSJsonToModelReturn', 'Initialize-PSName', + 'ConvertFrom-PSJsonToName', 'Initialize-PSNullableClass', + 'ConvertFrom-PSJsonToNullableClass', + 'ConvertFrom-PSJsonToNullableShape', 'Initialize-PSNumberOnly', + 'ConvertFrom-PSJsonToNumberOnly', + 'Initialize-PSObjectWithDeprecatedFields', + 'ConvertFrom-PSJsonToObjectWithDeprecatedFields', + 'Initialize-PSOrder', 'ConvertFrom-PSJsonToOrder', + 'Initialize-PSOuterComposite', 'ConvertFrom-PSJsonToOuterComposite', + 'Initialize-PSParentPet', 'ConvertFrom-PSJsonToParentPet', + 'Initialize-PSPet', 'ConvertFrom-PSJsonToPet', + 'Initialize-PSPetWithRequiredTags', + 'ConvertFrom-PSJsonToPetWithRequiredTags', + 'ConvertFrom-PSJsonToPig', 'ConvertFrom-PSJsonToQuadrilateral', + 'Initialize-PSQuadrilateralInterface', + 'ConvertFrom-PSJsonToQuadrilateralInterface', + 'Initialize-PSReadOnlyFirst', 'ConvertFrom-PSJsonToReadOnlyFirst', + 'Initialize-PSScaleneTriangle', + 'ConvertFrom-PSJsonToScaleneTriangle', 'ConvertFrom-PSJsonToShape', + 'Initialize-PSShapeInterface', 'ConvertFrom-PSJsonToShapeInterface', + 'ConvertFrom-PSJsonToShapeOrNull', + 'Initialize-PSSimpleQuadrilateral', + 'ConvertFrom-PSJsonToSimpleQuadrilateral', + 'Initialize-PSSpecialModelName', + 'ConvertFrom-PSJsonToSpecialModelName', 'Initialize-PSTag', + 'ConvertFrom-PSJsonToTag', 'ConvertFrom-PSJsonToTriangle', + 'Initialize-PSTriangleInterface', + 'ConvertFrom-PSJsonToTriangleInterface', 'Initialize-PSUser', + 'ConvertFrom-PSJsonToUser', 'Initialize-PSWhale', + 'ConvertFrom-PSJsonToWhale', 'Initialize-PSZebra', + 'ConvertFrom-PSJsonToZebra', 'Get-PSConfiguration', 'Set-PSConfiguration', 'Set-PSConfigurationApiKey', 'Set-PSConfigurationApiKeyPrefix', 'Set-PSConfigurationDefaultHeader', 'Get-PSHostSetting', diff --git a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 index bc8d8503afe3..8b0bd5f780e4 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 +++ b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/Get-CommonParameters.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/Get-CommonParameters.ps1 index 4073dbe44cc2..c24066ab1c66 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/Get-CommonParameters.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/Get-CommonParameters.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/Out-DebugParameter.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/Out-DebugParameter.ps1 index 3307691956aa..0ca752e7bada 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/Out-DebugParameter.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/Out-DebugParameter.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 index be338cd33eb4..ce637871f545 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # @@ -130,6 +130,23 @@ function Invoke-PSApiClient { } } + # http signature authentication + $httpSigningConfig = Get-PSConfigurationHttpSigning + if ($null -ne $httpSigningConfig) { + $httpSignHeaderArgument = @{ + Method = $Method + UriBuilder = $UriBuilder + Body = $Body + RequestHeader = $HeaderParameters + } + $signedHeader = Get-PSHttpSignedHeader @httpSignHeaderArgument + if($null -ne $signedHeader -and $signedHeader.Count -gt 0){ + foreach($item in $signedHeader.GetEnumerator()){ + $HeaderParameters[$item.Name] = $item.Value + } + } + } + if ($SkipCertificateCheck -eq $true) { if ($null -eq $Configuration["Proxy"]) { # skip certification check, no proxy diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 index 21bfb717d7b2..1b2b77175905 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 @@ -1,6 +1,6 @@ # # OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs b/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs index 27f40d771724..ea6d93efa7fc 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt b/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt index af56b5a29483..4f26f83ad410 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt +++ b/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt @@ -5,7 +5,7 @@ SHORT DESCRIPTION PSPetstore - the PowerShell module for the OpenAPI Petstore LONG DESCRIPTION - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 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 PowerShell module is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/samples/client/petstore/powershell/tests/Api/PSAnotherFakeApi.Tests.ps1 b/samples/client/petstore/powershell/tests/Api/PSAnotherFakeApi.Tests.ps1 new file mode 100644 index 000000000000..34a93ab62c00 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Api/PSAnotherFakeApi.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSPSAnotherFakeApi' { + Context 'Invoke-PS123TestSpecialTags' { + It 'Test Invoke-PS123TestSpecialTags' { + #$TestResult = Invoke-PS123TestSpecialTags -Client "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + +} diff --git a/samples/client/petstore/powershell/tests/Api/PSDefaultApi.Tests.ps1 b/samples/client/petstore/powershell/tests/Api/PSDefaultApi.Tests.ps1 new file mode 100644 index 000000000000..5df5a0ee821b --- /dev/null +++ b/samples/client/petstore/powershell/tests/Api/PSDefaultApi.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSPSDefaultApi' { + Context 'Invoke-PSFooGet' { + It 'Test Invoke-PSFooGet' { + #$TestResult = Invoke-PSFooGet + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + +} diff --git a/samples/client/petstore/powershell/tests/Api/PSFakeApi.Tests.ps1 b/samples/client/petstore/powershell/tests/Api/PSFakeApi.Tests.ps1 new file mode 100644 index 000000000000..1900eab70f81 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Api/PSFakeApi.Tests.ps1 @@ -0,0 +1,129 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSPSFakeApi' { + Context 'Invoke-PSFakeHealthGet' { + It 'Test Invoke-PSFakeHealthGet' { + #$TestResult = Invoke-PSFakeHealthGet + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Invoke-PSFakeOuterBooleanSerialize' { + It 'Test Invoke-PSFakeOuterBooleanSerialize' { + #$TestResult = Invoke-PSFakeOuterBooleanSerialize -Body "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Invoke-PSFakeOuterCompositeSerialize' { + It 'Test Invoke-PSFakeOuterCompositeSerialize' { + #$TestResult = Invoke-PSFakeOuterCompositeSerialize -OuterComposite "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Invoke-PSFakeOuterNumberSerialize' { + It 'Test Invoke-PSFakeOuterNumberSerialize' { + #$TestResult = Invoke-PSFakeOuterNumberSerialize -Body "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Invoke-PSFakeOuterStringSerialize' { + It 'Test Invoke-PSFakeOuterStringSerialize' { + #$TestResult = Invoke-PSFakeOuterStringSerialize -Body "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Get-PSArrayOfEnums' { + It 'Test Get-PSArrayOfEnums' { + #$TestResult = Get-PSArrayOfEnums + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSBodyWithFileSchema' { + It 'Test Test-PSBodyWithFileSchema' { + #$TestResult = Test-PSBodyWithFileSchema -FileSchemaTestClass "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSBodyWithQueryParams' { + It 'Test Test-PSBodyWithQueryParams' { + #$TestResult = Test-PSBodyWithQueryParams -Query "TEST_VALUE" -User "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSClientModel' { + It 'Test Test-PSClientModel' { + #$TestResult = Test-PSClientModel -Client "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSEndpointParameters' { + It 'Test Test-PSEndpointParameters' { + #$TestResult = Test-PSEndpointParameters -Number "TEST_VALUE" -Double "TEST_VALUE" -PatternWithoutDelimiter "TEST_VALUE" -Byte "TEST_VALUE" -Integer "TEST_VALUE" -Int32 "TEST_VALUE" -Int64 "TEST_VALUE" -Float "TEST_VALUE" -String "TEST_VALUE" -Binary "TEST_VALUE" -Date "TEST_VALUE" -DateTime "TEST_VALUE" -Password "TEST_VALUE" -Callback "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSEnumParameters' { + It 'Test Test-PSEnumParameters' { + #$TestResult = Test-PSEnumParameters -EnumHeaderStringArray "TEST_VALUE" -EnumHeaderString "TEST_VALUE" -EnumQueryStringArray "TEST_VALUE" -EnumQueryString "TEST_VALUE" -EnumQueryInteger "TEST_VALUE" -EnumQueryDouble "TEST_VALUE" -EnumFormStringArray "TEST_VALUE" -EnumFormString "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSGroupParameters' { + It 'Test Test-PSGroupParameters' { + #$TestResult = Test-PSGroupParameters -RequiredStringGroup "TEST_VALUE" -RequiredBooleanGroup "TEST_VALUE" -RequiredInt64Group "TEST_VALUE" -StringGroup "TEST_VALUE" -BooleanGroup "TEST_VALUE" -Int64Group "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSInlineAdditionalProperties' { + It 'Test Test-PSInlineAdditionalProperties' { + #$TestResult = Test-PSInlineAdditionalProperties -RequestBody "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSJsonFormData' { + It 'Test Test-PSJsonFormData' { + #$TestResult = Test-PSJsonFormData -Param "TEST_VALUE" -Param2 "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + + Context 'Test-PSQueryParameterCollectionFormat' { + It 'Test Test-PSQueryParameterCollectionFormat' { + #$TestResult = Test-PSQueryParameterCollectionFormat -Pipe "TEST_VALUE" -Ioutil "TEST_VALUE" -Http "TEST_VALUE" -Url "TEST_VALUE" -Context "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + +} diff --git a/samples/client/petstore/powershell/tests/Api/PSFakeClassnameTags123Api.Tests.ps1 b/samples/client/petstore/powershell/tests/Api/PSFakeClassnameTags123Api.Tests.ps1 new file mode 100644 index 000000000000..d652f093e6bd --- /dev/null +++ b/samples/client/petstore/powershell/tests/Api/PSFakeClassnameTags123Api.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSPSFakeClassnameTags123Api' { + Context 'Test-PSClassname' { + It 'Test Test-PSClassname' { + #$TestResult = Test-PSClassname -Client "TEST_VALUE" + #$TestResult | Should -BeOfType TODO + #$TestResult.property | Should -Be 0 + } + } + +} diff --git a/samples/client/petstore/powershell/tests/Model/AdditionalPropertiesClass.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/AdditionalPropertiesClass.Tests.ps1 new file mode 100644 index 000000000000..5591ad86df46 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/AdditionalPropertiesClass.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSAdditionalPropertiesClass' { + Context 'PSAdditionalPropertiesClass' { + It 'Initialize-PSAdditionalPropertiesClass' { + # a simple test to create an object + #$NewObject = Initialize-PSAdditionalPropertiesClass -MapProperty "TEST_VALUE" -MapOfMapProperty "TEST_VALUE" -Anytype1 "TEST_VALUE" -MapWithUndeclaredPropertiesAnytype1 "TEST_VALUE" -MapWithUndeclaredPropertiesAnytype2 "TEST_VALUE" -MapWithUndeclaredPropertiesAnytype3 "TEST_VALUE" -EmptyMap "TEST_VALUE" -MapWithUndeclaredPropertiesString "TEST_VALUE" + #$NewObject | Should -BeOfType AdditionalPropertiesClass + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Animal.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Animal.Tests.ps1 new file mode 100644 index 000000000000..ed3c725f722c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Animal.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSAnimal' { + Context 'PSAnimal' { + It 'Initialize-PSAnimal' { + # a simple test to create an object + #$NewObject = Initialize-PSAnimal -ClassName "TEST_VALUE" -Color "TEST_VALUE" + #$NewObject | Should -BeOfType Animal + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Apple.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Apple.Tests.ps1 new file mode 100644 index 000000000000..ac286c7360fc --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Apple.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSApple' { + Context 'PSApple' { + It 'Initialize-PSApple' { + # a simple test to create an object + #$NewObject = Initialize-PSApple -Cultivar "TEST_VALUE" -Origin "TEST_VALUE" + #$NewObject | Should -BeOfType Apple + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/AppleReq.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/AppleReq.Tests.ps1 new file mode 100644 index 000000000000..f83d73f7df16 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/AppleReq.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSAppleReq' { + Context 'PSAppleReq' { + It 'Initialize-PSAppleReq' { + # a simple test to create an object + #$NewObject = Initialize-PSAppleReq -Cultivar "TEST_VALUE" -Mealy "TEST_VALUE" + #$NewObject | Should -BeOfType AppleReq + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ArrayOfArrayOfNumberOnly.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ArrayOfArrayOfNumberOnly.Tests.ps1 new file mode 100644 index 000000000000..ac7145839fdf --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ArrayOfArrayOfNumberOnly.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSArrayOfArrayOfNumberOnly' { + Context 'PSArrayOfArrayOfNumberOnly' { + It 'Initialize-PSArrayOfArrayOfNumberOnly' { + # a simple test to create an object + #$NewObject = Initialize-PSArrayOfArrayOfNumberOnly -ArrayArrayNumber "TEST_VALUE" + #$NewObject | Should -BeOfType ArrayOfArrayOfNumberOnly + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ArrayOfNumberOnly.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ArrayOfNumberOnly.Tests.ps1 new file mode 100644 index 000000000000..17d0a3e5b912 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ArrayOfNumberOnly.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSArrayOfNumberOnly' { + Context 'PSArrayOfNumberOnly' { + It 'Initialize-PSArrayOfNumberOnly' { + # a simple test to create an object + #$NewObject = Initialize-PSArrayOfNumberOnly -ArrayNumber "TEST_VALUE" + #$NewObject | Should -BeOfType ArrayOfNumberOnly + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ArrayTest.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ArrayTest.Tests.ps1 new file mode 100644 index 000000000000..9d83436a8055 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ArrayTest.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSArrayTest' { + Context 'PSArrayTest' { + It 'Initialize-PSArrayTest' { + # a simple test to create an object + #$NewObject = Initialize-PSArrayTest -ArrayOfString "TEST_VALUE" -ArrayArrayOfInteger "TEST_VALUE" -ArrayArrayOfModel "TEST_VALUE" + #$NewObject | Should -BeOfType ArrayTest + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Banana.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Banana.Tests.ps1 new file mode 100644 index 000000000000..dc3757c24e5a --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Banana.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSBanana' { + Context 'PSBanana' { + It 'Initialize-PSBanana' { + # a simple test to create an object + #$NewObject = Initialize-PSBanana -LengthCm "TEST_VALUE" + #$NewObject | Should -BeOfType Banana + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/BananaReq.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/BananaReq.Tests.ps1 new file mode 100644 index 000000000000..705e2952cead --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/BananaReq.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSBananaReq' { + Context 'PSBananaReq' { + It 'Initialize-PSBananaReq' { + # a simple test to create an object + #$NewObject = Initialize-PSBananaReq -LengthCm "TEST_VALUE" -Sweet "TEST_VALUE" + #$NewObject | Should -BeOfType BananaReq + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/BasquePig.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/BasquePig.Tests.ps1 new file mode 100644 index 000000000000..4ac6e20256ed --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/BasquePig.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSBasquePig' { + Context 'PSBasquePig' { + It 'Initialize-PSBasquePig' { + # a simple test to create an object + #$NewObject = Initialize-PSBasquePig -ClassName "TEST_VALUE" + #$NewObject | Should -BeOfType BasquePig + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Capitalization.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Capitalization.Tests.ps1 new file mode 100644 index 000000000000..83bf5c288fd8 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Capitalization.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSCapitalization' { + Context 'PSCapitalization' { + It 'Initialize-PSCapitalization' { + # a simple test to create an object + #$NewObject = Initialize-PSCapitalization -SmallCamel "TEST_VALUE" -CapitalCamel "TEST_VALUE" -SmallSnake "TEST_VALUE" -CapitalSnake "TEST_VALUE" -SCAETHFlowPoints "TEST_VALUE" -ATTNAME "TEST_VALUE" + #$NewObject | Should -BeOfType Capitalization + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Cat.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Cat.Tests.ps1 new file mode 100644 index 000000000000..d31b9a8dde9e --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Cat.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSCat' { + Context 'PSCat' { + It 'Initialize-PSCat' { + # a simple test to create an object + #$NewObject = Initialize-PSCat -ClassName "TEST_VALUE" -Color "TEST_VALUE" -Declawed "TEST_VALUE" + #$NewObject | Should -BeOfType Cat + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/CatAllOf.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/CatAllOf.Tests.ps1 new file mode 100644 index 000000000000..49a7a4862c5c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/CatAllOf.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSCatAllOf' { + Context 'PSCatAllOf' { + It 'Initialize-PSCatAllOf' { + # a simple test to create an object + #$NewObject = Initialize-PSCatAllOf -Declawed "TEST_VALUE" + #$NewObject | Should -BeOfType CatAllOf + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ClassModel.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ClassModel.Tests.ps1 new file mode 100644 index 000000000000..01b89314fc34 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ClassModel.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSClassModel' { + Context 'PSClassModel' { + It 'Initialize-PSClassModel' { + # a simple test to create an object + #$NewObject = Initialize-PSClassModel -Class "TEST_VALUE" + #$NewObject | Should -BeOfType ClassModel + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Client.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Client.Tests.ps1 new file mode 100644 index 000000000000..caf3bd8ffd93 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Client.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSClient' { + Context 'PSClient' { + It 'Initialize-PSClient' { + # a simple test to create an object + #$NewObject = Initialize-PSClient -Client "TEST_VALUE" + #$NewObject | Should -BeOfType Client + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ComplexQuadrilateral.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ComplexQuadrilateral.Tests.ps1 new file mode 100644 index 000000000000..106b06dc9b2c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ComplexQuadrilateral.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSComplexQuadrilateral' { + Context 'PSComplexQuadrilateral' { + It 'Initialize-PSComplexQuadrilateral' { + # a simple test to create an object + #$NewObject = Initialize-PSComplexQuadrilateral -ShapeType "TEST_VALUE" -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType ComplexQuadrilateral + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/DanishPig.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/DanishPig.Tests.ps1 new file mode 100644 index 000000000000..0396b0004fe2 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/DanishPig.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSDanishPig' { + Context 'PSDanishPig' { + It 'Initialize-PSDanishPig' { + # a simple test to create an object + #$NewObject = Initialize-PSDanishPig -ClassName "TEST_VALUE" + #$NewObject | Should -BeOfType DanishPig + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/DeprecatedObject.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/DeprecatedObject.Tests.ps1 new file mode 100644 index 000000000000..715b169a6179 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/DeprecatedObject.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSDeprecatedObject' { + Context 'PSDeprecatedObject' { + It 'Initialize-PSDeprecatedObject' { + # a simple test to create an object + #$NewObject = Initialize-PSDeprecatedObject -Name "TEST_VALUE" + #$NewObject | Should -BeOfType DeprecatedObject + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Dog.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Dog.Tests.ps1 new file mode 100644 index 000000000000..aa9921cc096a --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Dog.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSDog' { + Context 'PSDog' { + It 'Initialize-PSDog' { + # a simple test to create an object + #$NewObject = Initialize-PSDog -ClassName "TEST_VALUE" -Color "TEST_VALUE" -Breed "TEST_VALUE" + #$NewObject | Should -BeOfType Dog + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/DogAllOf.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/DogAllOf.Tests.ps1 new file mode 100644 index 000000000000..574addf84d2c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/DogAllOf.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSDogAllOf' { + Context 'PSDogAllOf' { + It 'Initialize-PSDogAllOf' { + # a simple test to create an object + #$NewObject = Initialize-PSDogAllOf -Breed "TEST_VALUE" + #$NewObject | Should -BeOfType DogAllOf + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Drawing.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Drawing.Tests.ps1 new file mode 100644 index 000000000000..183189b03211 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Drawing.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSDrawing' { + Context 'PSDrawing' { + It 'Initialize-PSDrawing' { + # a simple test to create an object + #$NewObject = Initialize-PSDrawing -MainShape "TEST_VALUE" -ShapeOrNull "TEST_VALUE" -NullableShape "TEST_VALUE" -Shapes "TEST_VALUE" + #$NewObject | Should -BeOfType Drawing + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/EnumArrays.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/EnumArrays.Tests.ps1 new file mode 100644 index 000000000000..2ce925ff56de --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/EnumArrays.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSEnumArrays' { + Context 'PSEnumArrays' { + It 'Initialize-PSEnumArrays' { + # a simple test to create an object + #$NewObject = Initialize-PSEnumArrays -JustSymbol "TEST_VALUE" -ArrayEnum "TEST_VALUE" + #$NewObject | Should -BeOfType EnumArrays + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/EnumClass.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/EnumClass.Tests.ps1 new file mode 100644 index 000000000000..9ed480f49421 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/EnumClass.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSEnumClass' { + Context 'PSEnumClass' { + It 'Initialize-PSEnumClass' { + # a simple test to create an object + #$NewObject = Initialize-PSEnumClass + #$NewObject | Should -BeOfType EnumClass + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/EnumTest.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/EnumTest.Tests.ps1 new file mode 100644 index 000000000000..e7f1a863029b --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/EnumTest.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSEnumTest' { + Context 'PSEnumTest' { + It 'Initialize-PSEnumTest' { + # a simple test to create an object + #$NewObject = Initialize-PSEnumTest -EnumString "TEST_VALUE" -EnumStringRequired "TEST_VALUE" -EnumInteger "TEST_VALUE" -EnumIntegerOnly "TEST_VALUE" -EnumNumber "TEST_VALUE" -OuterEnum "TEST_VALUE" -OuterEnumInteger "TEST_VALUE" -OuterEnumDefaultValue "TEST_VALUE" -OuterEnumIntegerDefaultValue "TEST_VALUE" + #$NewObject | Should -BeOfType EnumTest + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/EquilateralTriangle.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/EquilateralTriangle.Tests.ps1 new file mode 100644 index 000000000000..472983e6d354 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/EquilateralTriangle.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSEquilateralTriangle' { + Context 'PSEquilateralTriangle' { + It 'Initialize-PSEquilateralTriangle' { + # a simple test to create an object + #$NewObject = Initialize-PSEquilateralTriangle -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" + #$NewObject | Should -BeOfType EquilateralTriangle + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/File.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/File.Tests.ps1 new file mode 100644 index 000000000000..9ea991f0357d --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/File.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSFile' { + Context 'PSFile' { + It 'Initialize-PSFile' { + # a simple test to create an object + #$NewObject = Initialize-PSFile -SourceURI "TEST_VALUE" + #$NewObject | Should -BeOfType File + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/FileSchemaTestClass.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/FileSchemaTestClass.Tests.ps1 new file mode 100644 index 000000000000..e6850286c3a7 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/FileSchemaTestClass.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSFileSchemaTestClass' { + Context 'PSFileSchemaTestClass' { + It 'Initialize-PSFileSchemaTestClass' { + # a simple test to create an object + #$NewObject = Initialize-PSFileSchemaTestClass -File "TEST_VALUE" -Files "TEST_VALUE" + #$NewObject | Should -BeOfType FileSchemaTestClass + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Foo.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Foo.Tests.ps1 new file mode 100644 index 000000000000..98cc3a96fa70 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Foo.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSFoo' { + Context 'PSFoo' { + It 'Initialize-PSFoo' { + # a simple test to create an object + #$NewObject = Initialize-PSFoo -Bar "TEST_VALUE" + #$NewObject | Should -BeOfType Foo + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/FormatTest.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/FormatTest.Tests.ps1 new file mode 100644 index 000000000000..6cdb13c999b2 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/FormatTest.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSFormatTest' { + Context 'PSFormatTest' { + It 'Initialize-PSFormatTest' { + # a simple test to create an object + #$NewObject = Initialize-PSFormatTest -Integer "TEST_VALUE" -Int32 "TEST_VALUE" -Int64 "TEST_VALUE" -Number "TEST_VALUE" -Float "TEST_VALUE" -Double "TEST_VALUE" -Decimal "TEST_VALUE" -String "TEST_VALUE" -Byte "TEST_VALUE" -Binary "TEST_VALUE" -Date "TEST_VALUE" -DateTime "TEST_VALUE" -Uuid "TEST_VALUE" -Password "TEST_VALUE" -PatternWithDigits "TEST_VALUE" -PatternWithDigitsAndDelimiter "TEST_VALUE" + #$NewObject | Should -BeOfType FormatTest + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Fruit.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Fruit.Tests.ps1 new file mode 100644 index 000000000000..897b03f23dcd --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Fruit.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSFruit' { + Context 'PSFruit' { + It 'Initialize-PSFruit' { + # a simple test to create an object + #$NewObject = Initialize-PSFruit -Color "TEST_VALUE" -Cultivar "TEST_VALUE" -Origin "TEST_VALUE" -LengthCm "TEST_VALUE" + #$NewObject | Should -BeOfType Fruit + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/FruitReq.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/FruitReq.Tests.ps1 new file mode 100644 index 000000000000..c149369b4626 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/FruitReq.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSFruitReq' { + Context 'PSFruitReq' { + It 'Initialize-PSFruitReq' { + # a simple test to create an object + #$NewObject = Initialize-PSFruitReq -Cultivar "TEST_VALUE" -Mealy "TEST_VALUE" -LengthCm "TEST_VALUE" -Sweet "TEST_VALUE" + #$NewObject | Should -BeOfType FruitReq + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/GmFruit.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/GmFruit.Tests.ps1 new file mode 100644 index 000000000000..6b91433b9b26 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/GmFruit.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSGmFruit' { + Context 'PSGmFruit' { + It 'Initialize-PSGmFruit' { + # a simple test to create an object + #$NewObject = Initialize-PSGmFruit -Color "TEST_VALUE" -Cultivar "TEST_VALUE" -Origin "TEST_VALUE" -LengthCm "TEST_VALUE" + #$NewObject | Should -BeOfType GmFruit + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/GrandparentAnimal.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/GrandparentAnimal.Tests.ps1 new file mode 100644 index 000000000000..f22b1fe3af7c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/GrandparentAnimal.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSGrandparentAnimal' { + Context 'PSGrandparentAnimal' { + It 'Initialize-PSGrandparentAnimal' { + # a simple test to create an object + #$NewObject = Initialize-PSGrandparentAnimal -PetType "TEST_VALUE" + #$NewObject | Should -BeOfType GrandparentAnimal + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/HasOnlyReadOnly.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/HasOnlyReadOnly.Tests.ps1 new file mode 100644 index 000000000000..4235a31130e8 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/HasOnlyReadOnly.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSHasOnlyReadOnly' { + Context 'PSHasOnlyReadOnly' { + It 'Initialize-PSHasOnlyReadOnly' { + # a simple test to create an object + #$NewObject = Initialize-PSHasOnlyReadOnly -Bar "TEST_VALUE" -Foo "TEST_VALUE" + #$NewObject | Should -BeOfType HasOnlyReadOnly + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/HealthCheckResult.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/HealthCheckResult.Tests.ps1 new file mode 100644 index 000000000000..f46e6ba1a78a --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/HealthCheckResult.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSHealthCheckResult' { + Context 'PSHealthCheckResult' { + It 'Initialize-PSHealthCheckResult' { + # a simple test to create an object + #$NewObject = Initialize-PSHealthCheckResult -NullableMessage "TEST_VALUE" + #$NewObject | Should -BeOfType HealthCheckResult + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/InlineResponseDefault.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/InlineResponseDefault.Tests.ps1 new file mode 100644 index 000000000000..822b1d36d66d --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/InlineResponseDefault.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSInlineResponseDefault' { + Context 'PSInlineResponseDefault' { + It 'Initialize-PSInlineResponseDefault' { + # a simple test to create an object + #$NewObject = Initialize-PSInlineResponseDefault -String "TEST_VALUE" + #$NewObject | Should -BeOfType InlineResponseDefault + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/IsoscelesTriangle.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/IsoscelesTriangle.Tests.ps1 new file mode 100644 index 000000000000..0f49e370772f --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/IsoscelesTriangle.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSIsoscelesTriangle' { + Context 'PSIsoscelesTriangle' { + It 'Initialize-PSIsoscelesTriangle' { + # a simple test to create an object + #$NewObject = Initialize-PSIsoscelesTriangle -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" + #$NewObject | Should -BeOfType IsoscelesTriangle + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/List.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/List.Tests.ps1 new file mode 100644 index 000000000000..991de93aa475 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/List.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSList' { + Context 'PSList' { + It 'Initialize-PSList' { + # a simple test to create an object + #$NewObject = Initialize-PSList -Var123List "TEST_VALUE" + #$NewObject | Should -BeOfType List + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Mammal.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Mammal.Tests.ps1 new file mode 100644 index 000000000000..0093186d8cb0 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Mammal.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSMammal' { + Context 'PSMammal' { + It 'Initialize-PSMammal' { + # a simple test to create an object + #$NewObject = Initialize-PSMammal -HasBaleen "TEST_VALUE" -HasTeeth "TEST_VALUE" -ClassName "TEST_VALUE" -Type "TEST_VALUE" + #$NewObject | Should -BeOfType Mammal + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/MapTest.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/MapTest.Tests.ps1 new file mode 100644 index 000000000000..128d1f71f353 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/MapTest.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSMapTest' { + Context 'PSMapTest' { + It 'Initialize-PSMapTest' { + # a simple test to create an object + #$NewObject = Initialize-PSMapTest -MapMapOfString "TEST_VALUE" -MapOfEnumString "TEST_VALUE" -DirectMap "TEST_VALUE" -IndirectMap "TEST_VALUE" + #$NewObject | Should -BeOfType MapTest + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/MixedPropertiesAndAdditionalPropertiesClass.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/MixedPropertiesAndAdditionalPropertiesClass.Tests.ps1 new file mode 100644 index 000000000000..64611f06da62 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/MixedPropertiesAndAdditionalPropertiesClass.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSMixedPropertiesAndAdditionalPropertiesClass' { + Context 'PSMixedPropertiesAndAdditionalPropertiesClass' { + It 'Initialize-PSMixedPropertiesAndAdditionalPropertiesClass' { + # a simple test to create an object + #$NewObject = Initialize-PSMixedPropertiesAndAdditionalPropertiesClass -Uuid "TEST_VALUE" -DateTime "TEST_VALUE" -Map "TEST_VALUE" + #$NewObject | Should -BeOfType MixedPropertiesAndAdditionalPropertiesClass + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Model200Response.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Model200Response.Tests.ps1 new file mode 100644 index 000000000000..c7765ef03ecd --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Model200Response.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSModel200Response' { + Context 'PSModel200Response' { + It 'Initialize-PSModel200Response' { + # a simple test to create an object + #$NewObject = Initialize-PSModel200Response -Name "TEST_VALUE" -Class "TEST_VALUE" + #$NewObject | Should -BeOfType Model200Response + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ModelReturn.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ModelReturn.Tests.ps1 new file mode 100644 index 000000000000..16a8c142bc63 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ModelReturn.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSModelReturn' { + Context 'PSModelReturn' { + It 'Initialize-PSModelReturn' { + # a simple test to create an object + #$NewObject = Initialize-PSModelReturn -VarReturn "TEST_VALUE" + #$NewObject | Should -BeOfType ModelReturn + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Name.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Name.Tests.ps1 new file mode 100644 index 000000000000..ee7f033af661 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Name.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSName' { + Context 'PSName' { + It 'Initialize-PSName' { + # a simple test to create an object + #$NewObject = Initialize-PSName -Name "TEST_VALUE" -SnakeCase "TEST_VALUE" -Property "TEST_VALUE" -Var123Number "TEST_VALUE" + #$NewObject | Should -BeOfType Name + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/NullableClass.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/NullableClass.Tests.ps1 new file mode 100644 index 000000000000..fe7df5278ce5 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/NullableClass.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSNullableClass' { + Context 'PSNullableClass' { + It 'Initialize-PSNullableClass' { + # a simple test to create an object + #$NewObject = Initialize-PSNullableClass -IntegerProp "TEST_VALUE" -NumberProp "TEST_VALUE" -BooleanProp "TEST_VALUE" -StringProp "TEST_VALUE" -DateProp "TEST_VALUE" -DatetimeProp "TEST_VALUE" -ArrayNullableProp "TEST_VALUE" -ArrayAndItemsNullableProp "TEST_VALUE" -ArrayItemsNullable "TEST_VALUE" -ObjectNullableProp "TEST_VALUE" -ObjectAndItemsNullableProp "TEST_VALUE" -ObjectItemsNullable "TEST_VALUE" + #$NewObject | Should -BeOfType NullableClass + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/NullableShape.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/NullableShape.Tests.ps1 new file mode 100644 index 000000000000..4c66304bbe4f --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/NullableShape.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSNullableShape' { + Context 'PSNullableShape' { + It 'Initialize-PSNullableShape' { + # a simple test to create an object + #$NewObject = Initialize-PSNullableShape -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType NullableShape + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/NumberOnly.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/NumberOnly.Tests.ps1 new file mode 100644 index 000000000000..923419320e95 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/NumberOnly.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSNumberOnly' { + Context 'PSNumberOnly' { + It 'Initialize-PSNumberOnly' { + # a simple test to create an object + #$NewObject = Initialize-PSNumberOnly -JustNumber "TEST_VALUE" + #$NewObject | Should -BeOfType NumberOnly + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ObjectWithDeprecatedFields.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ObjectWithDeprecatedFields.Tests.ps1 new file mode 100644 index 000000000000..10ae61483760 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ObjectWithDeprecatedFields.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSObjectWithDeprecatedFields' { + Context 'PSObjectWithDeprecatedFields' { + It 'Initialize-PSObjectWithDeprecatedFields' { + # a simple test to create an object + #$NewObject = Initialize-PSObjectWithDeprecatedFields -Uuid "TEST_VALUE" -Id "TEST_VALUE" -DeprecatedRef "TEST_VALUE" -Bars "TEST_VALUE" + #$NewObject | Should -BeOfType ObjectWithDeprecatedFields + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/OuterComposite.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/OuterComposite.Tests.ps1 new file mode 100644 index 000000000000..0382b18586b0 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/OuterComposite.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSOuterComposite' { + Context 'PSOuterComposite' { + It 'Initialize-PSOuterComposite' { + # a simple test to create an object + #$NewObject = Initialize-PSOuterComposite -MyNumber "TEST_VALUE" -MyString "TEST_VALUE" -MyBoolean "TEST_VALUE" + #$NewObject | Should -BeOfType OuterComposite + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/OuterEnum.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/OuterEnum.Tests.ps1 new file mode 100644 index 000000000000..be5b62a9eb20 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/OuterEnum.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSOuterEnum' { + Context 'PSOuterEnum' { + It 'Initialize-PSOuterEnum' { + # a simple test to create an object + #$NewObject = Initialize-PSOuterEnum + #$NewObject | Should -BeOfType OuterEnum + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/OuterEnumDefaultValue.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/OuterEnumDefaultValue.Tests.ps1 new file mode 100644 index 000000000000..3992012be320 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/OuterEnumDefaultValue.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSOuterEnumDefaultValue' { + Context 'PSOuterEnumDefaultValue' { + It 'Initialize-PSOuterEnumDefaultValue' { + # a simple test to create an object + #$NewObject = Initialize-PSOuterEnumDefaultValue + #$NewObject | Should -BeOfType OuterEnumDefaultValue + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/OuterEnumInteger.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/OuterEnumInteger.Tests.ps1 new file mode 100644 index 000000000000..00d0eba96570 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/OuterEnumInteger.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSOuterEnumInteger' { + Context 'PSOuterEnumInteger' { + It 'Initialize-PSOuterEnumInteger' { + # a simple test to create an object + #$NewObject = Initialize-PSOuterEnumInteger + #$NewObject | Should -BeOfType OuterEnumInteger + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/OuterEnumIntegerDefaultValue.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/OuterEnumIntegerDefaultValue.Tests.ps1 new file mode 100644 index 000000000000..3f9f924aef26 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/OuterEnumIntegerDefaultValue.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSOuterEnumIntegerDefaultValue' { + Context 'PSOuterEnumIntegerDefaultValue' { + It 'Initialize-PSOuterEnumIntegerDefaultValue' { + # a simple test to create an object + #$NewObject = Initialize-PSOuterEnumIntegerDefaultValue + #$NewObject | Should -BeOfType OuterEnumIntegerDefaultValue + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ParentPet.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ParentPet.Tests.ps1 new file mode 100644 index 000000000000..cc9560dc885a --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ParentPet.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSParentPet' { + Context 'PSParentPet' { + It 'Initialize-PSParentPet' { + # a simple test to create an object + #$NewObject = Initialize-PSParentPet -PetType "TEST_VALUE" + #$NewObject | Should -BeOfType ParentPet + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/PetWithRequiredTags.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/PetWithRequiredTags.Tests.ps1 new file mode 100644 index 000000000000..a3ad7a11dcca --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/PetWithRequiredTags.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSPetWithRequiredTags' { + Context 'PSPetWithRequiredTags' { + It 'Initialize-PSPetWithRequiredTags' { + # a simple test to create an object + #$NewObject = Initialize-PSPetWithRequiredTags -Id "TEST_VALUE" -Category "TEST_VALUE" -Name "TEST_VALUE" -PhotoUrls "TEST_VALUE" -Tags "TEST_VALUE" -Status "TEST_VALUE" + #$NewObject | Should -BeOfType PetWithRequiredTags + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Pig.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Pig.Tests.ps1 new file mode 100644 index 000000000000..4cc331028d5e --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Pig.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSPig' { + Context 'PSPig' { + It 'Initialize-PSPig' { + # a simple test to create an object + #$NewObject = Initialize-PSPig -ClassName "TEST_VALUE" + #$NewObject | Should -BeOfType Pig + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Quadrilateral.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Quadrilateral.Tests.ps1 new file mode 100644 index 000000000000..4a054b1a5f8c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Quadrilateral.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSQuadrilateral' { + Context 'PSQuadrilateral' { + It 'Initialize-PSQuadrilateral' { + # a simple test to create an object + #$NewObject = Initialize-PSQuadrilateral -ShapeType "TEST_VALUE" -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType Quadrilateral + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/QuadrilateralInterface.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/QuadrilateralInterface.Tests.ps1 new file mode 100644 index 000000000000..0fd834fe34d4 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/QuadrilateralInterface.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSQuadrilateralInterface' { + Context 'PSQuadrilateralInterface' { + It 'Initialize-PSQuadrilateralInterface' { + # a simple test to create an object + #$NewObject = Initialize-PSQuadrilateralInterface -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType QuadrilateralInterface + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ReadOnlyFirst.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ReadOnlyFirst.Tests.ps1 new file mode 100644 index 000000000000..14260f1c8cc8 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ReadOnlyFirst.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSReadOnlyFirst' { + Context 'PSReadOnlyFirst' { + It 'Initialize-PSReadOnlyFirst' { + # a simple test to create an object + #$NewObject = Initialize-PSReadOnlyFirst -Bar "TEST_VALUE" -Baz "TEST_VALUE" + #$NewObject | Should -BeOfType ReadOnlyFirst + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ScaleneTriangle.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ScaleneTriangle.Tests.ps1 new file mode 100644 index 000000000000..9e3e01ac3e5e --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ScaleneTriangle.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSScaleneTriangle' { + Context 'PSScaleneTriangle' { + It 'Initialize-PSScaleneTriangle' { + # a simple test to create an object + #$NewObject = Initialize-PSScaleneTriangle -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" + #$NewObject | Should -BeOfType ScaleneTriangle + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Shape.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Shape.Tests.ps1 new file mode 100644 index 000000000000..10c579fc7ec8 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Shape.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSShape' { + Context 'PSShape' { + It 'Initialize-PSShape' { + # a simple test to create an object + #$NewObject = Initialize-PSShape -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType Shape + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ShapeInterface.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ShapeInterface.Tests.ps1 new file mode 100644 index 000000000000..595cdcde2727 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ShapeInterface.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSShapeInterface' { + Context 'PSShapeInterface' { + It 'Initialize-PSShapeInterface' { + # a simple test to create an object + #$NewObject = Initialize-PSShapeInterface -ShapeType "TEST_VALUE" + #$NewObject | Should -BeOfType ShapeInterface + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/ShapeOrNull.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ShapeOrNull.Tests.ps1 new file mode 100644 index 000000000000..c8aa986e7c44 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/ShapeOrNull.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSShapeOrNull' { + Context 'PSShapeOrNull' { + It 'Initialize-PSShapeOrNull' { + # a simple test to create an object + #$NewObject = Initialize-PSShapeOrNull -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType ShapeOrNull + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/SimpleQuadrilateral.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/SimpleQuadrilateral.Tests.ps1 new file mode 100644 index 000000000000..891d4eea609a --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/SimpleQuadrilateral.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSSimpleQuadrilateral' { + Context 'PSSimpleQuadrilateral' { + It 'Initialize-PSSimpleQuadrilateral' { + # a simple test to create an object + #$NewObject = Initialize-PSSimpleQuadrilateral -ShapeType "TEST_VALUE" -QuadrilateralType "TEST_VALUE" + #$NewObject | Should -BeOfType SimpleQuadrilateral + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/SpecialModelName.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/SpecialModelName.Tests.ps1 new file mode 100644 index 000000000000..4eb3d0f163a3 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/SpecialModelName.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSSpecialModelName' { + Context 'PSSpecialModelName' { + It 'Initialize-PSSpecialModelName' { + # a simple test to create an object + #$NewObject = Initialize-PSSpecialModelName -SpecialPropertyName "TEST_VALUE" -SpecialModelName "TEST_VALUE" + #$NewObject | Should -BeOfType SpecialModelName + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Triangle.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Triangle.Tests.ps1 new file mode 100644 index 000000000000..b1b4af2efbb7 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Triangle.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSTriangle' { + Context 'PSTriangle' { + It 'Initialize-PSTriangle' { + # a simple test to create an object + #$NewObject = Initialize-PSTriangle -ShapeType "TEST_VALUE" -TriangleType "TEST_VALUE" + #$NewObject | Should -BeOfType Triangle + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/TriangleInterface.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/TriangleInterface.Tests.ps1 new file mode 100644 index 000000000000..630f18eb2d24 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/TriangleInterface.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSTriangleInterface' { + Context 'PSTriangleInterface' { + It 'Initialize-PSTriangleInterface' { + # a simple test to create an object + #$NewObject = Initialize-PSTriangleInterface -TriangleType "TEST_VALUE" + #$NewObject | Should -BeOfType TriangleInterface + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Whale.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Whale.Tests.ps1 new file mode 100644 index 000000000000..331782aa5563 --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Whale.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSWhale' { + Context 'PSWhale' { + It 'Initialize-PSWhale' { + # a simple test to create an object + #$NewObject = Initialize-PSWhale -HasBaleen "TEST_VALUE" -HasTeeth "TEST_VALUE" -ClassName "TEST_VALUE" + #$NewObject | Should -BeOfType Whale + #$NewObject.property | Should -Be 0 + } + } +} diff --git a/samples/client/petstore/powershell/tests/Model/Zebra.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Zebra.Tests.ps1 new file mode 100644 index 000000000000..36feac5c870c --- /dev/null +++ b/samples/client/petstore/powershell/tests/Model/Zebra.Tests.ps1 @@ -0,0 +1,17 @@ +# +# OpenAPI Petstore +# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \ +# Version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +Describe -tag 'PSPetstore' -name 'PSZebra' { + Context 'PSZebra' { + It 'Initialize-PSZebra' { + # a simple test to create an object + #$NewObject = Initialize-PSZebra -Type "TEST_VALUE" -ClassName "TEST_VALUE" + #$NewObject | Should -BeOfType Zebra + #$NewObject.property | Should -Be 0 + } + } +}