diff --git a/.github/workflows/samples-dotnet-petstore-net10.yml b/.github/workflows/samples-dotnet-petstore-net10.yml new file mode 100644 index 000000000000..2ffa89f29c08 --- /dev/null +++ b/.github/workflows/samples-dotnet-petstore-net10.yml @@ -0,0 +1,37 @@ +name: Samples C# .Net 10 Client (Petstore) + +on: + push: + paths: + - samples/client/petstore/csharp/restsharp/net10/Petstore/** + pull_request: + paths: + - samples/client/petstore/csharp/restsharp/net10/Petstore/** +jobs: + build: + name: Build clients + runs-on: ubuntu-latest + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + strategy: + fail-fast: false + matrix: + sample: + - samples/client/petstore/csharp/restsharp/net10/Petstore/ + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-dotnet@v5.2.0 + with: + dotnet-version: '10.0.x' + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/bin/configs/csharp-restsharp-net10-enumNameMappings.yaml b/bin/configs/csharp-restsharp-net10-enumNameMappings.yaml new file mode 100644 index 000000000000..9be5f635f68c --- /dev/null +++ b/bin/configs/csharp-restsharp-net10-enumNameMappings.yaml @@ -0,0 +1,15 @@ +# for .net standard +generatorName: csharp +library: restsharp +outputDir: samples/client/petstore/csharp/restsharp/net10/EnumMappings +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + useOneOfDiscriminatorLookup: true + targetFramework: net10.0 + equatable: true +enumNameMappings: + delivered: Shipped diff --git a/bin/configs/csharp-restsharp-net10.yaml b/bin/configs/csharp-restsharp-net10.yaml index 200b298088b7..a044b938546d 100644 --- a/bin/configs/csharp-restsharp-net10.yaml +++ b/bin/configs/csharp-restsharp-net10.yaml @@ -1,8 +1,8 @@ # for .net standard generatorName: csharp library: restsharp -outputDir: samples/client/petstore/csharp/restsharp/net10/EnumMappings -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml +outputDir: samples/client/petstore/csharp/restsharp/net10/Petstore +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml templateDir: modules/openapi-generator/src/main/resources/csharp additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' @@ -11,5 +11,3 @@ additionalProperties: useOneOfDiscriminatorLookup: true targetFramework: net10.0 equatable: true -enumNameMappings: - delivered: Shipped diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/.openapi-generator/FILES b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/.openapi-generator/FILES index c6424794961a..f05700009ef9 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/.openapi-generator/FILES @@ -3,114 +3,17 @@ Org.OpenAPITools.sln README.md api/openapi.yaml appveyor.yml -docs/Activity.md -docs/ActivityOutputElementRepresentation.md -docs/AdditionalPropertiesClass.md -docs/Animal.md -docs/AnotherFakeApi.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/Category.md -docs/ChildCat.md -docs/ClassModel.md -docs/ComplexQuadrilateral.md -docs/DanishPig.md -docs/DateOnlyClass.md -docs/DefaultApi.md -docs/DeprecatedObject.md -docs/Dog.md -docs/Drawing.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/EquilateralTriangle.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FooGetDefaultResponse.md -docs/FormatTest.md -docs/Fruit.md -docs/FruitReq.md -docs/GmFruit.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/IsoscelesTriangle.md -docs/List.md -docs/LiteralStringClass.md -docs/Mammal.md -docs/MapTest.md -docs/MixedAnyOf.md -docs/MixedAnyOfContent.md -docs/MixedOneOf.md -docs/MixedOneOfContent.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/MixedSubId.md -docs/Model200Response.md -docs/ModelClient.md -docs/Name.md -docs/NotificationtestGetElementsV1ResponseMPayload.md -docs/NullableClass.md -docs/NullableGuidClass.md -docs/NullableShape.md -docs/NumberOnly.md -docs/ObjectWithDeprecatedFields.md -docs/OneOfString.md docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/OuterEnumTest.md -docs/ParentPet.md docs/Pet.md docs/PetApi.md -docs/Pig.md -docs/PolymorphicProperty.md -docs/Quadrilateral.md -docs/QuadrilateralInterface.md -docs/ReadOnlyFirst.md -docs/RequiredClass.md -docs/Return.md -docs/RolesReportsHash.md -docs/RolesReportsHashRole.md -docs/ScaleneTriangle.md -docs/Shape.md -docs/ShapeInterface.md -docs/ShapeOrNull.md -docs/SimpleQuadrilateral.md -docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md -docs/TestCollectionEndingWithWordList.md -docs/TestCollectionEndingWithWordListObject.md -docs/TestInlineFreeformAdditionalPropertiesRequest.md -docs/Triangle.md -docs/TriangleInterface.md docs/User.md docs/UserApi.md -docs/Whale.md -docs/Zebra.md -docs/ZeroBasedEnum.md -docs/ZeroBasedEnumClass.md git_push.sh src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj -src/Org.OpenAPITools/Api/AnotherFakeApi.cs -src/Org.OpenAPITools/Api/DefaultApi.cs -src/Org.OpenAPITools/Api/FakeApi.cs -src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs src/Org.OpenAPITools/Api/PetApi.cs src/Org.OpenAPITools/Api/StoreApi.cs src/Org.OpenAPITools/Api/UserApi.cs @@ -125,7 +28,6 @@ src/Org.OpenAPITools/Client/Configuration.cs src/Org.OpenAPITools/Client/ExceptionFactory.cs src/Org.OpenAPITools/Client/GlobalConfiguration.cs src/Org.OpenAPITools/Client/HttpMethod.cs -src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs src/Org.OpenAPITools/Client/IApiAccessor.cs src/Org.OpenAPITools/Client/IAsynchronousClient.cs src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -135,99 +37,10 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.cs src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs -src/Org.OpenAPITools/Model/Activity.cs -src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs -src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs -src/Org.OpenAPITools/Model/Animal.cs src/Org.OpenAPITools/Model/ApiResponse.cs -src/Org.OpenAPITools/Model/Apple.cs -src/Org.OpenAPITools/Model/AppleReq.cs -src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs -src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs -src/Org.OpenAPITools/Model/ArrayTest.cs -src/Org.OpenAPITools/Model/Banana.cs -src/Org.OpenAPITools/Model/BananaReq.cs -src/Org.OpenAPITools/Model/BasquePig.cs -src/Org.OpenAPITools/Model/Capitalization.cs -src/Org.OpenAPITools/Model/Cat.cs src/Org.OpenAPITools/Model/Category.cs -src/Org.OpenAPITools/Model/ChildCat.cs -src/Org.OpenAPITools/Model/ClassModel.cs -src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs -src/Org.OpenAPITools/Model/DanishPig.cs -src/Org.OpenAPITools/Model/DateOnlyClass.cs -src/Org.OpenAPITools/Model/DeprecatedObject.cs -src/Org.OpenAPITools/Model/Dog.cs -src/Org.OpenAPITools/Model/Drawing.cs -src/Org.OpenAPITools/Model/EnumArrays.cs -src/Org.OpenAPITools/Model/EnumClass.cs -src/Org.OpenAPITools/Model/EnumTest.cs -src/Org.OpenAPITools/Model/EquilateralTriangle.cs -src/Org.OpenAPITools/Model/File.cs -src/Org.OpenAPITools/Model/FileSchemaTestClass.cs -src/Org.OpenAPITools/Model/Foo.cs -src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs -src/Org.OpenAPITools/Model/FormatTest.cs -src/Org.OpenAPITools/Model/Fruit.cs -src/Org.OpenAPITools/Model/FruitReq.cs -src/Org.OpenAPITools/Model/GmFruit.cs -src/Org.OpenAPITools/Model/GrandparentAnimal.cs -src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs -src/Org.OpenAPITools/Model/HealthCheckResult.cs -src/Org.OpenAPITools/Model/IsoscelesTriangle.cs -src/Org.OpenAPITools/Model/List.cs -src/Org.OpenAPITools/Model/LiteralStringClass.cs -src/Org.OpenAPITools/Model/Mammal.cs -src/Org.OpenAPITools/Model/MapTest.cs -src/Org.OpenAPITools/Model/MixedAnyOf.cs -src/Org.OpenAPITools/Model/MixedAnyOfContent.cs -src/Org.OpenAPITools/Model/MixedOneOf.cs -src/Org.OpenAPITools/Model/MixedOneOfContent.cs -src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs -src/Org.OpenAPITools/Model/MixedSubId.cs -src/Org.OpenAPITools/Model/Model200Response.cs -src/Org.OpenAPITools/Model/ModelClient.cs -src/Org.OpenAPITools/Model/Name.cs -src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs -src/Org.OpenAPITools/Model/NullableClass.cs -src/Org.OpenAPITools/Model/NullableGuidClass.cs -src/Org.OpenAPITools/Model/NullableShape.cs -src/Org.OpenAPITools/Model/NumberOnly.cs -src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs -src/Org.OpenAPITools/Model/OneOfString.cs src/Org.OpenAPITools/Model/Order.cs -src/Org.OpenAPITools/Model/OuterComposite.cs -src/Org.OpenAPITools/Model/OuterEnum.cs -src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs -src/Org.OpenAPITools/Model/OuterEnumInteger.cs -src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs -src/Org.OpenAPITools/Model/OuterEnumTest.cs -src/Org.OpenAPITools/Model/ParentPet.cs src/Org.OpenAPITools/Model/Pet.cs -src/Org.OpenAPITools/Model/Pig.cs -src/Org.OpenAPITools/Model/PolymorphicProperty.cs -src/Org.OpenAPITools/Model/Quadrilateral.cs -src/Org.OpenAPITools/Model/QuadrilateralInterface.cs -src/Org.OpenAPITools/Model/ReadOnlyFirst.cs -src/Org.OpenAPITools/Model/RequiredClass.cs -src/Org.OpenAPITools/Model/Return.cs -src/Org.OpenAPITools/Model/RolesReportsHash.cs -src/Org.OpenAPITools/Model/RolesReportsHashRole.cs -src/Org.OpenAPITools/Model/ScaleneTriangle.cs -src/Org.OpenAPITools/Model/Shape.cs -src/Org.OpenAPITools/Model/ShapeInterface.cs -src/Org.OpenAPITools/Model/ShapeOrNull.cs -src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs -src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs -src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs -src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs -src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs -src/Org.OpenAPITools/Model/Triangle.cs -src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs -src/Org.OpenAPITools/Model/Whale.cs -src/Org.OpenAPITools/Model/Zebra.cs -src/Org.OpenAPITools/Model/ZeroBasedEnum.cs -src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/README.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/README.md index 76b00ca47bc2..db31d76cd4f5 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/README.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/README.md @@ -1,6 +1,6 @@ # Org.OpenAPITools - the C# library for the OpenAPI Petstore -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -87,19 +87,22 @@ namespace Example { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; - var apiInstance = new AnotherFakeApi(config); - var modelClient = new ModelClient(); // ModelClient | client model + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + // Add a new pet to the store + Pet result = apiInstance.AddPet(pet); Debug.WriteLine(result); } catch (ApiException e) { - Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); Debug.Print("Status Code: "+ e.ErrorCode); Debug.Print(e.StackTrace); } @@ -112,37 +115,10 @@ namespace Example ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | -*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | -*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello -*DefaultApi* | [**RolesReportGet**](docs/DefaultApi.md#rolesreportget) | **GET** /roles/report | -*DefaultApi* | [**Test**](docs/DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements -*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeApi* | [**GetArrayOfEnums**](docs/FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums -*FakeApi* | [**GetMixedAnyOf**](docs/FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization -*FakeApi* | [**GetMixedOneOf**](docs/FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization -*FakeApi* | [**TestAdditionalPropertiesReference**](docs/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties -*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties -*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map -*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -151,10 +127,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -169,101 +144,12 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Model.Activity](docs/Activity.md) - - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) - - [Model.Apple](docs/Apple.md) - - [Model.AppleReq](docs/AppleReq.md) - - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [Model.ArrayTest](docs/ArrayTest.md) - - [Model.Banana](docs/Banana.md) - - [Model.BananaReq](docs/BananaReq.md) - - [Model.BasquePig](docs/BasquePig.md) - - [Model.Capitalization](docs/Capitalization.md) - - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - - [Model.ChildCat](docs/ChildCat.md) - - [Model.ClassModel](docs/ClassModel.md) - - [Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [Model.DanishPig](docs/DanishPig.md) - - [Model.DateOnlyClass](docs/DateOnlyClass.md) - - [Model.DeprecatedObject](docs/DeprecatedObject.md) - - [Model.Dog](docs/Dog.md) - - [Model.Drawing](docs/Drawing.md) - - [Model.EnumArrays](docs/EnumArrays.md) - - [Model.EnumClass](docs/EnumClass.md) - - [Model.EnumTest](docs/EnumTest.md) - - [Model.EquilateralTriangle](docs/EquilateralTriangle.md) - - [Model.File](docs/File.md) - - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Model.Foo](docs/Foo.md) - - [Model.FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - - [Model.FormatTest](docs/FormatTest.md) - - [Model.Fruit](docs/Fruit.md) - - [Model.FruitReq](docs/FruitReq.md) - - [Model.GmFruit](docs/GmFruit.md) - - [Model.GrandparentAnimal](docs/GrandparentAnimal.md) - - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [Model.HealthCheckResult](docs/HealthCheckResult.md) - - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [Model.List](docs/List.md) - - [Model.LiteralStringClass](docs/LiteralStringClass.md) - - [Model.Mammal](docs/Mammal.md) - - [Model.MapTest](docs/MapTest.md) - - [Model.MixedAnyOf](docs/MixedAnyOf.md) - - [Model.MixedAnyOfContent](docs/MixedAnyOfContent.md) - - [Model.MixedOneOf](docs/MixedOneOf.md) - - [Model.MixedOneOfContent](docs/MixedOneOfContent.md) - - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model.MixedSubId](docs/MixedSubId.md) - - [Model.Model200Response](docs/Model200Response.md) - - [Model.ModelClient](docs/ModelClient.md) - - [Model.Name](docs/Name.md) - - [Model.NotificationtestGetElementsV1ResponseMPayload](docs/NotificationtestGetElementsV1ResponseMPayload.md) - - [Model.NullableClass](docs/NullableClass.md) - - [Model.NullableGuidClass](docs/NullableGuidClass.md) - - [Model.NullableShape](docs/NullableShape.md) - - [Model.NumberOnly](docs/NumberOnly.md) - - [Model.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - - [Model.OneOfString](docs/OneOfString.md) - [Model.Order](docs/Order.md) - - [Model.OuterComposite](docs/OuterComposite.md) - - [Model.OuterEnum](docs/OuterEnum.md) - - [Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [Model.OuterEnumInteger](docs/OuterEnumInteger.md) - - [Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [Model.OuterEnumTest](docs/OuterEnumTest.md) - - [Model.ParentPet](docs/ParentPet.md) - [Model.Pet](docs/Pet.md) - - [Model.Pig](docs/Pig.md) - - [Model.PolymorphicProperty](docs/PolymorphicProperty.md) - - [Model.Quadrilateral](docs/Quadrilateral.md) - - [Model.QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Model.RequiredClass](docs/RequiredClass.md) - - [Model.Return](docs/Return.md) - - [Model.RolesReportsHash](docs/RolesReportsHash.md) - - [Model.RolesReportsHashRole](docs/RolesReportsHashRole.md) - - [Model.ScaleneTriangle](docs/ScaleneTriangle.md) - - [Model.Shape](docs/Shape.md) - - [Model.ShapeInterface](docs/ShapeInterface.md) - - [Model.ShapeOrNull](docs/ShapeOrNull.md) - - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) - - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - - [Model.Triangle](docs/Triangle.md) - - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) - - [Model.Whale](docs/Whale.md) - - [Model.Zebra](docs/Zebra.md) - - [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md) - - [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md) @@ -288,25 +174,3 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - -- **Type**: HTTP basic authentication - - -### bearer_test - -- **Type**: Bearer Authentication - - -### http_signature_test - -- **Type**: HTTP signature authentication - diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/api/openapi.yaml index 886c93019332..b9edae059aa9 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/api/openapi.yaml @@ -1,38 +1,17 @@ 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:\ - \ \" \\" + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: -- description: petstore server - url: "http://{server}.swagger.io:{port}/v2" - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: "https://localhost:8080/{version}" - variables: - version: - default: v2 - enum: - - v1 - - v2 -- description: The local server without variables - url: https://127.0.0.1/no_variable +- url: http://petstore.swagger.io/v2 tags: - description: Everything about your Pets name: pet @@ -41,41 +20,6 @@ tags: - description: Operations about user name: user paths: - /roles/report: - get: - responses: - "200": - content: - application/json: - schema: - items: - $ref: "#/components/schemas/RolesReport" - type: array - description: returns report - /hello: - get: - description: Hello - operationId: Hello - responses: - "200": - content: - application/json: - schema: - items: - format: uuid - type: string - type: array - description: UUIDs - summary: Hello - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: "#/components/schemas/_foo_get_default_response" - description: response /pet: post: description: "" @@ -83,10 +27,18 @@ paths: requestBody: $ref: "#/components/requestBodies/Pet" responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation "405": description: Invalid input security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -95,10 +47,22 @@ paths: - pet put: description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet operationId: updatePet requestBody: $ref: "#/components/requestBodies/Pet" responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation "400": description: Invalid ID supplied "404": @@ -106,16 +70,12 @@ paths: "405": description: Validation exception security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Update an existing pet tags: - pet - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -154,9 +114,7 @@ paths: "400": description: Invalid status value security: - - http_signature_test: [] - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -195,9 +153,7 @@ paths: "400": description: Invalid tag value security: - - http_signature_test: [] - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -262,7 +218,6 @@ paths: description: Pet not found security: - api_key: [] - - api_key_query: [] summary: Find pet by ID tags: - pet @@ -372,7 +327,7 @@ paths: summary: Place an order for a pet tags: - store - /store/order/{order_id}: + /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -381,7 +336,7 @@ paths: - description: ID of the order that needs to be deleted explode: false in: path - name: order_id + name: orderId required: true schema: type: string @@ -402,7 +357,7 @@ paths: - description: ID of pet that needs to be fetched explode: false in: path - name: order_id + name: orderId required: true schema: format: int64 @@ -441,6 +396,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Create user tags: - user @@ -453,6 +410,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user @@ -465,6 +424,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user @@ -479,6 +440,7 @@ paths: name: username required: true schema: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -534,6 +496,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Logs out current logged in user session tags: - user @@ -555,6 +519,8 @@ paths: description: Invalid username supplied "404": description: User not found + security: + - api_key: [] summary: Delete user tags: - user @@ -584,14 +550,6 @@ paths: description: Invalid username supplied "404": description: User not found - "598": - description: Not a real HTTP status code - "599": - content: - application/json: - schema: - $ref: "#/components/schemas/User" - description: Not a real HTTP status code with a return object summary: Get user by user name tags: - user @@ -619,2132 +577,205 @@ paths: description: Invalid user supplied "404": description: User not found + security: + - api_key: [] summary: Updated user tags: - user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: "#/components/requestBodies/Client" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/User" + type: array + description: List of user object + 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 + schemas: + Order: + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: + petId: format: int64 type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: + quantity: + format: int32 type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: format: int64 type: integer - style: form - responses: - "400": - description: Something wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) + name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + username: type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status format: int32 type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/testEnumParameters_request" - responses: - "400": - description: Invalid request - "404": - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: "#/components/requestBodies/Client" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: successful operation - summary: To test "client" model - tags: - - fake - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/testEndpointParameters_request" - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterNumber" - description: Input number as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterNumber" - description: Output number - tags: - - fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - parameters: - - description: Required UUID String - explode: true - in: query - name: required_string_uuid - required: true - schema: - format: uuid - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterString" - description: Input string as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterString" - description: Output string - tags: - - fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterBoolean" - description: Input boolean as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterBoolean" - description: Output boolean - tags: - - fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterComposite" - description: Input composite as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterComposite" - description: Output composite - tags: - - fake - /fake/jsonFormData: - get: - description: "" - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/testJsonFormData_request" - responses: - "200": - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/additionalProperties-reference: - post: - description: "" - operationId: testAdditionalPropertiesReference - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/FreeFormObject" - description: request body - required: true - responses: - "200": - description: successful operation - summary: test referenced additionalProperties - tags: - - fake - /fake/stringMap-reference: - post: - description: "" - operationId: testStringMapReference - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/MapOfString" - description: request body - required: true - responses: - "200": - description: successful operation - summary: test referenced string map - tags: - - fake - /fake/inline-additionalProperties: - post: - description: "" - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline additionalProperties - tags: - - fake - /fake/inline-freeform-additionalProperties: - post: - description: "" - operationId: testInlineFreeformAdditionalProperties - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/testInlineFreeformAdditionalProperties_request" - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline free-form additionalProperties - tags: - - fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/User" - required: true - responses: - "200": - description: Success - tags: - - fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: "#/components/requestBodies/Client" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: successful operation - summary: To test special tags - tags: - - $another-fake? - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/FileSchemaTestClass" - required: true - responses: - "200": - description: Success - tags: - - fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: true - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: requiredNotNullable - required: true - schema: - nullable: false - type: string - style: form - - explode: true - in: query - name: requiredNullable - required: true - schema: - nullable: true - type: string - style: form - - explode: true - in: query - name: notRequiredNotNullable - required: false - schema: - nullable: false - type: string - style: form - - explode: true - in: query - name: notRequiredNullable - required: false - schema: - nullable: true - type: string - style: form - responses: - "200": - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - description: "" - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - content: - multipart/form-data: - schema: - $ref: "#/components/schemas/uploadFileWithRequiredFile_request" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ApiResponse" - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: - schema: - $ref: "#/components/schemas/ApiResponse" - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - /fake/health: - get: - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/HealthCheckResult" - description: The instance started successfully - summary: Health check endpoint - tags: - - fake - /fake/array-of-enums: - get: - operationId: getArrayOfEnums - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ArrayOfEnums" - description: Got named array of enums - summary: Array of Enums - tags: - - fake - /fake/mixed/anyOf: - get: - operationId: getMixedAnyOf - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/MixedAnyOf" - description: Got mixed anyOf - summary: Test mixed type anyOf deserialization - tags: - - fake - /fake/mixed/oneOf: - get: - operationId: getMixedOneOf - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/MixedOneOf" - description: Got mixed oneOf - summary: Test mixed type oneOf deserialization - tags: - - fake - /country: - post: - operationId: getCountry - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/getCountry_request" - responses: - "200": - description: OK - /test: - get: - operationId: Test - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/notificationtest-getElements-v1-Response-mPayload" - description: Successful response - summary: Retrieve an existing Notificationtest's Elements -components: - requestBodies: - UserArray: - content: - application/json: - examples: - simple-list: - description: Should not get into code examples - summary: Simple list example - value: - - username: foo - - username: bar - schema: - items: - $ref: "#/components/schemas/User" - type: array - 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 - schemas: - RolesReport: - description: Roles report - items: - $ref: "#/components/schemas/RolesReportsHash" - type: array - RolesReportsHash: - description: Role report Hash - example: - role: - name: name - role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 - properties: - role_uuid: - format: uuid - type: string - role: - $ref: "#/components/schemas/RolesReportsHash_role" - type: object - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2020-02-02T20:20:20.000222Z - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - example: 2020-02-02T20:20:20.000222Z - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - objectWithNoDeclaredPropsNullable: "{}" - phone: phone - objectWithNoDeclaredProps: "{}" - id: 0 - anyTypePropNullable: "" - email: email - anyTypeProp: "" - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - objectWithNoDeclaredProps: - description: test code generation for objects Value must be a map of strings - to values. It cannot be the 'null' value. - type: object - objectWithNoDeclaredPropsNullable: - description: test code generation for nullable objects. Value must be a - map of strings to values or the 'null' value. - nullable: true - type: object - 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" - 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 - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: "#/components/schemas/Category" - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: "#/components/schemas/Tag" - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - 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" - - properties: - breed: - type: string - type: object - Cat: - allOf: - - $ref: "#/components/schemas/Animal" - - $ref: "#/components/schemas/Address" - - properties: - declawed: - type: boolean - type: object - Address: - additionalProperties: - type: integer - type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: "#/components/schemas/Animal" - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - multipleOf: 2 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - unsigned_integer: - format: int32 - maximum: 200 - minimum: 20 - type: integer - x-unsigned: true - int64: - format: int64 - type: integer - unsigned_long: - format: int64 - type: integer - x-unsigned: true - number: - maximum: 543.2 - minimum: 32.1 - multipleOf: 32.5 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - decimal: - format: number - type: string - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - type: string - binary: - format: binary - type: string - date: - example: 2020-02-02 - format: date - type: string - dateTime: - example: 2007-12-03T10:15:30+01:00 - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: "^\\d{10}$" - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: "/^image_\\d{1,3}$/i" - type: string - pattern_with_backslash: - description: None - pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ - /([0-9]|[1-2][0-9]|3[0-2]))$" - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Outer_Enum_Test: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_integer_only: - enum: - - 2 - - -2 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: "#/components/schemas/OuterEnum" - outerEnumInteger: - $ref: "#/components/schemas/OuterEnumInteger" - outerEnumDefaultValue: - $ref: "#/components/schemas/OuterEnumDefaultValue" - outerEnumIntegerDefaultValue: - $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - anytype_1: {} - map_with_undeclared_properties_anytype_1: - type: object - map_with_undeclared_properties_anytype_2: - properties: {} - type: object - map_with_undeclared_properties_anytype_3: - additionalProperties: true - type: object - empty_map: - additionalProperties: false - description: "an object with no declared properties and no undeclared properties,\ - \ hence it's an empty map." - type: object - map_with_undeclared_properties_string: - additionalProperties: - type: string - type: object - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid_with_pattern: - format: uuid - pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" - type: string - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: "#/components/schemas/Animal" - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - 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 - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: "#/components/schemas/ReadOnlyFirst" - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - x-cls-compliant: true - x-com-visible: true - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - FreeFormObject: - additionalProperties: true - description: A schema consisting only of additional properties - type: object - MapOfString: - additionalProperties: - type: string - description: A schema consisting only of additional properties of type string - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: "#/components/schemas/File" - files: - items: - $ref: "#/components/schemas/File" - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - _special_model.name_: - type: string - xml: - name: "$special[model.name]" - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. - example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - RequiredClass: - properties: - required_nullable_integer_prop: - nullable: true - type: integer - required_notnullableinteger_prop: - nullable: false - type: integer - not_required_nullable_integer_prop: - nullable: true - type: integer - not_required_notnullableinteger_prop: - nullable: false - type: integer - required_nullable_string_prop: - nullable: true - type: string - required_notnullable_string_prop: - nullable: false - type: string - notrequired_nullable_string_prop: - nullable: true - type: string - notrequired_notnullable_string_prop: - nullable: false - type: string - required_nullable_boolean_prop: - nullable: true - type: boolean - required_notnullable_boolean_prop: - nullable: false - type: boolean - notrequired_nullable_boolean_prop: - nullable: true - type: boolean - notrequired_notnullable_boolean_prop: - nullable: false - type: boolean - required_nullable_date_prop: - format: date - nullable: true - type: string - required_not_nullable_date_prop: - format: date - nullable: false - type: string - not_required_nullable_date_prop: - format: date - nullable: true - type: string - not_required_notnullable_date_prop: - format: date - nullable: false - type: string - required_notnullable_datetime_prop: - format: date-time - nullable: false - type: string - required_nullable_datetime_prop: - format: date-time - nullable: true - type: string - notrequired_nullable_datetime_prop: - format: date-time - nullable: true - type: string - notrequired_notnullable_datetime_prop: - format: date-time - nullable: false - type: string - required_nullable_enum_integer: - enum: - - 1 - - -1 - format: int32 - nullable: true - type: integer - required_notnullable_enum_integer: - enum: - - 1 - - -1 - format: int32 - nullable: false - type: integer - notrequired_nullable_enum_integer: - enum: - - 1 - - -1 - format: int32 - nullable: true - type: integer - notrequired_notnullable_enum_integer: - enum: - - 1 - - -1 - format: int32 - nullable: false - type: integer - required_nullable_enum_integer_only: - enum: - - 2 - - -2 - nullable: true - type: integer - required_notnullable_enum_integer_only: - enum: - - 2 - - -2 - nullable: false - type: integer - notrequired_nullable_enum_integer_only: - enum: - - 2 - - -2 - nullable: true - type: integer - notrequired_notnullable_enum_integer_only: - enum: - - 2 - - -2 - nullable: false - type: integer - required_notnullable_enum_string: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - nullable: false - type: string - required_nullable_enum_string: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - nullable: true - type: string - notrequired_nullable_enum_string: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - nullable: true - type: string - notrequired_notnullable_enum_string: - enum: - - UPPER - - lower - - "" - - "Value\twith tab" - - Value with " quote - - Value with escaped \" quote - - |- - Duplicate - value - - "Duplicate\r\nvalue" - nullable: false - type: string - required_nullable_outerEnumDefaultValue: - allOf: - - $ref: "#/components/schemas/OuterEnumDefaultValue" - nullable: true - required_notnullable_outerEnumDefaultValue: - allOf: - - $ref: "#/components/schemas/OuterEnumDefaultValue" - nullable: false - notrequired_nullable_outerEnumDefaultValue: - allOf: - - $ref: "#/components/schemas/OuterEnumDefaultValue" - nullable: true - notrequired_notnullable_outerEnumDefaultValue: - allOf: - - $ref: "#/components/schemas/OuterEnumDefaultValue" - nullable: false - required_nullable_uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - nullable: true - type: string - required_notnullable_uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - nullable: false - type: string - notrequired_nullable_uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - nullable: true - type: string - notrequired_notnullable_uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - nullable: false - type: string - required_nullable_array_of_string: - items: - type: string - nullable: true - type: array - required_notnullable_array_of_string: - items: - type: string - nullable: false - type: array - notrequired_nullable_array_of_string: - items: - type: string - nullable: true - type: array - notrequired_notnullable_array_of_string: - items: - type: string - nullable: false - type: array - required: - - required_not_nullable_date_prop - - required_notnullable_array_of_string - - required_notnullable_boolean_prop - - required_notnullable_datetime_prop - - required_notnullable_enum_integer - - required_notnullable_enum_integer_only - - required_notnullable_enum_string - - required_notnullable_outerEnumDefaultValue - - required_notnullable_string_prop - - required_notnullable_uuid - - required_notnullableinteger_prop - - required_nullable_array_of_string - - required_nullable_boolean_prop - - required_nullable_date_prop - - required_nullable_datetime_prop - - required_nullable_enum_integer - - required_nullable_enum_integer_only - - required_nullable_enum_string - - required_nullable_integer_prop - - required_nullable_outerEnumDefaultValue - - required_nullable_string_prop - - required_nullable_uuid + title: a User type: object - NullableClass: - additionalProperties: - nullable: true - type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 properties: - integer_prop: - nullable: true + id: + format: int64 type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - fruit: - additionalProperties: false - oneOf: - - $ref: "#/components/schemas/apple" - - $ref: "#/components/schemas/banana" - properties: - color: - type: string - apple: - nullable: true - properties: - cultivar: - pattern: "^[a-zA-Z\\s]*$" - type: string - origin: - pattern: "/^[A-Z\\s]*$/i" - type: string - color_code: - pattern: "^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$" - type: string - type: object - banana: - properties: - lengthCm: - type: number - type: object - mammal: - discriminator: - propertyName: className - oneOf: - - $ref: "#/components/schemas/whale" - - $ref: "#/components/schemas/zebra" - - $ref: "#/components/schemas/Pig" - whale: - properties: - hasBaleen: - type: boolean - hasTeeth: - type: boolean - className: - type: string - required: - - className - type: object - zebra: - additionalProperties: true - properties: - type: - enum: - - plains - - mountain - - grevys - type: string - className: - type: string - required: - - className - type: object - Pig: - discriminator: - propertyName: className - oneOf: - - $ref: "#/components/schemas/BasquePig" - - $ref: "#/components/schemas/DanishPig" - BasquePig: - properties: - className: - type: string - required: - - className - type: object - DanishPig: - properties: - className: - type: string - required: - - className - type: object - gmFruit: - additionalProperties: false - anyOf: - - $ref: "#/components/schemas/apple" - - $ref: "#/components/schemas/banana" - properties: - color: - type: string - fruitReq: - additionalProperties: false - nullable: true - oneOf: - - $ref: "#/components/schemas/appleReq" - - $ref: "#/components/schemas/bananaReq" - appleReq: - additionalProperties: false - properties: - cultivar: - type: string - mealy: - type: boolean - required: - - cultivar - type: object - bananaReq: - additionalProperties: false - properties: - lengthCm: - type: number - sweet: - type: boolean - required: - - lengthCm - type: object - Drawing: - additionalProperties: - $ref: "#/components/schemas/fruit" - properties: - mainShape: - $ref: "#/components/schemas/Shape" - shapeOrNull: - $ref: "#/components/schemas/ShapeOrNull" - nullableShape: - $ref: "#/components/schemas/NullableShape" - shapes: - items: - $ref: "#/components/schemas/Shape" - type: array - type: object - Shape: - discriminator: - propertyName: shapeType - oneOf: - - $ref: "#/components/schemas/Triangle" - - $ref: "#/components/schemas/Quadrilateral" - ShapeOrNull: - description: The value may be a shape or the 'null' value. This is introduced - in OAS schema >= 3.1. - discriminator: - propertyName: shapeType - nullable: true - oneOf: - - $ref: "#/components/schemas/Triangle" - - $ref: "#/components/schemas/Quadrilateral" - 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. - discriminator: - propertyName: shapeType - nullable: true - oneOf: - - $ref: "#/components/schemas/Triangle" - - $ref: "#/components/schemas/Quadrilateral" - ShapeInterface: - properties: - shapeType: - type: string - required: - - shapeType - TriangleInterface: - properties: - triangleType: - type: string - required: - - triangleType - Triangle: - discriminator: - propertyName: triangleType - oneOf: - - $ref: "#/components/schemas/EquilateralTriangle" - - $ref: "#/components/schemas/IsoscelesTriangle" - - $ref: "#/components/schemas/ScaleneTriangle" - EquilateralTriangle: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/TriangleInterface" - IsoscelesTriangle: - additionalProperties: false - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/TriangleInterface" - ScaleneTriangle: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/TriangleInterface" - QuadrilateralInterface: - properties: - quadrilateralType: - type: string - required: - - quadrilateralType - Quadrilateral: - discriminator: - propertyName: quadrilateralType - oneOf: - - $ref: "#/components/schemas/SimpleQuadrilateral" - - $ref: "#/components/schemas/ComplexQuadrilateral" - SimpleQuadrilateral: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/QuadrilateralInterface" - ComplexQuadrilateral: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/QuadrilateralInterface" - GrandparentAnimal: - discriminator: - propertyName: pet_type - properties: - pet_type: - type: string - required: - - pet_type - type: object - ParentPet: - allOf: - - $ref: "#/components/schemas/GrandparentAnimal" - type: object - ChildCat: - allOf: - - $ref: "#/components/schemas/ParentPet" - - properties: - name: - type: string - pet_type: - default: ChildCat - enum: - - ChildCat - type: string - x-enum-as-string: true - required: - - pet_type - type: object - ArrayOfEnums: - items: - $ref: "#/components/schemas/OuterEnum" - type: array - DateTimeTest: - default: 2010-01-01T10:10:10.000111+01:00 - example: 2010-01-01T10:10:10.000111+01:00 - format: date-time - type: string - DeprecatedObject: - deprecated: true - properties: name: type: string + title: Pet Tag type: object - ObjectWithDeprecatedFields: + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - type: string id: - deprecated: true - type: number - deprecatedRef: - $ref: "#/components/schemas/DeprecatedObject" - bars: - deprecated: true + format: int64 + type: integer + category: + $ref: "#/components/schemas/Category" + name: + example: doggie + type: string + photoUrls: items: - $ref: "#/components/schemas/Bar" + type: string type: array - type: object - PolymorphicProperty: - oneOf: - - type: boolean - - type: string - - type: object - - items: - $ref: "#/components/schemas/StringArrayItem" - type: array - StringArrayItem: - format: string - type: string - Activity: - description: test map of maps - properties: - activity_outputs: - additionalProperties: - $ref: "#/components/schemas/ActivityOutputRepresentation" - type: object - type: object - ActivityOutputRepresentation: - items: - $ref: "#/components/schemas/ActivityOutputElementRepresentation" - type: array - ActivityOutputElementRepresentation: - properties: - prop1: - type: string - prop2: - type: object - type: object - NullableGuidClass: - properties: - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - nullable: true - type: string - type: object - DateOnlyClass: - properties: - dateOnlyProperty: - example: 2017-07-21 - format: date - type: string - type: object - TestCollectionEndingWithWordListObject: - properties: - TestCollectionEndingWithWordList: + xml: + name: photoUrl + wrapped: true + tags: items: - $ref: "#/components/schemas/TestCollectionEndingWithWordList" + $ref: "#/components/schemas/Tag" type: array - type: object - TestCollectionEndingWithWordList: - properties: - value: - type: string - type: object - LiteralStringClass: - properties: - escapedLiteralString: - default: C:\\Users\\username - type: string - unescapedLiteralString: - default: C:\Users\username - type: string - type: object - OneOfString: - oneOf: - - pattern: ^a - type: string - - pattern: ^b - type: string - ZeroBasedEnum: - enum: - - unknown - - notUnknown - type: string - ZeroBasedEnumClass: - properties: - ZeroBasedEnum: + xml: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store enum: - - unknown - - notUnknown + - available + - pending + - sold type: string - type: object - Custom-Variableobject-Response: - additionalProperties: true - description: A Variable object without predefined property names - type: object - Field-pkiNotificationtestID: - type: integer - notificationtest-getElements-v1-Response-mPayload: - example: - a_objVariableobject: - - null - - null - pkiNotificationtestID: 0 - properties: - pkiNotificationtestID: - type: integer - a_objVariableobject: - items: - $ref: "#/components/schemas/Custom-Variableobject-Response" - type: array required: - - a_objVariableobject - - pkiNotificationtestID + - name + - photoUrls + title: a Pet type: object - MixedOneOf: - example: - content: MixedOneOf_content - properties: - content: - $ref: "#/components/schemas/MixedOneOf_content" - MixedAnyOf: + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource example: - content: MixedAnyOf_content - properties: - content: - $ref: "#/components/schemas/MixedAnyOf_content" - MixedSubId: + code: 0 + type: type + message: message properties: - id: + code: + format: int32 + type: integer + type: type: string - _foo_get_default_response: - example: - string: - bar: bar - properties: - string: - $ref: "#/components/schemas/Foo" + message: + type: string + title: An uploaded response type: object updatePetWithForm_request: properties: @@ -2765,165 +796,6 @@ components: format: binary type: string type: object - testEnumParameters_request: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - testEndpointParameters_request: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - testJsonFormData_request: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - testInlineFreeformAdditionalProperties_request: - additionalProperties: true - properties: - someProperty: - type: string - type: object - uploadFileWithRequiredFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - getCountry_request: - allOf: - - properties: - country: - type: string - required: - - country - type: object - RolesReportsHash_role: - example: - name: name - properties: - name: - type: string - type: object - MixedOneOf_content: - description: Mixed oneOf types for testing - oneOf: - - type: string - - type: boolean - - format: uint8 - type: integer - - format: float32 - type: number - - $ref: "#/components/schemas/MixedSubId" - MixedAnyOf_content: - anyOf: - - type: string - - type: boolean - - format: uint8 - type: integer - - format: float32 - type: number - - $ref: "#/components/schemas/MixedSubId" - description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: @@ -2937,18 +809,4 @@ components: in: header name: api_key type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ApiResponse.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ApiResponse.md index bb723d2baa13..50869c0d913e 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ApiResponse.md @@ -1,4 +1,5 @@ # Org.OpenAPITools.Model.ApiResponse +Describes the result of uploading an image resource ## Properties diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Category.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Category.md index 032a1faeb3ff..64e7948bbc7c 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Category.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Category.md @@ -1,11 +1,12 @@ # Org.OpenAPITools.Model.Category +A category for a pet ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **long** | | [optional] -**Name** | **string** | | [default to "default-name"] +**Name** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Order.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Order.md index 66c55c3b4737..c28989a0b8cf 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Order.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Order.md @@ -1,4 +1,5 @@ # Org.OpenAPITools.Model.Order +An order for a pets from the pet store ## Properties diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Pet.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Pet.md index c7224764e2d4..914a070b2200 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Pet.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Pet.md @@ -1,4 +1,5 @@ # Org.OpenAPITools.Model.Pet +A pet for sale in the pet store ## Properties diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/PetApi.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/PetApi.md index 417e0ab80207..ae0c9d116fbb 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/PetApi.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/PetApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -12,11 +12,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | | [**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | | [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | -| [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | # **AddPet** -> void AddPet (Pet pet) +> Pet AddPet (Pet pet) Add a new pet to the store @@ -35,7 +34,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -45,7 +44,8 @@ namespace Example try { // Add a new pet to the store - apiInstance.AddPet(pet); + Pet result = apiInstance.AddPet(pet); + Debug.WriteLine(result); } catch (ApiException e) { @@ -65,7 +65,10 @@ This returns an ApiResponse object which contains the response data, status code try { // Add a new pet to the store - apiInstance.AddPetWithHttpInfo(pet); + ApiResponse response = apiInstance.AddPetWithHttpInfo(pet); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); } catch (ApiException e) { @@ -83,21 +86,22 @@ catch (ApiException e) ### Return type -void (empty response body) +[**Pet**](Pet.md) ### 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**: Not defined + - **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | successful operation | - | | **405** | Invalid input | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -123,7 +127,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -215,7 +219,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -271,7 +275,7 @@ catch (ApiException e) ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -310,7 +314,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -366,7 +370,7 @@ catch (ApiException e) ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -405,15 +409,11 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure API key authorization: api_key config.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // config.AddApiKeyPrefix("api_key", "Bearer"); - // Configure API key authorization: api_key_query - config.AddApiKey("api_key_query", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // config.AddApiKeyPrefix("api_key_query", "Bearer"); var apiInstance = new PetApi(config); var petId = 789L; // long | ID of pet to return @@ -467,7 +467,7 @@ catch (ApiException e) ### Authorization -[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) +[api_key](../README.md#api_key) ### HTTP request headers @@ -486,7 +486,7 @@ catch (ApiException e) # **UpdatePet** -> void UpdatePet (Pet pet) +> Pet UpdatePet (Pet pet) Update an existing pet @@ -505,7 +505,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -515,7 +515,8 @@ namespace Example try { // Update an existing pet - apiInstance.UpdatePet(pet); + Pet result = apiInstance.UpdatePet(pet); + Debug.WriteLine(result); } catch (ApiException e) { @@ -535,7 +536,10 @@ This returns an ApiResponse object which contains the response data, status code try { // Update an existing pet - apiInstance.UpdatePetWithHttpInfo(pet); + ApiResponse response = apiInstance.UpdatePetWithHttpInfo(pet); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); } catch (ApiException e) { @@ -553,21 +557,22 @@ catch (ApiException e) ### Return type -void (empty response body) +[**Pet**](Pet.md) ### 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**: Not defined + - **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -595,7 +600,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -687,7 +692,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -762,99 +767,3 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **UploadFileWithRequiredFile** -> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string? additionalMetadata = null) - -uploads an image (required) - -### Example -```csharp -using System.Collections.Generic; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UploadFileWithRequiredFileExample - { - public static void Main() - { - Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; - // Configure OAuth2 access token for authorization: petstore_auth - config.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(config); - var petId = 789L; // long | ID of pet to update - var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload - var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional) - - try - { - // uploads an image (required) - ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - Debug.WriteLine(result); - } - catch (ApiException e) - { - Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); - } - } - } -} -``` - -#### Using the UploadFileWithRequiredFileWithHttpInfo variant -This returns an ApiResponse object which contains the response data, status code and headers. - -```csharp -try -{ - // uploads an image (required) - ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); - Debug.Write("Status Code: " + response.StatusCode); - Debug.Write("Response Headers: " + response.Headers); - Debug.Write("Response Body: " + response.Data); -} -catch (ApiException e) -{ - Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); - Debug.Print("Status Code: " + e.ErrorCode); - Debug.Print(e.StackTrace); -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------|------|-------------|-------| -| **petId** | **long** | ID of pet to update | | -| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | -| **additionalMetadata** | **string?** | Additional data to pass to server | [optional] | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/StoreApi.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/StoreApi.md index 179da0ff637e..510ff903494c 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/StoreApi.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/StoreApi.md @@ -1,12 +1,12 @@ # Org.OpenAPITools.Api.StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |--------|--------------|-------------| -| [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | | [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | -| [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | | [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | @@ -32,7 +32,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new StoreApi(config); var orderId = "orderId_example"; // string | ID of the order that needs to be deleted @@ -120,7 +120,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; // Configure API key authorization: api_key config.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -211,7 +211,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new StoreApi(config); var orderId = 789L; // long | ID of pet that needs to be fetched @@ -302,7 +302,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new StoreApi(config); var order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Tag.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Tag.md index fdd22eb31fdd..14e602a9c11b 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Tag.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Tag.md @@ -1,4 +1,5 @@ # Org.OpenAPITools.Model.Tag +A tag for a pet ## Properties diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/User.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/User.md index b0cd4dc042bf..c9ee356c8fc4 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/User.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/User.md @@ -1,4 +1,5 @@ # Org.OpenAPITools.Model.User +A User who is purchasing from the pet store ## Properties @@ -12,10 +13,6 @@ Name | Type | Description | Notes **Password** | **string** | | [optional] **Phone** | **string** | | [optional] **UserStatus** | **int** | User Status | [optional] -**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] -**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] -**AnyTypeProp** | **Object** | 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** | **Object** | 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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/UserApi.md b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/UserApi.md index 7b8439c45411..aebfd4cdc267 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/UserApi.md +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/UserApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -36,7 +36,12 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + var apiInstance = new UserApi(config); var user = new User(); // User | Created user object @@ -85,7 +90,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -121,7 +126,12 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + var apiInstance = new UserApi(config); var user = new List(); // List | List of user object @@ -170,7 +180,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -206,7 +216,12 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + var apiInstance = new UserApi(config); var user = new List(); // List | List of user object @@ -255,7 +270,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -293,7 +308,12 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + var apiInstance = new UserApi(config); var username = "username_example"; // string | The name that needs to be deleted @@ -342,7 +362,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -379,7 +399,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new UserApi(config); var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. @@ -446,8 +466,6 @@ No authorization required | **200** | successful operation | - | | **400** | Invalid username supplied | - | | **404** | User not found | - | -| **598** | Not a real HTTP status code | - | -| **599** | Not a real HTTP status code with a return object | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -472,7 +490,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new UserApi(config); var username = "username_example"; // string | The user name for login var password = "password_example"; // string | The password for login in clear text @@ -564,7 +582,12 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + var apiInstance = new UserApi(config); try @@ -608,7 +631,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -646,7 +669,12 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + var apiInstance = new UserApi(config); var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object @@ -697,7 +725,7 @@ void (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/PetApiTests.cs index f4b42c5f70d0..6ff7c900eacb 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -62,107 +62,8 @@ public void AddPetTest() { // TODO uncomment below to test the method and replace null with proper value //Pet pet = null; - //instance.AddPet(pet); - } - - /// - /// Test DeletePet - /// - [Fact] - public void DeletePetTest() - { - // TODO uncomment below to test the method and replace null with proper value - //long petId = null; - //string? apiKey = null; - //instance.DeletePet(petId, apiKey); - } - - /// - /// Test FindPetsByStatus - /// - [Fact] - public void FindPetsByStatusTest() - { - // TODO uncomment below to test the method and replace null with proper value - //List status = null; - //var response = instance.FindPetsByStatus(status); - //Assert.IsType>(response); - } - - /// - /// Test FindPetsByTags - /// - [Fact] - public void FindPetsByTagsTest() - { - // TODO uncomment below to test the method and replace null with proper value - //List tags = null; - //var response = instance.FindPetsByTags(tags); - //Assert.IsType>(response); - } - - /// - /// Test GetPetById - /// - [Fact] - public void GetPetByIdTest() - { - // TODO uncomment below to test the method and replace null with proper value - //long petId = null; - //var response = instance.GetPetById(petId); + //var response = instance.AddPet(pet); //Assert.IsType(response); } - - /// - /// Test UpdatePet - /// - [Fact] - public void UpdatePetTest() - { - // TODO uncomment below to test the method and replace null with proper value - //Pet pet = null; - //instance.UpdatePet(pet); - } - - /// - /// Test UpdatePetWithForm - /// - [Fact] - public void UpdatePetWithFormTest() - { - // TODO uncomment below to test the method and replace null with proper value - //long petId = null; - //string? name = null; - //string? status = null; - //instance.UpdatePetWithForm(petId, name, status); - } - - /// - /// Test UploadFile - /// - [Fact] - public void UploadFileTest() - { - // TODO uncomment below to test the method and replace null with proper value - //long petId = null; - //string? additionalMetadata = null; - //System.IO.Stream? file = null; - //var response = instance.UploadFile(petId, additionalMetadata, file); - //Assert.IsType(response); - } - - /// - /// Test UploadFileWithRequiredFile - /// - [Fact] - public void UploadFileWithRequiredFileTest() - { - // TODO uncomment below to test the method and replace null with proper value - //long petId = null; - //System.IO.Stream requiredFile = null; - //string? additionalMetadata = null; - //var response = instance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - //Assert.IsType(response); - } } } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs index 48e9f32748db..6c99ad951340 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/UserApiTests.cs index 792db5819a03..3f38396769e3 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/UserApiTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs index 901c6a02965e..eb9eb82931e1 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CategoryTests.cs index d1ef61862440..8c6fc5d10db7 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CategoryTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OrderTests.cs index 84d2828b367f..bf9fbd58b354 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OrderTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PetTests.cs index 535ab69d2aa2..1b7f6c023496 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PetTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TagTests.cs index 8f9ad604eab9..c994710b0e50 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TagTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/UserTests.cs index bc3cb3775de1..427b254ebe28 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/UserTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -125,41 +125,5 @@ public void UserStatusTest() { // TODO unit test for the property 'UserStatus' } - - /// - /// Test the property 'ObjectWithNoDeclaredProps' - /// - [Fact] - public void ObjectWithNoDeclaredPropsTest() - { - // TODO unit test for the property 'ObjectWithNoDeclaredProps' - } - - /// - /// Test the property 'ObjectWithNoDeclaredPropsNullable' - /// - [Fact] - public void ObjectWithNoDeclaredPropsNullableTest() - { - // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' - } - - /// - /// Test the property 'AnyTypeProp' - /// - [Fact] - public void AnyTypePropTest() - { - // TODO unit test for the property 'AnyTypeProp' - } - - /// - /// Test the property 'AnyTypePropNullable' - /// - [Fact] - public void AnyTypePropNullableTest() - { - // TODO unit test for the property 'AnyTypePropNullable' - } } } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/PetApi.cs index 33406b05254c..d89a7cc9fc53 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/PetApi.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -33,8 +33,8 @@ public interface IPetApiSync : IApiAccessor /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// - void AddPet(Pet pet, int operationIndex = 0); + /// Pet + Pet AddPet(Pet pet, int operationIndex = 0); /// /// Add a new pet to the store @@ -45,8 +45,8 @@ public interface IPetApiSync : IApiAccessor /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo(Pet pet, int operationIndex = 0); + /// ApiResponse of Pet + ApiResponse AddPetWithHttpInfo(Pet pet, int operationIndex = 0); /// /// Deletes a pet /// @@ -146,8 +146,8 @@ public interface IPetApiSync : IApiAccessor /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// - void UpdatePet(Pet pet, int operationIndex = 0); + /// Pet + Pet UpdatePet(Pet pet, int operationIndex = 0); /// /// Update an existing pet @@ -158,8 +158,8 @@ public interface IPetApiSync : IApiAccessor /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo(Pet pet, int operationIndex = 0); + /// ApiResponse of Pet + ApiResponse UpdatePetWithHttpInfo(Pet pet, int operationIndex = 0); /// /// Updates a pet in the store with form data /// @@ -208,30 +208,6 @@ public interface IPetApiSync : IApiAccessor /// Index associated with the operation. /// ApiResponse of ApiResponse ApiResponse UploadFileWithHttpInfo(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0); - /// - /// uploads an image (required) - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// ApiResponse - ApiResponse UploadFileWithRequiredFile(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0); - - /// - /// uploads an image (required) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0); #endregion Synchronous Operations } @@ -251,8 +227,8 @@ public interface IPetApiAsync : IApiAccessor /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// Task of Pet + System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Add a new pet to the store @@ -264,8 +240,8 @@ public interface IPetApiAsync : IApiAccessor /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Deletes a pet /// @@ -380,8 +356,8 @@ public interface IPetApiAsync : IApiAccessor /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of void - System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// Task of Pet + System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update an existing pet @@ -393,8 +369,8 @@ public interface IPetApiAsync : IApiAccessor /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Updates a pet in the store with form data /// @@ -453,35 +429,6 @@ public interface IPetApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); - /// - /// uploads an image (required) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); - - /// - /// uploads an image (required) - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -608,10 +555,11 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// - public void AddPet(Pet pet, int operationIndex = 0) + /// Pet + public Pet AddPet(Pet pet, int operationIndex = 0) { - AddPetWithHttpInfo(pet); + Org.OpenAPITools.Client.ApiResponse localVarResponse = AddPetWithHttpInfo(pet); + return localVarResponse.Data; } /// @@ -620,8 +568,8 @@ public void AddPet(Pet pet, int operationIndex = 0) /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet, int operationIndex = 0) + /// ApiResponse of Pet + public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet, int operationIndex = 0) { // verify the required parameter 'pet' is set if (pet == null) @@ -638,6 +586,8 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet, i // to determine the Accept header string[] _accepts = new string[] { + "application/xml", + "application/json" }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); @@ -674,25 +624,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet, i localVarRequestOptions.OAuth = true; } } - // authentication (http_signature_test) required - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "POST", "/pet", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request - var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); @@ -712,10 +646,11 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet, i /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + /// Task of Pet + public async System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { - await AddPetWithHttpInfoAsync(pet, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await AddPetWithHttpInfoAsync(pet, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; } /// @@ -725,8 +660,8 @@ public async System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'pet' is set if (pet == null) @@ -744,6 +679,8 @@ public async System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex // to determine the Accept header string[] _accepts = new string[] { + "application/xml", + "application/json" }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); @@ -779,25 +716,9 @@ public async System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex localVarRequestOptions.OAuth = true; } } - // authentication (http_signature_test) required - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "POST", "/pet", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { @@ -1057,22 +978,6 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn localVarRequestOptions.OAuth = true; } } - // authentication (http_signature_test) required - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByStatus", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); @@ -1163,22 +1068,6 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync(List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -1270,22 +1159,6 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo localVarRequestOptions.OAuth = true; } } - // authentication (http_signature_test) required - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByTags", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); @@ -1378,22 +1251,6 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync(List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -1466,11 +1323,6 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI { localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); } - // authentication (api_key_query) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) - { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); - } // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); @@ -1544,11 +1396,6 @@ public async System.Threading.Tasks.Task GetPetByIdAsync(long petId, int op { localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); } - // authentication (api_key_query) required - if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) - { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); - } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -1571,10 +1418,11 @@ public async System.Threading.Tasks.Task GetPetByIdAsync(long petId, int op /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// - public void UpdatePet(Pet pet, int operationIndex = 0) + /// Pet + public Pet UpdatePet(Pet pet, int operationIndex = 0) { - UpdatePetWithHttpInfo(pet); + Org.OpenAPITools.Client.ApiResponse localVarResponse = UpdatePetWithHttpInfo(pet); + return localVarResponse.Data; } /// @@ -1583,8 +1431,8 @@ public void UpdatePet(Pet pet, int operationIndex = 0) /// Thrown when fails to make API call /// Pet object that needs to be added to the store /// Index associated with the operation. - /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet, int operationIndex = 0) + /// ApiResponse of Pet + public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet, int operationIndex = 0) { // verify the required parameter 'pet' is set if (pet == null) @@ -1601,6 +1449,8 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // to determine the Accept header string[] _accepts = new string[] { + "application/xml", + "application/json" }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); @@ -1637,25 +1487,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet localVarRequestOptions.OAuth = true; } } - // authentication (http_signature_test) required - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "PUT", "/pet", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request - var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); @@ -1675,10 +1509,11 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + /// Task of Pet + public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { - await UpdatePetWithHttpInfoAsync(pet, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UpdatePetWithHttpInfoAsync(pet, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; } /// @@ -1688,8 +1523,8 @@ public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIn /// Pet object that needs to be added to the store /// Index associated with the operation. /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'pet' is set if (pet == null) @@ -1707,6 +1542,8 @@ public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIn // to determine the Accept header string[] _accepts = new string[] { + "application/xml", + "application/json" }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); @@ -1742,25 +1579,9 @@ public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIn localVarRequestOptions.OAuth = true; } } - // authentication (http_signature_test) required - if (this.Configuration.HttpSigningConfiguration != null) - { - var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "PUT", "/pet", localVarRequestOptions); - foreach (var headerItem in HttpSigningHeaders) - { - if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) - { - localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; - } - else - { - localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); - } - } - } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { @@ -2152,204 +1973,5 @@ public async System.Threading.Tasks.Task UploadFileAsync(long petId return localVarResponse; } - /// - /// uploads an image (required) - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// ApiResponse - public ApiResponse UploadFileWithRequiredFile(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0) - { - Org.OpenAPITools.Client.ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); - return localVarResponse.Data; - } - - /// - /// uploads an image (required) - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// ApiResponse of ApiResponse - public Org.OpenAPITools.Client.ApiResponse UploadFileWithRequiredFileWithHttpInfo(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0) - { - // verify the required parameter 'requiredFile' is set - if (requiredFile == null) - { - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); - } - - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "multipart/form-data" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - }; - - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - var localVarMultipartFormData = localVarContentType == "multipart/form-data"; - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter - if (additionalMetadata != null) - { - localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter - } - localVarRequestOptions.FileParameters.Add("requiredFile", requiredFile); - - localVarRequestOptions.Operation = "PetApi.UploadFileWithRequiredFile"; - localVarRequestOptions.OperationIndex = operationIndex; - - // authentication (petstore_auth) required - // oauth required - if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && - this.Configuration.OAuthFlow != null) - { - localVarRequestOptions.OAuth = true; - } - } - - // make the HTTP request - var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - - /// - /// uploads an image (required) - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) - { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, operationIndex, cancellationToken).ConfigureAwait(false); - return localVarResponse.Data; - } - - /// - /// uploads an image (required) - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) - /// Index associated with the operation. - /// Cancellation Token to cancel the request. - /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) - { - // verify the required parameter 'requiredFile' is set - if (requiredFile == null) - { - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); - } - - - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); - - string[] _contentTypes = new string[] { - "multipart/form-data" - }; - - // to determine the Accept header - string[] _accepts = new string[] { - "application/json", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - }; - - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) - { - localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); - } - - var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) - { - localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - } - - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter - if (additionalMetadata != null) - { - localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter - } - localVarRequestOptions.FileParameters.Add("requiredFile", requiredFile); - - localVarRequestOptions.Operation = "PetApi.UploadFileWithRequiredFile"; - localVarRequestOptions.OperationIndex = operationIndex; - - // authentication (petstore_auth) required - // oauth required - if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) - { - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) - { - localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); - } - else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && - !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && - this.Configuration.OAuthFlow != null) - { - localVarRequestOptions.OAuth = true; - } - } - - // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); - - if (this.ExceptionFactory != null) - { - Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) - { - throw _exception; - } - } - - return localVarResponse; - } - } } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/StoreApi.cs index 738ae73162bd..8dfe384a6b57 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/StoreApi.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -390,14 +390,14 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter localVarRequestOptions.Operation = "StoreApi.DeleteOrder"; localVarRequestOptions.OperationIndex = operationIndex; // make the HTTP request - var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Delete("/store/order/{orderId}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); @@ -461,14 +461,14 @@ public async System.Threading.Tasks.Task DeleteOrderAsync(string orderId, int op localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter localVarRequestOptions.Operation = "StoreApi.DeleteOrder"; localVarRequestOptions.OperationIndex = operationIndex; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{orderId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { @@ -665,14 +665,14 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter localVarRequestOptions.Operation = "StoreApi.GetOrderById"; localVarRequestOptions.OperationIndex = operationIndex; // make the HTTP request - var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Get("/store/order/{orderId}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); @@ -733,14 +733,14 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter localVarRequestOptions.Operation = "StoreApi.GetOrderById"; localVarRequestOptions.OperationIndex = operationIndex; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{orderId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/UserApi.cs index 590022faef87..7717ea40841c 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/UserApi.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -584,6 +584,11 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u localVarRequestOptions.Operation = "UserApi.CreateUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); @@ -656,6 +661,11 @@ public async System.Threading.Tasks.Task CreateUserAsync(User user, int operatio localVarRequestOptions.Operation = "UserApi.CreateUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -727,6 +737,11 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith localVarRequestOptions.Operation = "UserApi.CreateUsersWithArrayInput"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); @@ -799,6 +814,11 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(List("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -870,6 +890,11 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH localVarRequestOptions.Operation = "UserApi.CreateUsersWithListInput"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); @@ -942,6 +967,11 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync(List("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -1012,6 +1042,11 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string localVarRequestOptions.Operation = "UserApi.DeleteUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); @@ -1083,6 +1118,11 @@ public async System.Threading.Tasks.Task DeleteUserAsync(string username, int op localVarRequestOptions.Operation = "UserApi.DeleteUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -1456,6 +1496,11 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo(int op localVarRequestOptions.Operation = "UserApi.LogoutUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); @@ -1518,6 +1563,11 @@ public async System.Threading.Tasks.Task LogoutUserAsync(int operationIndex = 0, localVarRequestOptions.Operation = "UserApi.LogoutUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); @@ -1598,6 +1648,11 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string localVarRequestOptions.Operation = "UserApi.UpdateUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); @@ -1679,6 +1734,11 @@ public async System.Threading.Tasks.Task UpdateUserAsync(string username, User u localVarRequestOptions.Operation = "UserApi.UpdateUser"; localVarRequestOptions.OperationIndex = operationIndex; + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs index a8f6dea4407b..c4d1476cb207 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiException.cs index 67d9888d6a3c..dcc378ad208d 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiException.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiException.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiResponse.cs index ca2de833a5a4..6d91a6f7a47e 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index bcccf1e83f6f..39498419f390 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs index e2257409258c..2e1adf930029 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index da4f4499b1cc..da4342c30dd3 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ClientUtils.cs index a3765e002293..5b7acd47520f 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs index ccbe76060856..c89eee968eca 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -107,11 +107,6 @@ public class Configuration : IReadableConfiguration /// The operation servers private IReadOnlyDictionary>> _operationServers; - - /// - /// HttpSigning configuration - /// - private HttpSigningConfiguration _HttpSigningConfiguration = null; #endregion Private Members #region Constructors @@ -124,7 +119,7 @@ public Configuration() { Proxy = null; UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); - BasePath = "http://petstore.swagger.io:80/v2"; + BasePath = "http://petstore.swagger.io/v2"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); @@ -132,108 +127,13 @@ public Configuration() { { new Dictionary { - {"url", "http://{server}.swagger.io:{port}/v2"}, - {"description", "petstore server"}, - { - "variables", new Dictionary { - { - "server", new Dictionary { - {"description", "No description provided"}, - {"default_value", "petstore"}, - { - "enum_values", new List() { - "petstore", - "qa-petstore", - "dev-petstore" - } - } - } - }, - { - "port", new Dictionary { - {"description", "No description provided"}, - {"default_value", "80"}, - { - "enum_values", new List() { - "80", - "8080" - } - } - } - } - } - } - } - }, - { - new Dictionary { - {"url", "https://localhost:8080/{version}"}, - {"description", "The local server"}, - { - "variables", new Dictionary { - { - "version", new Dictionary { - {"description", "No description provided"}, - {"default_value", "v2"}, - { - "enum_values", new List() { - "v1", - "v2" - } - } - } - } - } - } - } - }, - { - new Dictionary { - {"url", "https://127.0.0.1/no_variable"}, - {"description", "The local server without variables"}, + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"}, } } }; OperationServers = new Dictionary>>() { - { - "PetApi.AddPet", new List> - { - { - new Dictionary - { - {"url", "http://petstore.swagger.io/v2"}, - {"description", "No description provided"} - } - }, - { - new Dictionary - { - {"url", "http://path-server-test.petstore.local/v2"}, - {"description", "No description provided"} - } - }, - } - }, - { - "PetApi.UpdatePet", new List> - { - { - new Dictionary - { - {"url", "http://petstore.swagger.io/v2"}, - {"description", "No description provided"} - } - }, - { - new Dictionary - { - {"url", "http://path-server-test.petstore.local/v2"}, - {"description", "No description provided"} - } - }, - } - }, }; // Setting Timeout has side effects (forces ApiClient creation). @@ -248,7 +148,7 @@ public Configuration( IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, - string basePath = "http://petstore.swagger.io:80/v2") : this() + string basePath = "http://petstore.swagger.io/v2") : this() { if (string.IsNullOrWhiteSpace(basePath)) throw new ArgumentException("The provided basePath is invalid.", "basePath"); @@ -652,15 +552,6 @@ private string GetServerUrl(IList> servers, return url; } - - /// - /// Gets and Sets the HttpSigningConfiguration - /// - public HttpSigningConfiguration HttpSigningConfiguration - { - get { return _HttpSigningConfiguration; } - set { _HttpSigningConfiguration = value; } - } /// /// Gets and Sets the RemoteCertificateValidationCallback @@ -744,7 +635,6 @@ public static IReadableConfiguration MergeConfigurations(IReadableConfiguration OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, - HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ExceptionFactory.cs index 43624dd7c86c..6ae2a10aae40 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ExceptionFactory.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index cbee70bca372..add21c02cd1b 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/HttpMethod.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/HttpMethod.cs index 39cde64b2a57..1dd692d8cfb2 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/HttpMethod.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/HttpMethod.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IApiAccessor.cs index 2bd764160046..c8a78e995ce9 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IApiAccessor.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IAsynchronousClient.cs index 2c268df7a1fc..e41f591be1f3 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IAsynchronousClient.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index ab66c761933f..1db047df0679 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -163,11 +163,6 @@ public interface IReadableConfiguration /// X509 Certificate collection. X509CertificateCollection ClientCertificates { get; } - /// - /// Gets the HttpSigning configuration - /// - HttpSigningConfiguration HttpSigningConfiguration { get; } - /// /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and /// overriding certificate errors in the scope of a request. diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ISynchronousClient.cs index 0e0a7fedacf6..3910f6d68ce1 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ISynchronousClient.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/ISynchronousClient.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Multimap.cs index 738a64c570b0..966d634a50b8 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Multimap.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/Multimap.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs index a5253e582013..dcc79edd9446 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RequestOptions.cs index f5e02e93f0f9..20366c4e7cc4 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RetryConfiguration.cs index e6080c67e845..500e02299dc7 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs index b3fc4c3c7a3a..675bb752f4b9 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs index 7dec589c62d6..9edc5c28265f 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model { /// - /// ApiResponse + /// Describes the result of uploading an image resource /// [DataContract(Name = "ApiResponse")] public partial class ApiResponse : IEquatable, IValidatableObject diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Category.cs index b56dfc0c4828..8099b7c64527 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Category.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -27,33 +27,20 @@ namespace Org.OpenAPITools.Model { /// - /// Category + /// A category for a pet /// [DataContract(Name = "Category")] public partial class Category : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected Category() - { - this.AdditionalProperties = new Dictionary(); - } /// /// Initializes a new instance of the class. /// /// id. - /// name (required) (default to "default-name"). - public Category(long id = default, string name = @"default-name") + /// name. + public Category(long id = default, string name = default) { - // to ensure "name" is required (not null) - if (name == null) - { - throw new ArgumentNullException("name is a required property for Category and cannot be null"); - } - this.Name = name; this.Id = id; + this.Name = name; this.AdditionalProperties = new Dictionary(); } @@ -66,7 +53,7 @@ public Category(long id = default, string name = @"default-name") /// /// Gets or Sets Name /// - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + [DataMember(Name = "name", EmitDefaultValue = false)] public string Name { get; set; } /// @@ -148,6 +135,15 @@ public override int GetHashCode() /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + if (this.Name != null) { + // Name (string) pattern + Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant); + if (!regexName.Match(this.Name).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" }); + } + } + yield break; } } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Order.cs index 6b8d5b268364..1b970204130f 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Order.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model { /// - /// Order + /// An order for a pets from the pet store /// [DataContract(Name = "Order")] public partial class Order : IEquatable, IValidatableObject @@ -106,9 +106,6 @@ public Order(long id = default, long petId = default, int quantity = default, Da /// /// Gets or Sets ShipDate /// - /* - 2020-02-02T20:20:20.000222Z - */ [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs index d6cf84c4d73f..04d7c548cd3c 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model { /// - /// Pet + /// A pet for sale in the pet store /// [DataContract(Name = "Pet")] public partial class Pet : IEquatable, IValidatableObject @@ -64,6 +64,7 @@ public enum StatusEnum /// /// pet status in the store [DataMember(Name = "status", EmitDefaultValue = false)] + [Obsolete] public StatusEnum? Status { get; set; } /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs index 662ad9138d5a..1218e11890e6 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model { /// - /// Tag + /// A tag for a pet /// [DataContract(Name = "Tag")] public partial class Tag : IEquatable, IValidatableObject diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/User.cs index 20b349a6dedf..c36b491eeb54 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/User.cs @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model { /// - /// User + /// A User who is purchasing from the pet store /// [DataContract(Name = "User")] public partial class User : IEquatable, IValidatableObject @@ -43,11 +43,7 @@ public partial class User : IEquatable, IValidatableObject /// password. /// phone. /// User Status. - /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. - /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. - /// 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. - /// 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.. - public User(long id = default, string username = default, string firstName = default, string lastName = default, string email = default, string password = default, string phone = default, int userStatus = default, Object objectWithNoDeclaredProps = default, Object objectWithNoDeclaredPropsNullable = default, Object anyTypeProp = default, Object anyTypePropNullable = default) + public User(long id = default, string username = default, string firstName = default, string lastName = default, string email = default, string password = default, string phone = default, int userStatus = default) { this.Id = id; this.Username = username; @@ -57,10 +53,6 @@ public User(long id = default, string username = default, string firstName = def this.Password = password; this.Phone = phone; this.UserStatus = userStatus; - this.ObjectWithNoDeclaredProps = objectWithNoDeclaredProps; - this.ObjectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; - this.AnyTypeProp = anyTypeProp; - this.AnyTypePropNullable = anyTypePropNullable; this.AdditionalProperties = new Dictionary(); } @@ -113,34 +105,6 @@ public User(long id = default, string username = default, string firstName = def [DataMember(Name = "userStatus", EmitDefaultValue = false)] public int UserStatus { get; set; } - /// - /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - /// - /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] - public Object ObjectWithNoDeclaredProps { get; set; } - - /// - /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - /// - /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] - public Object ObjectWithNoDeclaredPropsNullable { get; set; } - - /// - /// 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 - /// - /// 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 - [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] - public Object AnyTypeProp { get; set; } - - /// - /// 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. - /// - /// 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. - [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] - public Object AnyTypePropNullable { get; set; } - /// /// Gets or Sets additional properties /// @@ -163,10 +127,6 @@ public override string ToString() sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" Phone: ").Append(Phone).Append("\n"); sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); - sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); - sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); - sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -236,22 +196,6 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.Phone.GetHashCode(); } hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); - if (this.ObjectWithNoDeclaredProps != null) - { - hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); - } - if (this.ObjectWithNoDeclaredPropsNullable != null) - { - hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); - } - if (this.AnyTypeProp != null) - { - hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); - } - if (this.AnyTypePropNullable != null) - { - hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); - } if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/.gitignore b/samples/client/petstore/csharp/restsharp/net10/Petstore/.gitignore new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator-ignore b/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator-ignore new file mode 100644 index 000000000000..e30f94f2819e --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator-ignore @@ -0,0 +1,3 @@ +# OpenAPI Generator Ignore +# This test file has changes required for testing and should not be overwritten +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator/FILES new file mode 100644 index 000000000000..23eda3b9d097 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator/FILES @@ -0,0 +1,232 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.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/Category.md +docs/ChildCat.md +docs/ClassModel.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DateOnlyClass.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/IsoscelesTriangle.md +docs/List.md +docs/LiteralStringClass.md +docs/Mammal.md +docs/MapTest.md +docs/MixedAnyOf.md +docs/MixedAnyOfContent.md +docs/MixedOneOf.md +docs/MixedOneOfContent.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/MixedSubId.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NotificationtestGetElementsV1ResponseMPayload.md +docs/NullableClass.md +docs/NullableGuidClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/OneOfString.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterEnumTest.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/PolymorphicProperty.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/RequiredClass.md +docs/Return.md +docs/RolesReportsHash.md +docs/RolesReportsHashRole.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +docs/ZeroBasedEnum.md +docs/ZeroBasedEnumClass.md +git_push.sh +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs +src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpMethod.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Client/RetryConfiguration.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/Activity.cs +src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DateOnlyClass.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs +src/Org.OpenAPITools/Model/Mammal.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableGuidClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/OneOfString.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumTest.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/PolymorphicProperty.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/RequiredClass.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/RolesReportsHash.cs +src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Model/ZeroBasedEnum.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator/VERSION b/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator/VERSION new file mode 100644 index 000000000000..0610c66bc14f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.21.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/Org.OpenAPITools.sln b/samples/client/petstore/csharp/restsharp/net10/Petstore/Org.OpenAPITools.sln new file mode 100644 index 000000000000..5b15451c9dcf --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/README.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/README.md new file mode 100644 index 000000000000..5ade8d129169 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/README.md @@ -0,0 +1,312 @@ +# Org.OpenAPITools - the C# library for the OpenAPI Petstore + +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 C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Generator version: 7.21.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + + +## Frameworks supported + + +## Dependencies + +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 112.0.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +Install-Package System.ComponentModel.Annotations +Install-Package CompareNETObjects +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +``` + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello +*DefaultApi* | [**RolesReportGet**](docs/DefaultApi.md#rolesreportget) | **GET** /roles/report | +*DefaultApi* | [**Test**](docs/DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements +*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**GetArrayOfEnums**](docs/FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**GetMixedAnyOf**](docs/FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization +*FakeApi* | [**GetMixedOneOf**](docs/FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization +*FakeApi* | [**TestAdditionalPropertiesReference**](docs/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestInlineFreeformAdditionalProperties**](docs/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**TestStringMapReference**](docs/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) + - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Model.Animal](docs/Animal.md) + - [Model.ApiResponse](docs/ApiResponse.md) + - [Model.Apple](docs/Apple.md) + - [Model.AppleReq](docs/AppleReq.md) + - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Banana](docs/Banana.md) + - [Model.BananaReq](docs/BananaReq.md) + - [Model.BasquePig](docs/BasquePig.md) + - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) + - [Model.Category](docs/Category.md) + - [Model.ChildCat](docs/ChildCat.md) + - [Model.ClassModel](docs/ClassModel.md) + - [Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [Model.DanishPig](docs/DanishPig.md) + - [Model.DateOnlyClass](docs/DateOnlyClass.md) + - [Model.DeprecatedObject](docs/DeprecatedObject.md) + - [Model.Dog](docs/Dog.md) + - [Model.Drawing](docs/Drawing.md) + - [Model.EnumArrays](docs/EnumArrays.md) + - [Model.EnumClass](docs/EnumClass.md) + - [Model.EnumTest](docs/EnumTest.md) + - [Model.EquilateralTriangle](docs/EquilateralTriangle.md) + - [Model.File](docs/File.md) + - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Model.Foo](docs/Foo.md) + - [Model.FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [Model.FormatTest](docs/FormatTest.md) + - [Model.Fruit](docs/Fruit.md) + - [Model.FruitReq](docs/FruitReq.md) + - [Model.GmFruit](docs/GmFruit.md) + - [Model.GrandparentAnimal](docs/GrandparentAnimal.md) + - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.HealthCheckResult](docs/HealthCheckResult.md) + - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) + - [Model.Mammal](docs/Mammal.md) + - [Model.MapTest](docs/MapTest.md) + - [Model.MixedAnyOf](docs/MixedAnyOf.md) + - [Model.MixedAnyOfContent](docs/MixedAnyOfContent.md) + - [Model.MixedOneOf](docs/MixedOneOf.md) + - [Model.MixedOneOfContent](docs/MixedOneOfContent.md) + - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.MixedSubId](docs/MixedSubId.md) + - [Model.Model200Response](docs/Model200Response.md) + - [Model.ModelClient](docs/ModelClient.md) + - [Model.Name](docs/Name.md) + - [Model.NotificationtestGetElementsV1ResponseMPayload](docs/NotificationtestGetElementsV1ResponseMPayload.md) + - [Model.NullableClass](docs/NullableClass.md) + - [Model.NullableGuidClass](docs/NullableGuidClass.md) + - [Model.NullableShape](docs/NullableShape.md) + - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) + - [Model.OneOfString](docs/OneOfString.md) + - [Model.Order](docs/Order.md) + - [Model.OuterComposite](docs/OuterComposite.md) + - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [Model.OuterEnumInteger](docs/OuterEnumInteger.md) + - [Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [Model.OuterEnumTest](docs/OuterEnumTest.md) + - [Model.ParentPet](docs/ParentPet.md) + - [Model.Pet](docs/Pet.md) + - [Model.Pig](docs/Pig.md) + - [Model.PolymorphicProperty](docs/PolymorphicProperty.md) + - [Model.Quadrilateral](docs/Quadrilateral.md) + - [Model.QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.RequiredClass](docs/RequiredClass.md) + - [Model.Return](docs/Return.md) + - [Model.RolesReportsHash](docs/RolesReportsHash.md) + - [Model.RolesReportsHashRole](docs/RolesReportsHashRole.md) + - [Model.ScaleneTriangle](docs/ScaleneTriangle.md) + - [Model.Shape](docs/Shape.md) + - [Model.ShapeInterface](docs/ShapeInterface.md) + - [Model.ShapeOrNull](docs/ShapeOrNull.md) + - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [Model.SpecialModelName](docs/SpecialModelName.md) + - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) + - [Model.TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [Model.Triangle](docs/Triangle.md) + - [Model.TriangleInterface](docs/TriangleInterface.md) + - [Model.User](docs/User.md) + - [Model.Whale](docs/Whale.md) + - [Model.Zebra](docs/Zebra.md) + - [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md) + - [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### bearer_test + +- **Type**: Bearer Authentication + + +### http_signature_test + +- **Type**: HTTP signature authentication + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net10/Petstore/api/openapi.yaml new file mode 100644 index 000000000000..16251878c7d2 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/api/openapi.yaml @@ -0,0 +1,2956 @@ +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:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://localhost/v2 +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /roles/report: + get: + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/RolesReport" + type: array + description: returns report + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: "#/components/schemas/_foo_get_default_response" + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: "#/components/requestBodies/Pet" + 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 + summary: Update an existing pet + tags: + - pet + servers: + - url: http://localhost/v2 + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + application/json: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + application/json: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + - api_key_query: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/updatePetWithForm_request" + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Order" + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/User" + application/json: + schema: + $ref: "#/components/schemas/User" + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + "598": + description: Not a real HTTP status code + "599": + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Not a real HTTP status code with a return object + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEnumParameters_request" + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEndpointParameters_request" + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterNumber" + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterNumber" + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterString" + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterString" + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterComposite" + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterComposite" + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testJsonFormData_request" + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FreeFormObject" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MapOfString" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/testInlineFreeformAdditionalProperties_request" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FileSchemaTestClass" + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: requiredNotNullable + required: true + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: requiredNullable + required: true + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: notRequiredNotNullable + required: false + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: notRequiredNullable + required: false + schema: + nullable: true + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFileWithRequiredFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheckResult" + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ArrayOfEnums" + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MixedAnyOf" + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MixedOneOf" + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/getCountry_request" + responses: + "200": + description: OK + /test: + get: + operationId: Test + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/notificationtest-getElements-v1-Response-mPayload" + description: Successful response + summary: Retrieve an existing Notificationtest's Elements +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: "#/components/schemas/User" + type: array + 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 + schemas: + RolesReport: + description: Roles report + items: + $ref: "#/components/schemas/RolesReportsHash" + type: array + RolesReportsHash: + description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + role_uuid: + format: uuid + type: string + role: + $ref: "#/components/schemas/RolesReportsHash_role" + type: object + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + 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" + 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 + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: "#/components/schemas/Category" + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: "#/components/schemas/Tag" + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + 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" + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: "#/components/schemas/Animal" + - $ref: "#/components/schemas/Address" + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: "#/components/schemas/Animal" + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + pattern_with_backslash: + description: None + pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ + /([0-9]|[1-2][0-9]|3[0-2]))$" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Outer_Enum_Test: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: "#/components/schemas/OuterEnum" + outerEnumInteger: + $ref: "#/components/schemas/OuterEnumInteger" + outerEnumDefaultValue: + $ref: "#/components/schemas/OuterEnumDefaultValue" + outerEnumIntegerDefaultValue: + $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: "#/components/schemas/Animal" + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + 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 + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: "#/components/schemas/ReadOnlyFirst" + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: "#/components/schemas/File" + files: + items: + $ref: "#/components/schemas/File" + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + RequiredClass: + properties: + required_nullable_integer_prop: + nullable: true + type: integer + required_notnullableinteger_prop: + nullable: false + type: integer + not_required_nullable_integer_prop: + nullable: true + type: integer + not_required_notnullableinteger_prop: + nullable: false + type: integer + required_nullable_string_prop: + nullable: true + type: string + required_notnullable_string_prop: + nullable: false + type: string + notrequired_nullable_string_prop: + nullable: true + type: string + notrequired_notnullable_string_prop: + nullable: false + type: string + required_nullable_boolean_prop: + nullable: true + type: boolean + required_notnullable_boolean_prop: + nullable: false + type: boolean + notrequired_nullable_boolean_prop: + nullable: true + type: boolean + notrequired_notnullable_boolean_prop: + nullable: false + type: boolean + required_nullable_date_prop: + format: date + nullable: true + type: string + required_not_nullable_date_prop: + format: date + nullable: false + type: string + not_required_nullable_date_prop: + format: date + nullable: true + type: string + not_required_notnullable_date_prop: + format: date + nullable: false + type: string + required_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + required_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + notrequired_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + notrequired_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + required_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + required_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + notrequired_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + notrequired_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + required_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + required_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + notrequired_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + notrequired_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + required_nullable_outerEnumDefaultValue: + allOf: + - $ref: "#/components/schemas/OuterEnumDefaultValue" + nullable: true + required_notnullable_outerEnumDefaultValue: + allOf: + - $ref: "#/components/schemas/OuterEnumDefaultValue" + nullable: false + notrequired_nullable_outerEnumDefaultValue: + allOf: + - $ref: "#/components/schemas/OuterEnumDefaultValue" + nullable: true + notrequired_notnullable_outerEnumDefaultValue: + allOf: + - $ref: "#/components/schemas/OuterEnumDefaultValue" + nullable: false + required_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + required_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + notrequired_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + notrequired_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + required_nullable_array_of_string: + items: + type: string + nullable: true + type: array + required_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + notrequired_nullable_array_of_string: + items: + type: string + nullable: true + type: array + notrequired_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + required: + - required_not_nullable_date_prop + - required_notnullable_array_of_string + - required_notnullable_boolean_prop + - required_notnullable_datetime_prop + - required_notnullable_enum_integer + - required_notnullable_enum_integer_only + - required_notnullable_enum_string + - required_notnullable_outerEnumDefaultValue + - required_notnullable_string_prop + - required_notnullable_uuid + - required_notnullableinteger_prop + - required_nullable_array_of_string + - required_nullable_boolean_prop + - required_nullable_date_prop + - required_nullable_datetime_prop + - required_nullable_enum_integer + - required_nullable_enum_integer_only + - required_nullable_enum_string + - required_nullable_integer_prop + - required_nullable_outerEnumDefaultValue + - required_nullable_string_prop + - required_nullable_uuid + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + color_code: + pattern: "^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: "#/components/schemas/whale" + - $ref: "#/components/schemas/zebra" + - $ref: "#/components/schemas/Pig" + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: "#/components/schemas/BasquePig" + - $ref: "#/components/schemas/DanishPig" + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + properties: + color: + type: string + fruitReq: + additionalProperties: false + nullable: true + oneOf: + - $ref: "#/components/schemas/appleReq" + - $ref: "#/components/schemas/bananaReq" + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: "#/components/schemas/fruit" + properties: + mainShape: + $ref: "#/components/schemas/Shape" + shapeOrNull: + $ref: "#/components/schemas/ShapeOrNull" + nullableShape: + $ref: "#/components/schemas/NullableShape" + shapes: + items: + $ref: "#/components/schemas/Shape" + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + 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. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: "#/components/schemas/EquilateralTriangle" + - $ref: "#/components/schemas/IsoscelesTriangle" + - $ref: "#/components/schemas/ScaleneTriangle" + EquilateralTriangle: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + ScaleneTriangle: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: "#/components/schemas/SimpleQuadrilateral" + - $ref: "#/components/schemas/ComplexQuadrilateral" + SimpleQuadrilateral: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/QuadrilateralInterface" + ComplexQuadrilateral: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/QuadrilateralInterface" + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: "#/components/schemas/GrandparentAnimal" + type: object + ChildCat: + allOf: + - $ref: "#/components/schemas/ParentPet" + - properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + required: + - pet_type + type: object + ArrayOfEnums: + items: + $ref: "#/components/schemas/OuterEnum" + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: "#/components/schemas/DeprecatedObject" + bars: + deprecated: true + items: + $ref: "#/components/schemas/Bar" + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: "#/components/schemas/StringArrayItem" + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: "#/components/schemas/ActivityOutputRepresentation" + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: "#/components/schemas/ActivityOutputElementRepresentation" + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: "#/components/schemas/TestCollectionEndingWithWordList" + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + OneOfString: + oneOf: + - pattern: ^a + type: string + - pattern: ^b + type: string + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + ZeroBasedEnumClass: + properties: + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + type: object + Custom-Variableobject-Response: + additionalProperties: true + description: A Variable object without predefined property names + type: object + Field-pkiNotificationtestID: + type: integer + notificationtest-getElements-v1-Response-mPayload: + example: + a_objVariableobject: + - null + - null + pkiNotificationtestID: 0 + properties: + pkiNotificationtestID: + type: integer + a_objVariableobject: + items: + $ref: "#/components/schemas/Custom-Variableobject-Response" + type: array + required: + - a_objVariableobject + - pkiNotificationtestID + type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: "#/components/schemas/MixedOneOf_content" + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: "#/components/schemas/MixedAnyOf_content" + MixedSubId: + properties: + id: + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: "#/components/schemas/Foo" + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request: + allOf: + - properties: + country: + type: string + required: + - country + type: object + RolesReportsHash_role: + example: + name: name + properties: + name: + type: string + type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: "#/components/schemas/MixedSubId" + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: "#/components/schemas/MixedSubId" + description: Mixed anyOf types for testing + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/appveyor.yml b/samples/client/petstore/csharp/restsharp/net10/Petstore/appveyor.yml new file mode 100644 index 000000000000..f76f63cee506 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Activity.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Activity.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Activity.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Activity.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ActivityOutputElementRepresentation.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ActivityOutputElementRepresentation.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ActivityOutputElementRepresentation.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AdditionalPropertiesClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AdditionalPropertiesClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Animal.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Animal.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Animal.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Animal.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AnotherFakeApi.md similarity index 95% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AnotherFakeApi.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AnotherFakeApi.md index 01da3a93e620..3ae670d20f7d 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.AnotherFakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -29,7 +29,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new AnotherFakeApi(config); var modelClient = new ModelClient(); // ModelClient | client model diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ApiResponse.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ApiResponse.md new file mode 100644 index 000000000000..bb723d2baa13 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Type** | **string** | | [optional] +**Message** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Apple.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Apple.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Apple.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Apple.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AppleReq.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AppleReq.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/AppleReq.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/AppleReq.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ArrayOfArrayOfNumberOnly.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ArrayOfArrayOfNumberOnly.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ArrayOfNumberOnly.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ArrayOfNumberOnly.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ArrayTest.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ArrayTest.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ArrayTest.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ArrayTest.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Banana.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Banana.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Banana.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Banana.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/BananaReq.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/BananaReq.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/BananaReq.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/BananaReq.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/BasquePig.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/BasquePig.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/BasquePig.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/BasquePig.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Capitalization.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Capitalization.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Capitalization.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Capitalization.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Cat.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Cat.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Cat.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Cat.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/CatAllOf.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/CatAllOf.md new file mode 100644 index 000000000000..6cbaaa14e814 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Category.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Category.md new file mode 100644 index 000000000000..032a1faeb3ff --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ChildCat.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ChildCat.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ChildCat.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ChildCat.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ChildCatAllOf.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ChildCatAllOf.md new file mode 100644 index 000000000000..864d33e80e7a --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ChildCatAllOf.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ClassModel.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ClassModel.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ClassModel.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ClassModel.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ComplexQuadrilateral.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ComplexQuadrilateral.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ComplexQuadrilateral.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ComplexQuadrilateral.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DanishPig.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DanishPig.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DanishPig.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DanishPig.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DateOnlyClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DateOnlyClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DateOnlyClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DateOnlyClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DefaultApi.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DefaultApi.md similarity index 96% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DefaultApi.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DefaultApi.md index d9d4abc6ebbc..87a8c5000dfd 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.DefaultApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -31,7 +31,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try @@ -113,7 +113,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); var country = "country_example"; // string | @@ -198,7 +198,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try @@ -282,7 +282,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try @@ -364,7 +364,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DeprecatedObject.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DeprecatedObject.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/DeprecatedObject.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DeprecatedObject.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Dog.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Dog.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Dog.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Dog.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DogAllOf.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DogAllOf.md new file mode 100644 index 000000000000..c1096f2c3105 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Drawing.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Drawing.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Drawing.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Drawing.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EnumArrays.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EnumArrays.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EnumArrays.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EnumArrays.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EnumClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EnumClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EnumClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EnumClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EnumTest.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EnumTest.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EnumTest.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EnumTest.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EquilateralTriangle.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EquilateralTriangle.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/EquilateralTriangle.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/EquilateralTriangle.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FakeApi.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FakeApi.md similarity index 97% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FakeApi.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FakeApi.md index 933fb1c7cad3..fcf74f62c255 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FakeApi.md +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FakeApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.FakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -46,7 +46,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -132,7 +132,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var body = true; // bool? | Input boolean as post body (optional) @@ -221,7 +221,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var outerComposite = new OuterComposite?(); // OuterComposite? | Input composite as post body (optional) @@ -310,7 +310,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var body = 8.14D; // decimal? | Input number as post body (optional) @@ -399,7 +399,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string? | Input string as post body (optional) @@ -488,7 +488,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -572,7 +572,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -656,7 +656,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -740,7 +740,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requestBody = new Dictionary(); // Dictionary | request body @@ -827,7 +827,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | @@ -910,7 +910,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var query = "query_example"; // string | var user = new User(); // User | @@ -997,7 +997,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var modelClient = new ModelClient(); // ModelClient | client model @@ -1088,7 +1088,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure HTTP basic authorization: http_basic_test config.Username = "YOUR_USERNAME"; config.Password = "YOUR_PASSWORD"; @@ -1206,7 +1206,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List?(); // List? | Header parameter enum test (string array) (optional) var enumHeaderString = "_abc"; // string? | Header parameter enum test (string) (optional) (default to -efg) @@ -1308,7 +1308,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure Bearer token for authorization: bearer_test config.AccessToken = "YOUR_BEARER_TOKEN"; @@ -1406,7 +1406,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requestBody = new Dictionary(); // Dictionary | request body @@ -1491,7 +1491,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body @@ -1576,7 +1576,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var param = "param_example"; // string | field1 var param2 = "param2_example"; // string | field2 @@ -1665,7 +1665,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var pipe = new List(); // List | var ioutil = new List(); // List | @@ -1764,7 +1764,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requestBody = new Dictionary(); // Dictionary | request body diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FakeClassnameTags123Api.md similarity index 96% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FakeClassnameTags123Api.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FakeClassnameTags123Api.md index 17c4f35d8a39..5c9c261f72c0 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.FakeClassnameTags123Api -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -29,7 +29,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure API key authorization: api_key_query config.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/File.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/File.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/File.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/File.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FileSchemaTestClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FileSchemaTestClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FileSchemaTestClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FileSchemaTestClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Foo.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Foo.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Foo.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Foo.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FooGetDefaultResponse.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FooGetDefaultResponse.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FooGetDefaultResponse.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FooGetDefaultResponse.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FormatTest.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FormatTest.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FormatTest.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FormatTest.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Fruit.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Fruit.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Fruit.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Fruit.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FruitReq.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FruitReq.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/FruitReq.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/FruitReq.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/GmFruit.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/GmFruit.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/GmFruit.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/GmFruit.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/GrandparentAnimal.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/GrandparentAnimal.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/GrandparentAnimal.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/GrandparentAnimal.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/HasOnlyReadOnly.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/HasOnlyReadOnly.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/HasOnlyReadOnly.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/HealthCheckResult.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/HealthCheckResult.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/HealthCheckResult.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/HealthCheckResult.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/IsoscelesTriangle.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/IsoscelesTriangle.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/IsoscelesTriangle.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/IsoscelesTriangle.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/List.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/List.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/List.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/List.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/LiteralStringClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/LiteralStringClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/LiteralStringClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/LiteralStringClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Mammal.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Mammal.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Mammal.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Mammal.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MapTest.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MapTest.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MapTest.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MapTest.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedAnyOf.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedAnyOf.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedAnyOf.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedAnyOf.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedAnyOfContent.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedAnyOfContent.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedAnyOfContent.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedAnyOfContent.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedEnumType.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedEnumType.md new file mode 100644 index 000000000000..24385b3ae84f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedEnumType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.MixedEnumType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedNullableEnumType.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedNullableEnumType.md new file mode 100644 index 000000000000..a38369d002d1 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedNullableEnumType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.MixedNullableEnumType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedOneOf.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedOneOf.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedOneOf.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedOneOf.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedOneOfContent.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedOneOfContent.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedOneOfContent.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedOneOfContent.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedSubId.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedSubId.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/MixedSubId.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/MixedSubId.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Model200Response.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Model200Response.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Model200Response.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Model200Response.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ModelClient.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ModelClient.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ModelClient.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ModelClient.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Name.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Name.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Name.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Name.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NotificationtestGetElementsV1ResponseMPayload.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NotificationtestGetElementsV1ResponseMPayload.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NotificationtestGetElementsV1ResponseMPayload.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NotificationtestGetElementsV1ResponseMPayload.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NullableClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NullableClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NullableClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NullableClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NullableGuidClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NullableGuidClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NullableGuidClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NullableGuidClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NullableShape.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NullableShape.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NullableShape.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NullableShape.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NumberOnly.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NumberOnly.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/NumberOnly.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/NumberOnly.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ObjectWithDeprecatedFields.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ObjectWithDeprecatedFields.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OneOfString.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OneOfString.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OneOfString.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OneOfString.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Order.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Order.md new file mode 100644 index 000000000000..66c55c3b4737 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterComposite.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterComposite.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterComposite.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterComposite.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnum.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnum.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnum.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnum.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumDefaultValue.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumDefaultValue.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumDefaultValue.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumInteger.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumInteger.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumInteger.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumInteger.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumTest.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumTest.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/OuterEnumTest.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/OuterEnumTest.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ParentPet.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ParentPet.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ParentPet.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ParentPet.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Pet.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Pet.md new file mode 100644 index 000000000000..c7224764e2d4 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Tags** | [**List<Tag>**](Tag.md) | | [optional] +**Status** | **string** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/PetApi.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/PetApi.md new file mode 100644 index 000000000000..7d237f0d529f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/PetApi.md @@ -0,0 +1,860 @@ +# Org.OpenAPITools.Api.PetApi + +All URIs are relative to *http://localhost/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + +# **AddPet** +> void AddPet (Pet pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AddPetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add a new pet to the store + apiInstance.AddPetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeletePet** +> void DeletePet (long petId, string? apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string? | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Deletes a pet + apiInstance.DeletePetWithHttpInfo(petId, apiKey); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | Pet id to delete | | +| **apiKey** | **string?** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByStatus** +> List<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by status + ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **status** | [**List<string>**](string.md) | Status values that need to be considered for filter | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByTags** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by tags + ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **tags** | [**List<string>**](string.md) | Tags to filter by | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetPetById** +> Pet GetPetById (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPetByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find pet by ID + ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update an existing pet + apiInstance.UpdatePetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long petId, string? name = null, string? status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string? | Updated name of the pet (optional) + var status = "status_example"; // string? | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithFormWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updates a pet in the store with form data + apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet that needs to be updated | | +| **name** | **string?** | Updated name of the pet | [optional] | +| **status** | **string?** | Updated status of the pet | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long petId, string? additionalMetadata = null, System.IO.Stream? file = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream? | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image + ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, additionalMetadata, file); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **additionalMetadata** | **string?** | Additional data to pass to server | [optional] | +| **file** | **System.IO.Stream?****System.IO.Stream?** | file to upload | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFileWithRequiredFile** +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string? additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithRequiredFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image (required) + ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | +| **additionalMetadata** | **string?** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Pig.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Pig.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Pig.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Pig.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/PolymorphicProperty.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/PolymorphicProperty.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/PolymorphicProperty.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/PolymorphicProperty.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Quadrilateral.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Quadrilateral.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Quadrilateral.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Quadrilateral.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/QuadrilateralInterface.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/QuadrilateralInterface.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/QuadrilateralInterface.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/QuadrilateralInterface.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ReadOnlyFirst.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ReadOnlyFirst.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ReadOnlyFirst.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/RequiredClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/RequiredClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/RequiredClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/RequiredClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Return.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Return.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Return.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Return.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/RolesReportsHash.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/RolesReportsHash.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/RolesReportsHash.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/RolesReportsHash.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/RolesReportsHashRole.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/RolesReportsHashRole.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/RolesReportsHashRole.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ScaleneTriangle.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ScaleneTriangle.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ScaleneTriangle.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ScaleneTriangle.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Shape.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Shape.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Shape.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Shape.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ShapeInterface.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ShapeInterface.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ShapeInterface.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ShapeInterface.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ShapeOrNull.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ShapeOrNull.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ShapeOrNull.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ShapeOrNull.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/SimpleQuadrilateral.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/SimpleQuadrilateral.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/SimpleQuadrilateral.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/SimpleQuadrilateral.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/SpecialModelName.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/SpecialModelName.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/SpecialModelName.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/SpecialModelName.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/StoreApi.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/StoreApi.md new file mode 100644 index 000000000000..c89ac7ed28b5 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/StoreApi.md @@ -0,0 +1,373 @@ +# Org.OpenAPITools.Api.StoreApi + +All URIs are relative to *http://localhost/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + +# **DeleteOrder** +> void DeleteOrder (string orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete purchase order by ID + apiInstance.DeleteOrderWithHttpInfo(orderId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **string** | ID of the order that needs to be deleted | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetInventory** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetInventoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Returns pet inventories by status + ApiResponse> response = apiInstance.GetInventoryWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetOrderById** +> Order GetOrderById (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetOrderByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find purchase order by ID + ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **long** | ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PlaceOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Place an order for a pet + ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **order** | [**Order**](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Tag.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Tag.md new file mode 100644 index 000000000000..fdd22eb31fdd --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TestCollectionEndingWithWordList.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TestCollectionEndingWithWordList.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TestCollectionEndingWithWordList.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TestCollectionEndingWithWordListObject.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TestCollectionEndingWithWordListObject.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TestCollectionEndingWithWordListObject.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TestInlineFreeformAdditionalPropertiesRequest.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TestInlineFreeformAdditionalPropertiesRequest.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TestInlineFreeformAdditionalPropertiesRequest.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Triangle.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Triangle.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Triangle.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Triangle.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TriangleInterface.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TriangleInterface.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/TriangleInterface.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/TriangleInterface.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/UpdatePet200Response.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/UpdatePet200Response.md new file mode 100644 index 000000000000..d1625d266647 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/UpdatePet200Response.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.UpdatePet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarString** | [**Pet**](Pet.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/User.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/User.md new file mode 100644 index 000000000000..b0cd4dc042bf --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**AnyTypeProp** | **Object** | 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** | **Object** | 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/UserApi.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/UserApi.md new file mode 100644 index 000000000000..414907dcc216 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/UserApi.md @@ -0,0 +1,715 @@ +# Org.OpenAPITools.Api.UserApi + +All URIs are relative to *http://localhost/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + +# **CreateUser** +> void CreateUser (User user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create user + apiInstance.CreateUserWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Created user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithArrayInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithListInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithListInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete user + apiInstance.DeleteUserWithHttpInfo(username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be deleted | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUserByNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get user by user name + ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | +| **598** | Not a real HTTP status code | - | +| **599** | Not a real HTTP status code with a return object | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LoginUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs user into the system + ApiResponse response = apiInstance.LoginUserWithHttpInfo(username, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The user name for login | | +| **password** | **string** | The password for login in clear text | | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LogoutUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs out current logged in user session + apiInstance.LogoutUserWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateUser** +> void UpdateUser (string username, User user) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | name that need to be deleted + var user = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updated user + apiInstance.UpdateUserWithHttpInfo(username, user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | name that need to be deleted | | +| **user** | [**User**](User.md) | Updated user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Whale.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Whale.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Whale.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Whale.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Zebra.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Zebra.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/Zebra.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/Zebra.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ZeroBasedEnum.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ZeroBasedEnum.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ZeroBasedEnum.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ZeroBasedEnum.md diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ZeroBasedEnumClass.md b/samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ZeroBasedEnumClass.md similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/docs/ZeroBasedEnumClass.md rename to samples/client/petstore/csharp/restsharp/net10/Petstore/docs/ZeroBasedEnumClass.md diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh b/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs similarity index 93% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index c436338550ab..20dfede3f9b1 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -84,7 +84,7 @@ public void FakeOuterBooleanSerializeTest() public void FakeOuterCompositeSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterComposite? outerComposite = null; + //OuterComposite outerComposite = null; //var response = instance.FakeOuterCompositeSerialize(outerComposite); //Assert.IsType(response); } @@ -109,7 +109,7 @@ public void FakeOuterStringSerializeTest() { // TODO uncomment below to test the method and replace null with proper value //Guid requiredStringUuid = null; - //string? body = null; + //string body = null; //var response = instance.FakeOuterStringSerialize(requiredStringUuid, body); //Assert.IsType(response); } @@ -208,12 +208,12 @@ public void TestEndpointParametersTest() //int? int32 = null; //long? int64 = null; //float? varFloat = null; - //string? varString = null; - //System.IO.Stream? binary = null; - //DateOnly? date = null; + //string varString = null; + //System.IO.Stream binary = null; + //DateTime? date = null; //DateTime? dateTime = null; - //string? password = null; - //string? callback = null; + //string password = null; + //string callback = null; //instance.TestEndpointParameters(number, varDouble, patternWithoutDelimiter, varByte, integer, int32, int64, varFloat, varString, binary, date, dateTime, password, callback); } @@ -224,14 +224,14 @@ public void TestEndpointParametersTest() public void TestEnumParametersTest() { // TODO uncomment below to test the method and replace null with proper value - //List? enumHeaderStringArray = null; - //string? enumHeaderString = null; - //List? enumQueryStringArray = null; - //string? enumQueryString = null; + //List enumHeaderStringArray = null; + //string enumHeaderString = null; + //List enumQueryStringArray = null; + //string enumQueryString = null; //int? enumQueryInteger = null; //double? enumQueryDouble = null; - //List? enumFormStringArray = null; - //string? enumFormString = null; + //List enumFormStringArray = null; + //string enumFormString = null; //instance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -299,8 +299,8 @@ public void TestQueryParameterCollectionFormatTest() //List context = null; //string requiredNotNullable = null; //string requiredNullable = null; - //string? notRequiredNotNullable = null; - //string? notRequiredNullable = null; + //string notRequiredNotNullable = null; + //string notRequiredNullable = null; //instance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 000000000000..e0779fde00f2 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,377 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing PetApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class PetApiTests : IDisposable + { + private PetApi instance; + + private long petId = 11088; + + /// + /// Create a Pet object + /// + private Pet createPet() + { + // create pet + Pet p = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + p.Id = petId; + //p.Name = "Csharp test"; + p.Status = Pet.StatusEnum.Available; + // create Category object + Category category = new Category(); + category.Id = 56; + category.Name = "sample category name2"; + List photoUrls = new List(new String[] { "sample photoUrls" }); + // create Tag object + Tag tag = new Tag(); + tag.Id = petId; + tag.Name = "csharp sample tag name1"; + List tags = new List(new Tag[] { tag }); + p.Tags = tags; + p.Category = category; + p.PhotoUrls = photoUrls; + + return p; + } + + /// + /// Convert string to byte array + /// + private byte[] GetBytes(string str) + { + byte[] bytes = new byte[str.Length * sizeof(char)]; + System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); + return bytes; + } + + public PetApiTests() + { + instance = new PetApi(); + + // create pet + Pet p = createPet(); + + // add pet before testing + PetApi petApi = new PetApi("http://petstore.swagger.io/v2/"); + petApi.AddPet(p); + } + + /// + /// Test an instance of PetApi + /// + [Fact] + public void InstanceTest() + { + Assert.IsType(instance); + } + + + /// + /// Test AddPet + /// + [Fact] + public void AddPetTest() + { + // create pet + Pet p = createPet(); + instance.AddPet(p); + } + + /// + /// Test DeletePet + /// + [Fact] + public void DeletePetTest() + { + // no need to test as it'c covered by Cleanup() already + } + + /// + /// Test FindPetsByStatus + /// + [Fact] + public void FindPetsByStatusTest() + { + PetApi petApi = new PetApi(); + List tagsList = new List(new String[] { "available" }); + + List listPet = petApi.FindPetsByTags(tagsList); + foreach (Pet pet in listPet) // Loop through List with foreach. + { + Assert.IsType(pet); + Assert.Equal("available", pet.Tags[0].Name); + } + } + + /// + /// Test FindPetsByTags + /// + [Fact] + public void FindPetsByTagsTest() + { + List tags = new List(new String[] { "pet" }); + var response = instance.FindPetsByTags(tags); + Assert.IsType>(response); + } + + /// + /// Test GetPetById + /// + [Fact] + public void GetPetByIdTest() + { + // set timeout to 10 seconds + Configuration c1 = new Configuration(); + c1.Timeout = TimeSpan.FromSeconds(10); + c1.UserAgent = "TEST_USER_AGENT"; + + PetApi petApi = new PetApi(c1); + Pet response = petApi.GetPetById(petId); + Assert.IsType(response); + + Assert.Equal("Csharp test", response.Name); + Assert.Equal(Pet.StatusEnum.Available, response.Status); + + Assert.IsType>(response.Tags); + Assert.Equal(petId, response.Tags[0].Id); + Assert.Equal("csharp sample tag name1", response.Tags[0].Name); + + Assert.IsType>(response.PhotoUrls); + Assert.Equal("sample photoUrls", response.PhotoUrls[0]); + + Assert.IsType(response.Category); + Assert.Equal(56, response.Category.Id); + Assert.Equal("sample category name2", response.Category.Name); + } + + /// + /// Test GetPetByIdAsync + /// + [Fact] + public void TestGetPetByIdAsync() + { + PetApi petApi = new PetApi(); + var task = petApi.GetPetByIdAsync(petId); + Pet response = task.Result; + Assert.IsType(response); + + Assert.Equal("Csharp test", response.Name); + Assert.Equal(Pet.StatusEnum.Available, response.Status); + + Assert.IsType>(response.Tags); + Assert.Equal(petId, response.Tags[0].Id); + Assert.Equal("csharp sample tag name1", response.Tags[0].Name); + + Assert.IsType>(response.PhotoUrls); + Assert.Equal("sample photoUrls", response.PhotoUrls[0]); + + Assert.IsType(response.Category); + Assert.Equal(56, response.Category.Id); + Assert.Equal("sample category name2", response.Category.Name); + } + + /* a simple test for binary response. no longer in use. + [Fact] + public void TestGetByIdBinaryResponse() + { + PetApi petApi = new PetApi(c1); + Stream response = petApi.GetPetByIdBinaryResponse(petId); + Assert.IsType(response); + StreamReader reader = new StreamReader(response); + // the following will fail for sure + //Assert.Equal("something", reader.ReadToEnd()); + } + */ + + /// + /// Test GetPetByIdWithHttpInfoAsync + /// + [Fact] + public void TestGetPetByIdWithHttpInfoAsync() + { + PetApi petApi = new PetApi(); + var task = petApi.GetPetByIdWithHttpInfoAsync(petId); + + Assert.Equal(200, (int)task.Result.StatusCode); + Assert.True(task.Result.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", task.Result.Headers["Content-Type"][0]); + + Pet response = task.Result.Data; + Assert.IsType(response); + + Assert.Equal("Csharp test", response.Name); + Assert.Equal(Pet.StatusEnum.Available, response.Status); + + Assert.IsType>(response.Tags); + Assert.Equal(petId, response.Tags[0].Id); + Assert.Equal("csharp sample tag name1", response.Tags[0].Name); + + Assert.IsType>(response.PhotoUrls); + Assert.Equal("sample photoUrls", response.PhotoUrls[0]); + + Assert.IsType(response.Category); + Assert.Equal(56, response.Category.Id); + Assert.Equal("sample category name2", response.Category.Name); + } + + /// + /// Test UpdatePet + /// + [Fact] + public void UpdatePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + // create pet + Pet p = createPet(); + instance.UpdatePet(p); + + } + + /// + /// Test UpdatePetWithForm + /// + [Fact] + public void UpdatePetWithFormTest() + { + PetApi petApi = new PetApi(); + petApi.UpdatePetWithForm(petId, "new form name", "pending"); + + Pet response = petApi.GetPetById(petId); + Assert.IsType(response); + Assert.IsType(response.Category); + Assert.IsType>(response.Tags); + + Assert.Equal("new form name", response.Name); + Assert.Equal(Pet.StatusEnum.Pending, response.Status); + + Assert.Equal(petId, response.Tags[0].Id); + Assert.Equal(56, response.Category.Id); + + // test optional parameter + petApi.UpdatePetWithForm(petId, "new form name2"); + Pet response2 = petApi.GetPetById(petId); + Assert.Equal("new form name2", response2.Name); + } + + /// + /// Test UploadFile + /// + [Fact] + public void UploadFileTest() + { + Assembly _assembly = Assembly.GetExecutingAssembly(); + Stream _imageStream = _assembly.GetManifestResourceStream("Org.OpenAPITools.Test.linux-logo.png"); + PetApi petApi = new PetApi(); + // test file upload with form parameters + petApi.UploadFile(petId, "new form name", _imageStream); + + // test file upload without any form parameters + // using optional parameter syntax introduced at .net 4.0 + petApi.UploadFile(petId: petId, file: _imageStream); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact] + public void UploadFileWithRequiredFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long? petId = null; + //System.IO.Stream requiredFile = null; + //string additionalMetadata = null; + //var response = instance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + //Assert.IsType (response, "response is ApiResponse"); + } + + /// + /// Test status code + /// + [Fact] + public void TestStatusCodeAndHeader() + { + PetApi petApi = new PetApi(); + var response = petApi.GetPetByIdWithHttpInfo(petId); + //Assert.Equal("OK", response.StatusCode); + Assert.Equal(200, (int)response.StatusCode); + Assert.True(response.Headers.ContainsKey("Content-Type")); + Assert.Equal("application/json", response.Headers["Content-Type"][0]); + } + + /// + /// Test default header (should be deprecated) + /// + [Fact] + public void TestDefaultHeader() + { + //PetApi petApi = new PetApi(); + // commented out the warning test below as it's confirmed the warning is working as expected + // there should be a warning for using AddDefaultHeader (deprecated) below + //petApi.AddDefaultHeader ("header_key", "header_value"); + // the following should be used instead as suggested in the doc + //petApi.Configuration.AddDefaultHeader("header_key2", "header_value2"); + } + + [Fact] + public void TestArrayOfString() + { + ArrayTest at = new ArrayTest(); + JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + Assert.Equal("{}", JsonConvert.SerializeObject(at, _serializerSettings)); + + at.ArrayOfString = new List { "Something here ..." }; + + Assert.Equal("{\"array_of_string\":[\"Something here ...\"]}", JsonConvert.SerializeObject(at, _serializerSettings)); + } + + public void Dispose() + { + // remove the pet after testing + PetApi petApi = new PetApi(); + petApi.DeletePet(petId, "test key"); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 000000000000..48e9f32748db --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class StoreApiTests : IDisposable + { + private StoreApi instance; + + public StoreApiTests() + { + instance = new StoreApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of StoreApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' StoreApi + //Assert.IsType(instance); + } + + /// + /// Test DeleteOrder + /// + [Fact] + public void DeleteOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string orderId = null; + //instance.DeleteOrder(orderId); + } + + /// + /// Test GetInventory + /// + [Fact] + public void GetInventoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetInventory(); + //Assert.IsType>(response); + } + + /// + /// Test GetOrderById + /// + [Fact] + public void GetOrderByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long orderId = null; + //var response = instance.GetOrderById(orderId); + //Assert.IsType(response); + } + + /// + /// Test PlaceOrder + /// + [Fact] + public void PlaceOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Order order = null; + //var response = instance.PlaceOrder(order); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 000000000000..792db5819a03 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class UserApiTests : IDisposable + { + private UserApi instance; + + public UserApiTests() + { + instance = new UserApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of UserApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' UserApi + //Assert.IsType(instance); + } + + /// + /// Test CreateUser + /// + [Fact] + public void CreateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User user = null; + //instance.CreateUser(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact] + public void CreateUsersWithArrayInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List user = null; + //instance.CreateUsersWithArrayInput(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact] + public void CreateUsersWithListInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List user = null; + //instance.CreateUsersWithListInput(user); + } + + /// + /// Test DeleteUser + /// + [Fact] + public void DeleteUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //instance.DeleteUser(username); + } + + /// + /// Test GetUserByName + /// + [Fact] + public void GetUserByNameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //var response = instance.GetUserByName(username); + //Assert.IsType(response); + } + + /// + /// Test LoginUser + /// + [Fact] + public void LoginUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //string password = null; + //var response = instance.LoginUser(username, password); + //Assert.IsType(response); + } + + /// + /// Test LogoutUser + /// + [Fact] + public void LogoutUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.LogoutUser(); + } + + /// + /// Test UpdateUser + /// + [Fact] + public void UpdateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //User user = null; + //instance.UpdateUser(username, user); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/ApiClientTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/ApiClientTests.cs new file mode 100644 index 000000000000..4104b13149b6 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/ApiClientTests.cs @@ -0,0 +1,46 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing ApiClient + /// + public class ApiClientTests + { + public ApiClientTests() + { + } + + /// + /// Test GetSerializerSettingsTest + /// + [Fact] + public void GetSerializerSettingsTest() + { + ApiClient apiClient = new ApiClient(); + + var serializerSettingsPropertyInfo = typeof(ApiClient).GetProperty(nameof(ApiClient.SerializerSettings)); + + // Validate that we can the set the SerializerSettings (public visibility) + Assert.NotNull(serializerSettingsPropertyInfo?.GetSetMethod()); + + // Validate default serializer settings + Assert.NotNull(apiClient.SerializerSettings); + Assert.Equal(ConstructorHandling.AllowNonPublicDefaultConstructor, apiClient.SerializerSettings.ConstructorHandling); + Assert.False(((DefaultContractResolver)apiClient.SerializerSettings.ContractResolver).NamingStrategy.OverrideSpecifiedNames); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs new file mode 100644 index 000000000000..2111b10d5817 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs @@ -0,0 +1,58 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing Configuration + /// + public class ConfigurationTests + { + public ConfigurationTests() + { + } + + /// + /// Test WebProxy + /// + [Fact] + public void WebProxyTest() + { + Configuration c = new Configuration(); + System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); + webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; + c.Proxy = webProxy; + } + + /// + /// Test GetServerUrl + /// + [Fact] + public void GetServerUrlTest() + { + Configuration c = new Configuration(); + // no variable (null) provided + Assert.Equal("https://localhost:8080/v2", c.GetServerUrl(2, null)); + // no variable (empty dictionary) provided + Assert.Equal("https://localhost:8080/v2", c.GetServerUrl(2, new Dictionary())); + + Assert.Equal("https://localhost:8080/v1", c.GetServerUrl(2, new Dictionary() { { "version", "v1" } })); + + Assert.Throws(() => c.GetServerUrl(2, new Dictionary() { { "version", "v3" } })); + + // test the first server (index 0) + Assert.Equal("http://petstore.swagger.io:80/v2", c.GetServerUrl(1)); + + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs new file mode 100644 index 000000000000..74ecb176bc10 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs @@ -0,0 +1,218 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing Configuration + /// + public class JSONComposedSchemaTests + { + public JSONComposedSchemaTests() + { + } + + /// + /// Test GetServerUrl + /// + [Fact] + public void TestOneOfSchemaAdditionalProperties() + { + // TODO + } + + /// + /// Test GetServerUrl + /// + [Fact] + public void TestOneOfSchemaWithDiscriminator() + { + // Mammal can be one of whale, pig and zebra. + // pig has sub-classes. + + String str = "{ \"className\": \"whale\", \"hasBaleen\": true, \"hasTeeth\": false }"; + Mammal m = Mammal.FromJson(str); + Assert.NotNull(m); + Assert.IsType(m.ActualInstance); + + String str2 = "{ \"className\": \"zebra\", \"type\": \"plains\" }"; + Mammal m2 = Mammal.FromJson(str2); + Assert.NotNull(m2); + Assert.IsType(m2.ActualInstance); + } + + /// + /// Test Fruit + /// + [Fact] + public void TestFruit() + { + Apple a = new Apple(); + a.Origin = "Japan"; + + Banana b = new Banana(); + b.LengthCm = 13; + + Tag t = new Tag(); + t.Id = 12; + t.Name = "Something"; + + Fruit f1 = new Fruit(a); + Fruit f2 = new Fruit(b); + + f1.ActualInstance = b; + f2.ActualInstance = a; + + Assert.Equal(13, f1.GetBanana().LengthCm); + Assert.Equal("Japan", f2.GetApple().Origin); + + Assert.Throws(() => f1.ActualInstance = t); + + Assert.Equal("{\"lengthCm\":13.0}", f1.ToJson()); + Assert.Equal("{\"origin\":\"Japan\"}", f2.ToJson()); + } + + /// + /// Test Fruit with JSON payload matching both Apple and Banana + /// + [Fact] + public void TestFruitWithPayloadMatchingMoreThanOne() + { + // more than 1 match + Assert.Throws(() => Fruit.FromJson("{\"origin\":\"Japan\"}")); + Assert.Throws(() => Fruit.FromJson("{\"lengthCm\":98}")); + } + + /// + /// Apple Properties tests + /// + [Fact] + public void TestAppleProperties() + { + Assert.NotNull(typeof(Apple).GetProperty("Origin")); + Assert.NotNull(typeof(Apple).GetProperty("AdditionalProperties")); + } + + /// + /// Apple tests + /// + [Fact] + public void TestApple() + { + Apple a = JsonConvert.DeserializeObject("{\"origin\":\"Japan\"}", Fruit.AdditionalPropertiesSerializerSettings); + Assert.Equal("{\"origin\":\"Japan\"}", JsonConvert.SerializeObject(a)); + } + + /// + /// Banana tests + /// + [Fact] + public void TestBanana() + { + Banana a = JsonConvert.DeserializeObject("{\"lengthCm\":98}", Fruit.AdditionalPropertiesSerializerSettings); + Assert.Equal("{\"lengthCm\":98.0}", JsonConvert.SerializeObject(a)); + } + + /// + /// ReadOnly property tests + /// + [Fact] + public void TestReadOnlyFruit() + { + ReadOnlyFirst r = JsonConvert.DeserializeObject("{\"baz\":\"from json gaz\",\"bar\":\"from json bar\"}"); + Assert.Equal("from json bar", r.Bar); + Assert.Equal("{\"baz\":\"from json gaz\"}", JsonConvert.SerializeObject(r)); + } + + /// + /// Cat property tests + /// + [Fact] + public void TestCat() + { + // test to ensure both Cat and Animal (parent) can have "AdditionalProperties", which result in warnings + Cat c = JsonConvert.DeserializeObject("{\"className\":\"cat\",\"bar\":\"from json bar\"}"); + Assert.Equal("from json bar", c.AdditionalProperties["bar"]); + + Cat c2 = new Cat(); + c2.Color = "red"; + c2.Declawed = false; + Assert.Equal("{\"declawed\":false,\"className\":\"Cat\",\"color\":\"red\"}", JsonConvert.SerializeObject(c2)); + } + + /// + /// Test additional properties + /// + [Fact] + public void TestAdditionalProperties() + { + Foo f = new Foo(); + Assert.NotNull(f.GetType().GetProperty("AdditionalProperties")); + Assert.Null(f.GetType().GetProperty("unknown_property")); + } + + /// + /// Test OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + OuterEnumInteger instance = OuterEnumInteger.NUMBER_1; + Assert.Equal(1, (int)instance); + } + + /// + /// Test inner enum integer + /// + [Fact] + public void InnerEnumIntegerInstanceTest() + { + EnumTest enumTest = new EnumTest(); + enumTest.EnumIntegerOnly = EnumTest.EnumIntegerOnlyEnum.NUMBER_2; + enumTest.EnumInteger = EnumTest.EnumIntegerEnum.NUMBER_MINUS_1; + Assert.Equal("{\"enum_string_required\":0,\"enum_integer\":-1,\"enum_integer_only\":2,\"outerEnum\":null}", JsonConvert.SerializeObject(enumTest)); + } + + /// + /// Test AnyOf with different types + /// + [Theory] + [InlineData("{\"content\":\"Hello\"}")] + [InlineData("{\"content\":true}")] + [InlineData("{\"content\":0}")] + [InlineData("{\"content\":0.0}")] + [InlineData("{\"content\":{\"id\":\"id_1234\"}}")] + public void MixedAnyOfRoundTripSerializationTest(string jsonData) + { + var deserializedObj = JsonConvert.DeserializeObject(jsonData); + Assert.Equal(jsonData, JsonConvert.SerializeObject(deserializedObj)); + } + + + /// + /// Test OneOf with different types + /// + [Theory] + [InlineData("{\"content\":\"Hello\"}")] + [InlineData("{\"content\":true}")] + [InlineData("{\"content\":0}")] + [InlineData("{\"content\":0.0}")] + [InlineData("{\"content\":{\"id\":\"id_1234\"}}")] + public void MixedOneOfRoundTripSerializationTest(string jsonData) + { + var deserializedObj = JsonConvert.DeserializeObject(jsonData); + Assert.Equal(jsonData, JsonConvert.SerializeObject(deserializedObj)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ActivityTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AnimalTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 000000000000..901c6a02965e --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -0,0 +1,84 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/AppleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 000000000000..884eb8b1e080 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests + { + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ArrayOfArrayOfNumberOnly + //Assert.IsType (instance, "variable 'instance' is a ArrayOfArrayOfNumberOnly"); + } + + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // 1st instance + ArrayOfArrayOfNumberOnly instance1 = new ArrayOfArrayOfNumberOnly(); + List list1 = new List(); + list1.Add(11.1m); + list1.Add(8.9m); + + List> listOfList1 = new List>(); + listOfList1.Add(list1); + + instance1.ArrayArrayNumber = listOfList1; + + // 2nd instance + ArrayOfArrayOfNumberOnly instance2 = new ArrayOfArrayOfNumberOnly(); + List list2 = new List(); + list2.Add(11.1m); + list2.Add(8.9m); + + List> listOfList2 = new List>(); + listOfList2.Add(list2); + + instance2.ArrayArrayNumber = listOfList2; + + Assert.True(instance1.Equals(instance2)); + + // add one more element to list2 + list2.Add(183.3m); + Assert.False(instance1.Equals(instance2)); + + // 3rd instance + ArrayOfArrayOfNumberOnly instance3 = new ArrayOfArrayOfNumberOnly(); + List list3 = new List(); + list3.Add(11.1m); + list3.Add(1.1m); // not the same as 8.9 + + List> listOfList3 = new List>(); + instance2.ArrayArrayNumber = listOfList3; + + Assert.False(instance1.Equals(instance3)); + } + + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/BananaTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs similarity index 59% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs index d52b1938e420..fb51c28489cb 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -14,6 +14,7 @@ using System.Linq; using System.IO; using System.Collections.Generic; +using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -22,21 +23,21 @@ namespace Org.OpenAPITools.Test.Model { /// - /// Class for testing ArrayOfArrayOfNumberOnly + /// Class for testing CatAllOf /// /// /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). /// Please update the test case below to test the model. /// - public class ArrayOfArrayOfNumberOnlyTests : IDisposable + public class CatAllOfTests : IDisposable { - // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly - //private ArrayOfArrayOfNumberOnly instance; + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; - public ArrayOfArrayOfNumberOnlyTests() + public CatAllOfTests() { - // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly - //instance = new ArrayOfArrayOfNumberOnly(); + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); } public void Dispose() @@ -45,22 +46,25 @@ public void Dispose() } /// - /// Test an instance of ArrayOfArrayOfNumberOnly + /// Test an instance of CatAllOf /// [Fact] - public void ArrayOfArrayOfNumberOnlyInstanceTest() + public void CatAllOfInstanceTest() { - // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly - //Assert.IsType(instance); + // TODO uncomment below to test "IsType" CatAllOf + //Assert.IsType(instance); } + /// - /// Test the property 'ArrayArrayNumber' + /// Test the property 'Declawed' /// [Fact] - public void ArrayArrayNumberTest() + public void DeclawedTest() { - // TODO unit test for the property 'ArrayArrayNumber' + // TODO unit test for the property 'Declawed' } + } + } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/CatTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs similarity index 58% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs index ef8a8d50e3ee..d1ef61862440 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -22,21 +22,21 @@ namespace Org.OpenAPITools.Test.Model { /// - /// Class for testing SpecialModelName + /// Class for testing Category /// /// /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). /// Please update the test case below to test the model. /// - public class SpecialModelNameTests : IDisposable + public class CategoryTests : IDisposable { - // TODO uncomment below to declare an instance variable for SpecialModelName - //private SpecialModelName instance; + // TODO uncomment below to declare an instance variable for Category + //private Category instance; - public SpecialModelNameTests() + public CategoryTests() { - // TODO uncomment below to create an instance of SpecialModelName - //instance = new SpecialModelName(); + // TODO uncomment below to create an instance of Category + //instance = new Category(); } public void Dispose() @@ -45,31 +45,31 @@ public void Dispose() } /// - /// Test an instance of SpecialModelName + /// Test an instance of Category /// [Fact] - public void SpecialModelNameInstanceTest() + public void CategoryInstanceTest() { - // TODO uncomment below to test "IsType" SpecialModelName - //Assert.IsType(instance); + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); } /// - /// Test the property 'SpecialPropertyName' + /// Test the property 'Id' /// [Fact] - public void SpecialPropertyNameTest() + public void IdTest() { - // TODO unit test for the property 'SpecialPropertyName' + // TODO unit test for the property 'Id' } /// - /// Test the property 'VarSpecialModelName' + /// Test the property 'Name' /// [Fact] - public void VarSpecialModelNameTest() + public void NameTest() { - // TODO unit test for the property 'VarSpecialModelName' + // TODO unit test for the property 'Name' } } } diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs new file mode 100644 index 000000000000..49a539324904 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOf + //private ChildCatAllOf instance; + + public ChildCatAllOfTests() + { + // TODO uncomment below to create an instance of ChildCatAllOf + //instance = new ChildCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOf + /// + [Fact] + public void ChildCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 000000000000..b22a44420963 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + public DogAllOfTests() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DogAllOf + /// + [Fact] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" DogAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DogTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/DrawingTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FileTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FooTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/FruitTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ListTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MammalTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MapTestTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs new file mode 100644 index 000000000000..5fb0741f597b --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixedEnumType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedEnumTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedEnumType + //private MixedEnumType instance; + + public MixedEnumTypeTests() + { + // TODO uncomment below to create an instance of MixedEnumType + //instance = new MixedEnumType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedEnumType + /// + [Fact] + public void MixedEnumTypeInstanceTest() + { + // TODO uncomment below to test "IsType" MixedEnumType + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs new file mode 100644 index 000000000000..c13101dc08f5 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixedNullableEnumType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedNullableEnumTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedNullableEnumType + //private MixedNullableEnumType instance; + + public MixedNullableEnumTypeTests() + { + // TODO uncomment below to create an instance of MixedNullableEnumType + //instance = new MixedNullableEnumType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedNullableEnumType + /// + [Fact] + public void MixedNullableEnumTypeInstanceTest() + { + // TODO uncomment below to test "IsType" MixedNullableEnumType + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NameTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs similarity index 90% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs index 4e3931d48d9e..75e9c7e8fd49 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -63,15 +63,6 @@ public void ShapeTypeTest() // TODO unit test for the property 'ShapeType' } - /// - /// Test the property 'TriangleType' - /// - [Fact] - public void TriangleTypeTest() - { - // TODO unit test for the property 'TriangleType' - } - /// /// Test the property 'QuadrilateralType' /// diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 000000000000..84d2828b367f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 000000000000..d514e9a043c8 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests + { + //private Pet instance; + + private long petId = 11088; + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Pet + //Assert.IsType (instance, "variable 'instance' is a Pet"); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// + /// Test serialization + /// + [Fact] + public void TestSerialization() + { + // create pet + Pet p1 = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + Assert.Equal("{\"name\":\"Csharp test\",\"photoUrls\":[\"http://petstore.com/csharp_test\"]}", JsonConvert.SerializeObject(p1)); + + // test additional properties (serialization) + Pet p2 = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + p2.AdditionalProperties.Add("hello", "world"); + Assert.Equal("{\"name\":\"Csharp test\",\"photoUrls\":[\"http://petstore.com/csharp_test\"],\"hello\":\"world\"}", JsonConvert.SerializeObject(p2)); + + // test additional properties (deserialization) + Pet p3 = JsonConvert.DeserializeObject("{\"name\":\"Csharp test\",\"photoUrls\":[\"http://petstore.com/csharp_test\"],\"hello\":\"world\",\"int\":123}"); + Assert.Equal("Csharp test", p3.Name); + Assert.Equal("world", p3.AdditionalProperties["hello"]); + Assert.Equal(123L, p3.AdditionalProperties["int"]); + } + + /// + /// Test Equal + /// + [Fact] + public void TestEqual() + { + // create pet + Pet p1 = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + p1.Id = petId; + //p1.Name = "Csharp test"; + p1.Status = Pet.StatusEnum.Available; + // create Category object + Category category1 = new Category(); + category1.Id = 56; + category1.Name = "sample category name2"; + List photoUrls1 = new List(new String[] { "sample photoUrls" }); + // create Tag object + Tag tag1 = new Tag(); + tag1.Id = petId; + tag1.Name = "csharp sample tag name1"; + List tags1 = new List(new Tag[] { tag1 }); + p1.Tags = tags1; + p1.Category = category1; + p1.PhotoUrls = photoUrls1; + + // create pet 2 + Pet p2 = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + p2.Id = petId; + p2.Name = "Csharp test"; + p2.Status = Pet.StatusEnum.Available; + // create Category object + Category category2 = new Category(); + category2.Id = 56; + category2.Name = "sample category name2"; + List photoUrls2 = new List(new String[] { "sample photoUrls" }); + // create Tag object + Tag tag2 = new Tag(); + tag2.Id = petId; + tag2.Name = "csharp sample tag name1"; + List tags2 = new List(new Tag[] { tag2 }); + p2.Tags = tags2; + p2.Category = category2; + p2.PhotoUrls = photoUrls2; + + // p1 and p2 should be equal (both object and attribute level) + Assert.True(category1.Equals(category2)); + Assert.True(tags1.SequenceEqual(tags2)); + Assert.True(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls)); + + Assert.True(p1.Equals(p2)); + + // update attribute to that p1 and p2 are not equal + category2.Name = "new category name"; + Assert.False(category1.Equals(category2)); + + tags2 = new List(); + Assert.False(tags1.SequenceEqual(tags2)); + + // photoUrls has not changed so it should be equal + Assert.True(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls)); + + Assert.False(p1.Equals(p2)); + } + + + /// + /// Test Pet deserialization + /// + [Fact] + public void TestDeserialization() + { + // properly deserialized, no exception + Pet p2 = JsonConvert.DeserializeObject("{\n \"name\": \"csharp test 2\",\n \"photoUrls\": [\"http://petstore.com/csharp_test\", \"http://petstore.com/csharp_test2\"]\n}"); + // comment out below as the result (json string) is OS dependent. + //Assert.Equal("{\n \"name\": \"csharp test 2\",\n \"photoUrls\": [\n \"http://petstore.com/csharp_test\",\n \"http://petstore.com/csharp_test2\"\n ]\n}", p2.ToJson()); + + // Missing `name` to cause exceptions in deserialization + Assert.Throws(() => JsonConvert.DeserializeObject("{\n \"Something\": \"csharp test 2\",\n \"photoUrls\": [\"http://petstore.com/csharp_test\", \"http://petstore.com/csharp_test2\"]\n}")); + } + + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PigTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ReturnTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs similarity index 89% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs index 2d169892c9d3..b70c157800b5 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -63,15 +63,6 @@ public void ShapeTypeTest() // TODO unit test for the property 'ShapeType' } - /// - /// Test the property 'TriangleType' - /// - [Fact] - public void TriangleTypeTest() - { - // TODO unit test for the property 'TriangleType' - } - /// /// Test the property 'QuadrilateralType' /// diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs similarity index 89% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs index 9e4a9e6fe7a3..babd94722cfb 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ShapeTests.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -63,15 +63,6 @@ public void ShapeTypeTest() // TODO unit test for the property 'ShapeType' } - /// - /// Test the property 'TriangleType' - /// - [Fact] - public void TriangleTypeTest() - { - // TODO unit test for the property 'TriangleType' - } - /// /// Test the property 'QuadrilateralType' /// diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 000000000000..520c1c8a6d51 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests + { + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" SpecialModelName + //Assert.IsType (instance, "variable 'instance' is a SpecialModelName"); + } + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + SpecialModelName s = new SpecialModelName(); + s.SpecialPropertyName = 123L; + Assert.Equal("{\"$special[property.name]\":123}", JsonConvert.SerializeObject(s)); + // comment out the following as the result is OS-dependent + //Assert.Equal("{\"id\":123}", s.ToJson()); + } + + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 000000000000..8f9ad604eab9 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/TriangleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/UpdatePet200ResponseTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/UpdatePet200ResponseTests.cs new file mode 100644 index 000000000000..8cb066737bc4 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/UpdatePet200ResponseTests.cs @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing UpdatePet200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UpdatePet200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for UpdatePet200Response + //private UpdatePet200Response instance; + + public UpdatePet200ResponseTests() + { + // TODO uncomment below to create an instance of UpdatePet200Response + //instance = new UpdatePet200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of UpdatePet200Response + /// + [Fact] + public void UpdatePet200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" UpdatePet200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarString' + /// + [Fact] + public void VarStringTest() + { + // TODO unit test for the property 'VarString' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 000000000000..bc3cb3775de1 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/WhaleTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ZebraTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 000000000000..16979c0a341a --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,26 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net10.0 + false + annotations + false + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/linux-logo.png b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/linux-logo.png new file mode 100644 index 000000000000..8269538b1aca Binary files /dev/null and b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools.Test/linux-logo.png differ diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/AnotherFakeApi.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/DefaultApi.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/FakeApi.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 000000000000..33406b05254c --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,2355 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// + void AddPet(Pet pet, int operationIndex = 0); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse AddPetWithHttpInfo(Pet pet, int operationIndex = 0); + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// + void DeletePet(long petId, string? apiKey = default, int operationIndex = 0); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeletePetWithHttpInfo(long petId, string? apiKey = default, int operationIndex = 0); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// List<Pet> + List FindPetsByStatus(List status, int operationIndex = 0); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByStatusWithHttpInfo(List status, int operationIndex = 0); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// List<Pet> + [Obsolete] + List FindPetsByTags(List tags, int operationIndex = 0); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// ApiResponse of List<Pet> + [Obsolete] + ApiResponse> FindPetsByTagsWithHttpInfo(List tags, int operationIndex = 0); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// Pet + Pet GetPetById(long petId, int operationIndex = 0); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// ApiResponse of Pet + ApiResponse GetPetByIdWithHttpInfo(long petId, int operationIndex = 0); + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// + void UpdatePet(Pet pet, int operationIndex = 0); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithHttpInfo(Pet pet, int operationIndex = 0); + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// + void UpdatePetWithForm(long petId, string? name = default, string? status = default, int operationIndex = 0); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithFormWithHttpInfo(long petId, string? name = default, string? status = default, int operationIndex = 0); + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// ApiResponse + ApiResponse UploadFile(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithHttpInfo(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0); + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// ApiResponse + ApiResponse UploadFileWithRequiredFile(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithRequiredFileWithHttpInfo(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeletePetAsync(long petId, string? apiKey = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeletePetWithHttpInfoAsync(long petId, string? apiKey = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByStatusAsync(List status, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByStatusWithHttpInfoAsync(List status, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + [Obsolete] + System.Threading.Tasks.Task> FindPetsByTagsAsync(List tags, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + [Obsolete] + System.Threading.Tasks.Task>> FindPetsByTagsWithHttpInfoAsync(List tags, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Pet + System.Threading.Tasks.Task GetPetByIdAsync(long petId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> GetPetByIdWithHttpInfoAsync(long petId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string? name = default, string? status = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string? name = default, string? status = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileAsync(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IPetApiSync, IPetApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public PetApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public PetApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// + public void AddPet(Pet pet, int operationIndex = 0) + { + AddPetWithHttpInfo(pet); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet, int operationIndex = 0) + { + // verify the required parameter 'pet' is set + if (pet == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = pet; + + localVarRequestOptions.Operation = "PetApi.AddPet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "POST", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task AddPetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await AddPetWithHttpInfoAsync(pet, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'pet' is set + if (pet == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = pet; + + localVarRequestOptions.Operation = "PetApi.AddPet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "POST", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// + public void DeletePet(long petId, string? apiKey = default, int operationIndex = 0) + { + DeletePetWithHttpInfo(petId, apiKey); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse DeletePetWithHttpInfo(long petId, string? apiKey = default, int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (apiKey != null) + { + localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter + } + + localVarRequestOptions.Operation = "PetApi.DeletePet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeletePetAsync(long petId, string? apiKey = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await DeletePetWithHttpInfoAsync(petId, apiKey, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeletePetWithHttpInfoAsync(long petId, string? apiKey = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (apiKey != null) + { + localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter + } + + localVarRequestOptions.Operation = "PetApi.DeletePet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// List<Pet> + public List FindPetsByStatus(List status, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = FindPetsByStatusWithHttpInfo(status); + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// ApiResponse of List<Pet> + public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpInfo(List status, int operationIndex = 0) + { + // verify the required parameter 'status' is set + if (status == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); + + localVarRequestOptions.Operation = "PetApi.FindPetsByStatus"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByStatus", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByStatusAsync(List status, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusWithHttpInfoAsync(status, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByStatusWithHttpInfoAsync(List status, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'status' is set + if (status == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); + + localVarRequestOptions.Operation = "PetApi.FindPetsByStatus"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByStatus", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// List<Pet> + [Obsolete] + public List FindPetsByTags(List tags, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = FindPetsByTagsWithHttpInfo(tags); + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// ApiResponse of List<Pet> + [Obsolete] + public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo(List tags, int operationIndex = 0) + { + // verify the required parameter 'tags' is set + if (tags == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); + + localVarRequestOptions.Operation = "PetApi.FindPetsByTags"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByTags", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + [Obsolete] + public async System.Threading.Tasks.Task> FindPetsByTagsAsync(List tags, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsWithHttpInfoAsync(tags, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + [Obsolete] + public async System.Threading.Tasks.Task>> FindPetsByTagsWithHttpInfoAsync(List tags, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'tags' is set + if (tags == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); + + localVarRequestOptions.Operation = "PetApi.FindPetsByTags"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByTags", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// Pet + public Pet GetPetById(long petId, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// ApiResponse of Pet + public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petId, int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + + localVarRequestOptions.Operation = "PetApi.GetPetById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + // authentication (api_key_query) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Pet + public async System.Threading.Tasks.Task GetPetByIdAsync(long petId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdWithHttpInfoAsync(petId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> GetPetByIdWithHttpInfoAsync(long petId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + + localVarRequestOptions.Operation = "PetApi.GetPetById"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + // authentication (api_key_query) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// + public void UpdatePet(Pet pet, int operationIndex = 0) + { + UpdatePetWithHttpInfo(pet); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet, int operationIndex = 0) + { + // verify the required parameter 'pet' is set + if (pet == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = pet; + + localVarRequestOptions.Operation = "PetApi.UpdatePet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "PUT", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await UpdatePetWithHttpInfoAsync(pet, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'pet' is set + if (pet == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = pet; + + localVarRequestOptions.Operation = "PetApi.UpdatePet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "PUT", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// + public void UpdatePetWithForm(long petId, string? name = default, string? status = default, int operationIndex = 0) + { + UpdatePetWithFormWithHttpInfo(petId, name, status); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse UpdatePetWithFormWithHttpInfo(long petId, string? name = default, string? status = default, int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (name != null) + { + localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter + } + if (status != null) + { + localVarRequestOptions.FormParameters.Add("status", Org.OpenAPITools.Client.ClientUtils.ParameterToString(status)); // form parameter + } + + localVarRequestOptions.Operation = "PetApi.UpdatePetWithForm"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string? name = default, string? status = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string? name = default, string? status = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (name != null) + { + localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter + } + if (status != null) + { + localVarRequestOptions.FormParameters.Add("status", Org.OpenAPITools.Client.ClientUtils.ParameterToString(status)); // form parameter + } + + localVarRequestOptions.Operation = "PetApi.UpdatePetWithForm"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// ApiResponse + public ApiResponse UploadFile(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// ApiResponse of ApiResponse + public Org.OpenAPITools.Client.ApiResponse UploadFileWithHttpInfo(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + if (file != null) + { + localVarRequestOptions.FileParameters.Add("file", file); + } + + localVarRequestOptions.Operation = "PetApi.UploadFile"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileAsync(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(long petId, string? additionalMetadata = default, System.IO.Stream? file = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + if (file != null) + { + localVarRequestOptions.FileParameters.Add("file", file); + } + + localVarRequestOptions.Operation = "PetApi.UploadFile"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// ApiResponse + public ApiResponse UploadFileWithRequiredFile(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.Data; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// ApiResponse of ApiResponse + public Org.OpenAPITools.Client.ApiResponse UploadFileWithRequiredFileWithHttpInfo(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0) + { + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + localVarRequestOptions.FileParameters.Add("requiredFile", requiredFile); + + localVarRequestOptions.Operation = "PetApi.UploadFileWithRequiredFile"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string? additionalMetadata = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + localVarRequestOptions.FileParameters.Add("requiredFile", requiredFile); + + localVarRequestOptions.Operation = "PetApi.UploadFileWithRequiredFile"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (petstore_auth) required + // oauth required + if (!localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + else if (!string.IsNullOrEmpty(this.Configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientId) && + !string.IsNullOrEmpty(this.Configuration.OAuthClientSecret) && + this.Configuration.OAuthFlow != null) + { + localVarRequestOptions.OAuth = true; + } + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 000000000000..738ae73162bd --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,907 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// + void DeleteOrder(string orderId, int operationIndex = 0); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteOrderWithHttpInfo(string orderId, int operationIndex = 0); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Dictionary<string, int> + Dictionary GetInventory(int operationIndex = 0); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo(int operationIndex = 0); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// Order + Order GetOrderById(long orderId, int operationIndex = 0); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// ApiResponse of Order + ApiResponse GetOrderByIdWithHttpInfo(long orderId, int operationIndex = 0); + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// Order + Order PlaceOrder(Order order, int operationIndex = 0); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// ApiResponse of Order + ApiResponse PlaceOrderWithHttpInfo(Order order, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteOrderAsync(string orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteOrderWithHttpInfoAsync(string orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Order + System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> GetOrderByIdWithHttpInfoAsync(long orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync(Order order, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderWithHttpInfoAsync(Order order, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IStoreApiSync, IStoreApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StoreApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public StoreApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// + public void DeleteOrder(string orderId, int operationIndex = 0) + { + DeleteOrderWithHttpInfo(orderId); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(string orderId, int operationIndex = 0) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + localVarRequestOptions.Operation = "StoreApi.DeleteOrder"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteOrderAsync(string orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await DeleteOrderWithHttpInfoAsync(orderId, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteOrderWithHttpInfoAsync(string orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + localVarRequestOptions.Operation = "StoreApi.DeleteOrder"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Dictionary<string, int> + public Dictionary GetInventory(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Dictionary<string, int> + public Org.OpenAPITools.Client.ApiResponse> GetInventoryWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "StoreApi.GetInventory"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "StoreApi.GetInventory"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// Order + public Order GetOrderById(long orderId, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// ApiResponse of Order + public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long orderId, int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + localVarRequestOptions.Operation = "StoreApi.GetOrderById"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Order + public async System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdWithHttpInfoAsync(orderId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> GetOrderByIdWithHttpInfoAsync(long orderId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + localVarRequestOptions.Operation = "StoreApi.GetOrderById"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// Order + public Order PlaceOrder(Order order, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// ApiResponse of Order + public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order order, int operationIndex = 0) + { + // verify the required parameter 'order' is set + if (order == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = order; + + localVarRequestOptions.Operation = "StoreApi.PlaceOrder"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of Order + public async System.Threading.Tasks.Task PlaceOrderAsync(Order order, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderWithHttpInfoAsync(order, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> PlaceOrderWithHttpInfoAsync(Order order, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'order' is set + if (order == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = order; + + localVarRequestOptions.Operation = "StoreApi.PlaceOrder"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 000000000000..590022faef87 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,1699 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// + void CreateUser(User user, int operationIndex = 0); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse CreateUserWithHttpInfo(User user, int operationIndex = 0); + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// + void CreateUsersWithArrayInput(List user, int operationIndex = 0); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithArrayInputWithHttpInfo(List user, int operationIndex = 0); + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// + void CreateUsersWithListInput(List user, int operationIndex = 0); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithListInputWithHttpInfo(List user, int operationIndex = 0); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// + void DeleteUser(string username, int operationIndex = 0); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse DeleteUserWithHttpInfo(string username, int operationIndex = 0); + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// User + User GetUserByName(string username, int operationIndex = 0); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// ApiResponse of User + ApiResponse GetUserByNameWithHttpInfo(string username, int operationIndex = 0); + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// string + string LoginUser(string username, string password, int operationIndex = 0); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// ApiResponse of string + ApiResponse LoginUserWithHttpInfo(string username, string password, int operationIndex = 0); + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + void LogoutUser(int operationIndex = 0); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse LogoutUserWithHttpInfo(int operationIndex = 0); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// + void UpdateUser(string username, User user, int operationIndex = 0); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse UpdateUserWithHttpInfo(string username, User user, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateUserAsync(User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserWithHttpInfoAsync(User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputWithHttpInfoAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteUserAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteUserWithHttpInfoAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of User + System.Threading.Tasks.Task GetUserByNameAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (User) + System.Threading.Tasks.Task> GetUserByNameWithHttpInfoAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task LoginUserAsync(string username, string password, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> LoginUserWithHttpInfoAsync(string username, string password, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task LogoutUserAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> LogoutUserWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateUserAsync(string username, User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateUserWithHttpInfoAsync(string username, User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IUserApiSync, IUserApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public UserApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public UserApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// + public void CreateUser(User user, int operationIndex = 0) + { + CreateUserWithHttpInfo(user); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User user, int operationIndex = 0) + { + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.CreateUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateUserAsync(User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await CreateUserWithHttpInfoAsync(user, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUserWithHttpInfoAsync(User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.CreateUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// + public void CreateUsersWithArrayInput(List user, int operationIndex = 0) + { + CreateUsersWithArrayInputWithHttpInfo(user); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWithHttpInfo(List user, int operationIndex = 0) + { + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.CreateUsersWithArrayInput"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await CreateUsersWithArrayInputWithHttpInfoAsync(user, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.CreateUsersWithArrayInput"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// + public void CreateUsersWithListInput(List user, int operationIndex = 0) + { + CreateUsersWithListInputWithHttpInfo(user); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithHttpInfo(List user, int operationIndex = 0) + { + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.CreateUsersWithListInput"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await CreateUsersWithListInputWithHttpInfoAsync(user, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithListInputWithHttpInfoAsync(List user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.CreateUsersWithListInput"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// + public void DeleteUser(string username, int operationIndex = 0) + { + DeleteUserWithHttpInfo(username); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string username, int operationIndex = 0) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + localVarRequestOptions.Operation = "UserApi.DeleteUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteUserAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await DeleteUserWithHttpInfoAsync(username, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteUserWithHttpInfoAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + localVarRequestOptions.Operation = "UserApi.DeleteUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// User + public User GetUserByName(string username, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetUserByNameWithHttpInfo(username); + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// ApiResponse of User + public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(string username, int operationIndex = 0) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + localVarRequestOptions.Operation = "UserApi.GetUserByName"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of User + public async System.Threading.Tasks.Task GetUserByNameAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameWithHttpInfoAsync(username, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (User) + public async System.Threading.Tasks.Task> GetUserByNameWithHttpInfoAsync(string username, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + localVarRequestOptions.Operation = "UserApi.GetUserByName"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// string + public string LoginUser(string username, string password, int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = LoginUserWithHttpInfo(username, password); + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// ApiResponse of string + public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string username, string password, int operationIndex = 0) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } + + // verify the required parameter 'password' is set + if (password == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); + + localVarRequestOptions.Operation = "UserApi.LoginUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task LoginUserAsync(string username, string password, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserWithHttpInfoAsync(username, password, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> LoginUserWithHttpInfoAsync(string username, string password, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } + + // verify the required parameter 'password' is set + if (password == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); + + localVarRequestOptions.Operation = "UserApi.LoginUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// + public void LogoutUser(int operationIndex = 0) + { + LogoutUserWithHttpInfo(); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "UserApi.LogoutUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task LogoutUserAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await LogoutUserWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> LogoutUserWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "UserApi.LogoutUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// + public void UpdateUser(string username, User user, int operationIndex = 0) + { + UpdateUserWithHttpInfo(username, user); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string username, User user, int operationIndex = 0) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } + + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.UpdateUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateUserAsync(string username, User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + await UpdateUserWithHttpInfoAsync(username, user, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateUserWithHttpInfoAsync(string username, User user, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'username' is set + if (username == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } + + // verify the required parameter 'user' is set + if (user == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + localVarRequestOptions.Data = user; + + localVarRequestOptions.Operation = "UserApi.UpdateUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs new file mode 100644 index 000000000000..a8f6dea4407b --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -0,0 +1,838 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using RestSharp.Serializers; +using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; +using Polly; +using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? global::System.IO.Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + public partial class ApiClient : ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(RestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(RestRequest request, RestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.Get; + break; + case HttpMethod.Post: + other = RestSharpMethod.Post; + break; + case HttpMethod.Put: + other = RestSharpMethod.Put; + break; + case HttpMethod.Delete: + other = RestSharpMethod.Delete; + break; + case HttpMethod.Head: + other = RestSharpMethod.Head; + break; + case HttpMethod.Options: + other = RestSharpMethod.Options; + break; + case HttpMethod.Patch: + other = RestSharpMethod.Patch; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(path, Method(method)); + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddOrUpdateHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); + else + request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); + } + } + } + + if (options.HeaderParameters != null) + { + if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data"))) + { + request.AlwaysMultipartFormData = true; + } + } + + return request; + } + + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.ContentHeaders != null) + { + foreach (var responseHeader in response.ContentHeaders) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies.Cast()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + Timeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + setOptions(clientOptions); + + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(configuration.OAuthClientId) && + !string.IsNullOrEmpty(configuration.OAuthClientSecret) && + configuration.OAuthFlow != null) + { + clientOptions.Authenticator = new OAuthAuthenticator( + configuration.OAuthTokenUrl, + configuration.OAuthClientId, + configuration.OAuthClientSecret, + configuration.OAuthScope, + configuration.OAuthFlow, + SerializerSettings, + configuration); + } + + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response = await getResponse(client).ConfigureAwait(false); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) + { + if (policyResult.Outcome == OutcomeType.Successful) + { + return await client.Deserialize(policyResult.Result, cancellationToken).ConfigureAwait(false); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + + Func>> getResponse = async (client) => + { + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken).ConfigureAwait(false); + } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 000000000000..67d9888d6a3c --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiResponse.cs new file mode 100644 index 000000000000..ca2de833a5a4 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs new file mode 100644 index 000000000000..bcccf1e83f6f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; +using Newtonsoft.Json; +using RestSharp; +using RestSharp.Authenticators; + +namespace Org.OpenAPITools.Client.Auth +{ + /// + /// An authenticator for OAuth2 authentication flows + /// + public class OAuthAuthenticator : IAuthenticator + { + private TokenResponse? _token; + + /// + /// Returns the current authentication token. Can return null if there is no authentication token, or it has expired. + /// + public string? Token + { + get + { + if (_token == null) return null; + if (_token.ExpiresIn == null) return _token.AccessToken; + if (_token.ExpiresAt < DateTime.Now) return null; + + return _token.AccessToken; + } + } + + readonly string _tokenUrl; + readonly string _clientId; + readonly string _clientSecret; + readonly string? _scope; + readonly string _grantType; + readonly JsonSerializerSettings _serializerSettings; + readonly IReadableConfiguration _configuration; + + /// + /// Initialize the OAuth2 Authenticator + /// + public OAuthAuthenticator( + string tokenUrl, + string clientId, + string clientSecret, + string? scope, + OAuthFlow? flow, + JsonSerializerSettings serializerSettings, + IReadableConfiguration configuration) + { + _tokenUrl = tokenUrl; + _clientId = clientId; + _clientSecret = clientSecret; + _scope = scope; + _serializerSettings = serializerSettings; + _configuration = configuration; + + switch (flow) + { + /*case OAuthFlow.ACCESS_CODE: + _grantType = "authorization_code"; + break; + case OAuthFlow.IMPLICIT: + _grantType = "implicit"; + break; + case OAuthFlow.PASSWORD: + _grantType = "password"; + break;*/ + case OAuthFlow.APPLICATION: + _grantType = "client_credentials"; + break; + default: + break; + } + } + + /// + /// Creates an authentication parameter from an access token. + /// + /// An authentication parameter. + protected async ValueTask GetAuthenticationParameter() + { + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; + return new HeaderParameter(KnownHeaders.Authorization, token); + } + + /// + /// Gets the token from the OAuth2 server. + /// + /// An authentication token. + async Task GetToken() + { + var client = new RestClient(_tokenUrl, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); + + var request = new RestRequest(); + if (!string.IsNullOrWhiteSpace(_token?.RefreshToken)) + { + request.AddParameter("grant_type", "refresh_token") + .AddParameter("refresh_token", _token.RefreshToken); + } + else + { + request + .AddParameter("grant_type", _grantType) + .AddParameter("client_id", _clientId) + .AddParameter("client_secret", _clientSecret); + } + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + _token = await client.PostAsync(request).ConfigureAwait(false); + // RFC6749 - token_type is case insensitive. + // RFC6750 - In Authorization header Bearer should be capitalized. + // Fix the capitalization irrespective of token_type casing. + switch (_token?.TokenType?.ToLower()) + { + case "bearer": + return $"Bearer {_token.AccessToken}"; + default: + return $"{_token?.TokenType} {_token?.AccessToken}"; + } + } + + /// + /// Retrieves the authentication token (creating a new one if necessary) and adds it to the current request + /// + /// + /// + /// + public async ValueTask Authenticate(IRestClient client, RestRequest request) + => request.AddOrUpdateParameter(await GetAuthenticationParameter().ConfigureAwait(false)); + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs new file mode 100644 index 000000000000..e2257409258c --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthFlow.cs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +namespace Org.OpenAPITools.Client.Auth +{ + /// + /// Available flows for OAuth2 authentication + /// + public enum OAuthFlow + { + /// Authorization code flow + ACCESS_CODE, + /// Implicit flow + IMPLICIT, + /// Password flow + PASSWORD, + /// Client credentials flow + APPLICATION + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs new file mode 100644 index 000000000000..da4f4499b1cc --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Client.Auth +{ + class TokenResponse + { + [JsonProperty("token_type")] + public string TokenType { get; set; } + [JsonProperty("access_token")] + public string AccessToken { get; set; } + [JsonProperty("expires_in")] + public int? ExpiresIn { get; set; } + [JsonProperty("created")] + public DateTime? Created { get; set; } + + [JsonProperty("refresh_token")] + public string? RefreshToken { get; set; } + + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 000000000000..a3765e002293 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,269 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new(comparisonConfig); + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateOnly dateOnly) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15 + return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// Serializes the given object when not null. Otherwise return null. + /// + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Is the Enum decorated with EnumMember Attribute + /// + /// + /// true if found + private static bool HasEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// + /// Get the EnumMember value + /// + /// + /// EnumMember value as string otherwise null + private static string GetEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Configuration.cs new file mode 100644 index 000000000000..bd0f59f6356a --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -0,0 +1,778 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; +using Org.OpenAPITools.Client.Auth; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); + BasePath = "http://localhost/v2"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "http://localhost/v2"}, + {"description", "No description provided"}, + } + }, + { + new Dictionary { + {"url", "http://{server}.swagger.io:{port}/v2"}, + {"description", "petstore server"}, + { + "variables", new Dictionary { + { + "server", new Dictionary { + {"description", "No description provided"}, + {"default_value", "petstore"}, + { + "enum_values", new List() { + "petstore", + "qa-petstore", + "dev-petstore" + } + } + } + }, + { + "port", new Dictionary { + {"description", "No description provided"}, + {"default_value", "80"}, + { + "enum_values", new List() { + "80", + "8080" + } + } + } + } + } + } + } + }, + { + new Dictionary { + {"url", "https://localhost:8080/{version}"}, + {"description", "The local server"}, + { + "variables", new Dictionary { + { + "version", new Dictionary { + {"description", "No description provided"}, + {"default_value", "v2"}, + { + "enum_values", new List() { + "v1", + "v2" + } + } + } + } + } + } + } + }, + { + new Dictionary { + {"url", "https://127.0.0.1/no_variable"}, + {"description", "The local server without variables"}, + } + } + }; + OperationServers = new Dictionary>>() + { + { + "PetApi.AddPet", new List> + { + { + new Dictionary + { + {"url", "http://localhost/v2"}, + {"description", "No description provided"} + } + }, + { + new Dictionary + { + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"} + } + }, + { + new Dictionary + { + {"url", "http://path-server-test.petstore.local/v2"}, + {"description", "No description provided"} + } + }, + } + }, + { + "PetApi.UpdatePet", new List> + { + { + new Dictionary + { + {"url", "http://localhost/v2"}, + {"description", "No description provided"} + } + }, + { + new Dictionary + { + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"} + } + }, + { + new Dictionary + { + {"url", "http://path-server-test.petstore.local/v2"}, + {"description", "No description provided"} + } + }, + } + }, + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = TimeSpan.FromSeconds(100); + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://localhost/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. + /// + public virtual TimeSpan Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the token URL for OAuth2 authentication. + /// + /// The OAuth Token URL. + public virtual string OAuthTokenUrl { get; set; } + + /// + /// Gets or sets the client ID for OAuth2 authentication. + /// + /// The OAuth Client ID. + public virtual string OAuthClientId { get; set; } + + /// + /// Gets or sets the client secret for OAuth2 authentication. + /// + /// The OAuth Client Secret. + public virtual string OAuthClientSecret { get; set; } + + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string? OAuthScope { get; set; } + + /// + /// Gets or sets the flow for OAuth2 authentication. + /// + /// The OAuth Flow. + public virtual OAuthFlow? OAuthFlow { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// + /// Gets and Sets the HttpSigningConfiguration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, + OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, + OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, + OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ExceptionFactory.cs new file mode 100644 index 000000000000..43624dd7c86c --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs new file mode 100644 index 000000000000..cbee70bca372 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/HttpMethod.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/HttpMethod.cs new file mode 100644 index 000000000000..39cde64b2a57 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/HttpMethod.cs @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IApiAccessor.cs new file mode 100644 index 000000000000..2bd764160046 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs new file mode 100644 index 000000000000..2c268df7a1fc --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs new file mode 100644 index 000000000000..ab66c761933f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using Org.OpenAPITools.Client.Auth; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the OAuth token URL. + /// + /// OAuth Token URL. + string OAuthTokenUrl { get; } + + /// + /// Gets the OAuth client ID. + /// + /// OAuth Client ID. + string OAuthClientId { get; } + + /// + /// Gets the OAuth client secret. + /// + /// OAuth Client Secret. + string OAuthClientSecret { get; } + + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string? OAuthScope { get; } + + /// + /// Gets the OAuth flow. + /// + /// OAuth Flow. + OAuthFlow? OAuthFlow { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout. + /// + /// HTTP connection timeout. + TimeSpan Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ISynchronousClient.cs new file mode 100644 index 000000000000..0e0a7fedacf6 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.IO; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Multimap.cs new file mode 100644 index 000000000000..738a64c570b0 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000000..a5253e582013 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/RequestOptions.cs new file mode 100644 index 000000000000..f5e02e93f0f9 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Operation associated with the request path. + /// + public string Operation { get; set; } + + /// + /// Index associated with the operation. + /// + public int OperationIndex { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// If request should be authenticated with OAuth. + /// + public bool OAuth { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/RetryConfiguration.cs new file mode 100644 index 000000000000..e6080c67e845 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -0,0 +1,31 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Polly; +using RestSharp; + +namespace Org.OpenAPITools.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public static class RetryConfiguration + { + /// + /// Retry policy + /// + public static ISyncPolicy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static IAsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 000000000000..b3fc4c3c7a3a --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Activity.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Activity.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Activity.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Animal.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Animal.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Animal.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 000000000000..7dec589c62d6 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ApiResponse + /// + [DataContract(Name = "ApiResponse")] + public partial class ApiResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int code = default, string type = default, string message = default) + { + this.Code = code; + this.Type = type; + this.Message = message; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual; + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Apple.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Apple.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Apple.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/AppleReq.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ArrayTest.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Banana.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Banana.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Banana.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/BananaReq.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/BasquePig.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Capitalization.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Cat.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Cat.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Cat.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..8fcdcaf5342d --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract(Name = "Cat_allOf")] + public partial class CatAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as CatAllOf).AreEqual; + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 000000000000..b56dfc0c4828 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Category + /// + [DataContract(Name = "Category")] + public partial class Category : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name (required) (default to "default-name"). + public Category(long id = default, string name = @"default-name") + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; + this.Id = id; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual; + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ChildCat.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs new file mode 100644 index 000000000000..89aa703afd3f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCatAllOf + /// + [DataContract(Name = "ChildCat_allOf")] + public partial class ChildCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", EmitDefaultValue = false)] + public PetTypeEnum? PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (default to PetTypeEnum.ChildCat). + public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + { + this.Name = name; + this.PetType = petType; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCatAllOf {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCatAllOf).AreEqual; + } + + /// + /// Returns true if ChildCatAllOf instances are equal + /// + /// Instance of ChildCatAllOf to be compared + /// Boolean + public bool Equals(ChildCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ClassModel.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/DanishPig.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/DateOnlyClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/DeprecatedObject.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Dog.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Dog.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Dog.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..e82743a71511 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract(Name = "Dog_allOf")] + public partial class DogAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as DogAllOf).AreEqual; + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Drawing.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Drawing.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Drawing.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EnumArrays.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EnumClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EnumTest.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/EquilateralTriangle.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/File.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/File.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/File.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Foo.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Foo.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Foo.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FormatTest.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Fruit.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Fruit.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Fruit.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/FruitReq.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/GmFruit.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/GrandparentAnimal.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/HealthCheckResult.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/List.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/List.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/List.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/LiteralStringClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Mammal.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Mammal.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Mammal.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MapTest.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MapTest.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MapTest.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOf.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedEnumType.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedEnumType.cs new file mode 100644 index 000000000000..95b561a9f076 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedEnumType.cs @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines MixedEnumType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MixedEnumType + { + /// + /// Enum SOMETHING for value: SOMETHING + /// + [EnumMember(Value = "SOMETHING")] + SOMETHING = 1, + + /// + /// Enum OTHER for value: OTHER + /// + [EnumMember(Value = "OTHER")] + OTHER = 2 + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedNullableEnumType.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedNullableEnumType.cs new file mode 100644 index 000000000000..166feb8ea602 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedNullableEnumType.cs @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines MixedNullableEnumType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MixedNullableEnumType + { + /// + /// Enum SOMETHINGNULL for value: SOMETHING_NULL + /// + [EnumMember(Value = "SOMETHING_NULL")] + SOMETHINGNULL = 1, + + /// + /// Enum SOMETHINGNEWED for value: SOMETHING_NEWED + /// + [EnumMember(Value = "SOMETHING_NEWED")] + SOMETHINGNEWED = 2, + + /// + /// Enum Null for value: null + /// + [EnumMember(Value = "null")] + Null = 3 + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOf.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOfContent.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/MixedSubId.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Model200Response.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ModelClient.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Name.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Name.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Name.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NullableClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NullableGuidClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NullableShape.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/NumberOnly.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OneOfString.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 000000000000..8aa03dd2f492 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,212 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Order + /// + [DataContract(Name = "Order")] + public partial class Order : IEquatable, IValidatableObject + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long id = default, long petId = default, int quantity = default, DateTime shipDate = default, StatusEnum? status = default, bool complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + this.Complete = complete; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name = "petId", EmitDefaultValue = false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + /* + 2020-02-02T20:20:20.000222Z + */ + [DataMember(Name = "shipDate", EmitDefaultValue = false)] + public DateTime ShipDate { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name = "complete", EmitDefaultValue = true)] + public bool Complete { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Order).AreEqual; + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterComposite.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs similarity index 95% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnum.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs index 7cacd79e3e6a..59a9f8e3500a 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnum.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -45,10 +45,10 @@ public enum OuterEnum Approved = 2, /// - /// Enum Shipped for value: delivered + /// Enum Delivered for value: delivered /// [EnumMember(Value = "delivered")] - Shipped = 3 + Delivered = 3 } } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs similarity index 95% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs index d6790731adb7..40e276b600eb 100644 --- a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -45,10 +45,10 @@ public enum OuterEnumDefaultValue Approved = 2, /// - /// Enum Shipped for value: delivered + /// Enum Delivered for value: delivered /// [EnumMember(Value = "delivered")] - Shipped = 3 + Delivered = 3 } } diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumInteger.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumTest.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/OuterEnumTest.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ParentPet.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 000000000000..d6cf84c4d73f --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,239 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pet + /// + [DataContract(Name = "Pet")] + public partial class Pet : IEquatable, IValidatableObject + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + } + + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long id = default, Category category = default, string name = default, List photoUrls = default, List tags = default, StatusEnum? status = default) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) + { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /* + doggie + */ + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = true)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pet).AreEqual; + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PhotoUrls != null) + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } + if (this.Tags != null) + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Pig.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Pig.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Pig.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/PolymorphicProperty.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Quadrilateral.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/RequiredClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Return.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Return.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Return.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHash.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ScaleneTriangle.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Shape.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Shape.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Shape.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ShapeInterface.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ShapeOrNull.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/SpecialModelName.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 000000000000..662ad9138d5a --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Tag + /// + [DataContract(Name = "Tag")] + public partial class Tag : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long id = default, string name = default) + { + this.Id = id; + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Tag).AreEqual; + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Triangle.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Triangle.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Triangle.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/TriangleInterface.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/UpdatePet200Response.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/UpdatePet200Response.cs new file mode 100644 index 000000000000..1d79b6a37773 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/UpdatePet200Response.cs @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// UpdatePet200Response + /// + [DataContract(Name = "updatePet_200_response")] + public partial class UpdatePet200Response : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varString. + public UpdatePet200Response(Pet varString = default(Pet)) + { + this.VarString = varString; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets VarString + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public Pet VarString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UpdatePet200Response {\n"); + sb.Append(" VarString: ").Append(VarString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as UpdatePet200Response).AreEqual; + } + + /// + /// Returns true if UpdatePet200Response instances are equal + /// + /// Instance of UpdatePet200Response to be compared + /// Boolean + public bool Equals(UpdatePet200Response input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.VarString != null) + { + hashCode = (hashCode * 59) + this.VarString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 000000000000..20b349a6dedf --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,274 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// User + /// + [DataContract(Name = "User")] + public partial class User : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. + /// 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. + /// 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.. + public User(long id = default, string username = default, string firstName = default, string lastName = default, string email = default, string password = default, string phone = default, int userStatus = default, Object objectWithNoDeclaredProps = default, Object objectWithNoDeclaredPropsNullable = default, Object anyTypeProp = default, Object anyTypePropNullable = default) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + this.ObjectWithNoDeclaredProps = objectWithNoDeclaredProps; + this.ObjectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + this.AnyTypeProp = anyTypeProp; + this.AnyTypePropNullable = anyTypePropNullable; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name = "phone", EmitDefaultValue = false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name = "userStatus", EmitDefaultValue = false)] + public int UserStatus { get; set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] + public Object ObjectWithNoDeclaredProps { get; set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] + public Object ObjectWithNoDeclaredPropsNullable { get; set; } + + /// + /// 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 + /// + /// 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 + [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] + public Object AnyTypeProp { get; set; } + + /// + /// 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. + /// + /// 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. + [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] + public Object AnyTypePropNullable { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as User).AreEqual; + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Username != null) + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.Email != null) + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.Phone != null) + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); + if (this.ObjectWithNoDeclaredProps != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } + if (this.ObjectWithNoDeclaredPropsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } + if (this.AnyTypeProp != null) + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } + if (this.AnyTypePropNullable != null) + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Whale.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Whale.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Whale.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Zebra.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/Zebra.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/Zebra.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs similarity index 100% rename from samples/client/petstore/csharp/restsharp/net10/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs rename to samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..67145325cdc6 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,36 @@ + + + + false + net10.0 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + annotations + false + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.nuspec new file mode 100644 index 000000000000..130ebd5b7f55 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -0,0 +1,41 @@ + + + + + $id$ + OpenAPI Library + + + $version$ + + + $author$ + + + $author$ + false + false + + + A library generated from a OpenAPI doc + https://www.apache.org/licenses/LICENSE-2.0.html + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Properties/AssemblyInfo.cs b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..f3fef5199ab2 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenAPI Library")] +[assembly: AssemblyDescription("A library generated from a OpenAPI doc")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("OpenAPI")] +[assembly: AssemblyProduct("OpenAPILibrary")] +[assembly: AssemblyCopyright("No Copyright")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] diff --git a/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/project.json b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/project.json new file mode 100644 index 000000000000..fdaea921baa8 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net10/Petstore/src/Org.OpenAPITools/project.json @@ -0,0 +1,13 @@ +{ + "supports": {}, + "dependencies": { + "Newtonsoft.Json": "12.0.1", + "CompareNETObjects": "4.57.0", + "System.ComponentModel.Annotations": "4.5.0", + "JsonSubTypes": "1.5.2", + "RestSharp": "106.10.1" + }, + "frameworks": { + "netstandard2.0": {} + } +}