From 1d5e35fc9d1d1182a81b45ac6e8f9a232b0cc6bc Mon Sep 17 00:00:00 2001 From: k26475 Date: Tue, 9 May 2017 15:28:05 -0400 Subject: [PATCH] Issue #5419 - Part 1 - C# Servers updated and samples generated --- bin/aspnetcore-petstore-server.sh | 2 +- bin/nancyfx-petstore-server.sh | 2 +- bin/windows/aspnetcore-petstore-server.bat | 2 +- bin/windows/nancyfx-petstore-server.bat | 2 +- samples/server/petstore/aspnetcore/README.md | 2 +- .../src/IO.Swagger/Controllers/FakeApi.cs | 104 +++++ .../src/IO.Swagger/Controllers/PetApi.cs | 2 +- .../src/IO.Swagger/Controllers/StoreApi.cs | 6 +- .../src/IO.Swagger/Controllers/UserApi.cs | 2 +- .../Models/AdditionalPropertiesClass.cs | 148 +++++++ .../src/IO.Swagger/Models/Animal.cs | 164 +++++++ .../src/IO.Swagger/Models/AnimalFarm.cs | 118 ++++++ .../src/IO.Swagger/Models/ApiResponse.cs | 4 +- .../Models/ArrayOfArrayOfNumberOnly.cs | 133 ++++++ .../IO.Swagger/Models/ArrayOfNumberOnly.cs | 133 ++++++ .../src/IO.Swagger/Models/ArrayTest.cs | 163 +++++++ .../src/IO.Swagger/Models/Capitalization.cs | 209 +++++++++ .../aspnetcore/src/IO.Swagger/Models/Cat.cs | 179 ++++++++ .../src/IO.Swagger/Models/Category.cs | 4 +- .../src/IO.Swagger/Models/ClassModel.cs | 133 ++++++ .../src/IO.Swagger/Models/Client.cs | 133 ++++++ .../aspnetcore/src/IO.Swagger/Models/Dog.cs | 179 ++++++++ .../src/IO.Swagger/Models/EnumArrays.cs | 202 +++++++++ .../src/IO.Swagger/Models/EnumClass.cs | 46 ++ .../src/IO.Swagger/Models/EnumTest.cs | 238 +++++++++++ .../src/IO.Swagger/Models/FormatTest.cs | 345 +++++++++++++++ .../src/IO.Swagger/Models/HasOnlyReadOnly.cs | 148 +++++++ .../aspnetcore/src/IO.Swagger/Models/List.cs | 133 ++++++ .../src/IO.Swagger/Models/MapTest.cs | 184 ++++++++ ...dPropertiesAndAdditionalPropertiesClass.cs | 163 +++++++ .../src/IO.Swagger/Models/Model200Response.cs | 148 +++++++ .../aspnetcore/src/IO.Swagger/Models/Name.cs | 186 ++++++++ .../src/IO.Swagger/Models/NumberOnly.cs | 133 ++++++ .../aspnetcore/src/IO.Swagger/Models/Order.cs | 4 +- .../src/IO.Swagger/Models/OuterEnum.cs | 46 ++ .../aspnetcore/src/IO.Swagger/Models/Pet.cs | 4 +- .../src/IO.Swagger/Models/ReadOnlyFirst.cs | 148 +++++++ .../src/IO.Swagger/Models/Return.cs | 133 ++++++ .../src/IO.Swagger/Models/SpecialModelName.cs | 133 ++++++ .../aspnetcore/src/IO.Swagger/Models/Tag.cs | 4 +- .../aspnetcore/src/IO.Swagger/Models/User.cs | 4 +- .../aspnetcore/src/IO.Swagger/Startup.cs | 2 +- .../server/petstore/nancyfx/IO.Swagger.sln | 10 +- .../nancyfx/src/IO.Swagger/IO.Swagger.csproj | 2 +- .../Models/AdditionalPropertiesClass.cs | 165 +++++++ .../nancyfx/src/IO.Swagger/Models/Animal.cs | 170 ++++++++ .../src/IO.Swagger/Models/AnimalFarm.cs | 126 ++++++ .../src/IO.Swagger/Models/ApiResponse.cs | 2 +- .../Models/ArrayOfArrayOfNumberOnly.cs | 145 +++++++ .../IO.Swagger/Models/ArrayOfNumberOnly.cs | 145 +++++++ .../src/IO.Swagger/Models/ArrayTest.cs | 185 ++++++++ .../src/IO.Swagger/Models/Capitalization.cs | 245 +++++++++++ .../nancyfx/src/IO.Swagger/Models/Cat.cs | 176 ++++++++ .../nancyfx/src/IO.Swagger/Models/Category.cs | 2 +- .../src/IO.Swagger/Models/ClassModel.cs | 145 +++++++ .../nancyfx/src/IO.Swagger/Models/Client.cs | 145 +++++++ .../nancyfx/src/IO.Swagger/Models/Dog.cs | 176 ++++++++ .../src/IO.Swagger/Models/EnumArrays.cs | 168 ++++++++ .../src/IO.Swagger/Models/EnumClass.cs | 126 ++++++ .../nancyfx/src/IO.Swagger/Models/EnumTest.cs | 208 +++++++++ .../src/IO.Swagger/Models/FormatTest.cs | 401 ++++++++++++++++++ .../src/IO.Swagger/Models/HasOnlyReadOnly.cs | 165 +++++++ .../nancyfx/src/IO.Swagger/Models/List.cs | 145 +++++++ .../nancyfx/src/IO.Swagger/Models/MapTest.cs | 167 ++++++++ ...dPropertiesAndAdditionalPropertiesClass.cs | 185 ++++++++ .../src/IO.Swagger/Models/Model200Response.cs | 165 +++++++ .../nancyfx/src/IO.Swagger/Models/Name.cs | 209 +++++++++ .../src/IO.Swagger/Models/NumberOnly.cs | 145 +++++++ .../nancyfx/src/IO.Swagger/Models/Order.cs | 2 +- .../src/IO.Swagger/Models/OuterEnum.cs | 126 ++++++ .../nancyfx/src/IO.Swagger/Models/Pet.cs | 2 +- .../src/IO.Swagger/Models/ReadOnlyFirst.cs | 165 +++++++ .../nancyfx/src/IO.Swagger/Models/Return.cs | 145 +++++++ .../src/IO.Swagger/Models/SpecialModelName.cs | 145 +++++++ .../nancyfx/src/IO.Swagger/Models/Tag.cs | 2 +- .../nancyfx/src/IO.Swagger/Models/User.cs | 2 +- .../src/IO.Swagger/Modules/FakeModule.cs | 228 ++++++++++ .../src/IO.Swagger/Modules/StoreModule.cs | 4 +- 78 files changed, 8935 insertions(+), 37 deletions(-) create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/FakeApi.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AdditionalPropertiesClass.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Animal.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AnimalFarm.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfNumberOnly.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayTest.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Capitalization.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Cat.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ClassModel.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Client.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Dog.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumArrays.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumClass.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumTest.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/FormatTest.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/HasOnlyReadOnly.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/List.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MapTest.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Model200Response.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Name.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/NumberOnly.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/OuterEnum.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ReadOnlyFirst.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Return.cs create mode 100644 samples/server/petstore/aspnetcore/src/IO.Swagger/Models/SpecialModelName.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/AdditionalPropertiesClass.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Animal.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/AnimalFarm.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfNumberOnly.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayTest.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Capitalization.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Cat.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/ClassModel.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Client.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Dog.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumArrays.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumClass.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumTest.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/FormatTest.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/HasOnlyReadOnly.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/List.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/MapTest.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Model200Response.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Name.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/NumberOnly.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/OuterEnum.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/ReadOnlyFirst.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/Return.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Models/SpecialModelName.cs create mode 100644 samples/server/petstore/nancyfx/src/IO.Swagger/Modules/FakeModule.cs diff --git a/bin/aspnetcore-petstore-server.sh b/bin/aspnetcore-petstore-server.sh index 105af567498..eaa9777513a 100755 --- a/bin/aspnetcore-petstore-server.sh +++ b/bin/aspnetcore-petstore-server.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -l aspnetcore -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5}" +ags="$@ generate -l aspnetcore -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5}" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/nancyfx-petstore-server.sh b/bin/nancyfx-petstore-server.sh index 38db6514ded..adc9252a665 100755 --- a/bin/nancyfx-petstore-server.sh +++ b/bin/nancyfx-petstore-server.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate $@ -t modules/swagger-codegen/src/main/resources/nancyfx -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l nancyfx -o samples/server/petstore/nancyfx --additional-properties packageGuid={768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +ags="generate $@ -t modules/swagger-codegen/src/main/resources/nancyfx -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l nancyfx -o samples/server/petstore/nancyfx --additional-properties packageGuid={768B8DC6-54EE-4D40-9B20-7857E1D742A4}" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/aspnetcore-petstore-server.bat b/bin/windows/aspnetcore-petstore-server.bat index e8dc14eadb0..8b84a0354e9 100755 --- a/bin/windows/aspnetcore-petstore-server.bat +++ b/bin/windows/aspnetcore-petstore-server.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l aspnetcore -o samples\server\petstore\aspnetcore\ --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l aspnetcore -o samples\server\petstore\aspnetcore\ --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/nancyfx-petstore-server.bat b/bin/windows/nancyfx-petstore-server.bat index cfd16120caf..4303f610fac 100644 --- a/bin/windows/nancyfx-petstore-server.bat +++ b/bin/windows/nancyfx-petstore-server.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l nancyfx -o samples\server\petstore\nancyfx\ +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l nancyfx -o samples\server\petstore\nancyfx\ java %JAVA_OPTS% -jar %executable% %ags% diff --git a/samples/server/petstore/aspnetcore/README.md b/samples/server/petstore/aspnetcore/README.md index 664d66c2cd5..27557082f25 100644 --- a/samples/server/petstore/aspnetcore/README.md +++ b/samples/server/petstore/aspnetcore/README.md @@ -1,6 +1,6 @@ # IO.Swagger - ASP.NET Core 1.0 Server -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Run diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/FakeApi.cs new file mode 100644 index 00000000000..f1e0520771b --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/FakeApi.cs @@ -0,0 +1,104 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Swashbuckle.SwaggerGen.Annotations; +using IO.Swagger.Models; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + public class FakeApiController : Controller + { + + /// + /// To test \"client\" model + /// + /// To test \"client\" model + /// client model + /// successful operation + [HttpPatch] + [Route("/v2/fake")] + [SwaggerOperation("TestClientModel")] + [SwaggerResponse(200, type: typeof(Client))] + public virtual IActionResult TestClientModel([FromBody]Client body) + { + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Client); + return new ObjectResult(example); + } + + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// None + /// Invalid username supplied + /// User not found + [HttpPost] + [Route("/v2/fake")] + [SwaggerOperation("TestEndpointParameters")] + public virtual void TestEndpointParameters([FromForm]decimal? number, [FromForm]double? double, [FromForm]string patternWithoutDelimiter, [FromForm]byte[] byte, [FromForm]int? integer, [FromForm]int? int32, [FromForm]long? int64, [FromForm]float? float, [FromForm]string string, [FromForm]byte[] binary, [FromForm]DateTime? date, [FromForm]DateTime? dateTime, [FromForm]string password, [FromForm]string callback) + { + throw new NotImplementedException(); + } + + + /// + /// To test enum parameters + /// + /// To test enum parameters + /// Form parameter enum test (string array) + /// Form parameter enum test (string) + /// Header parameter enum test (string array) + /// Header parameter enum test (string) + /// Query parameter enum test (string array) + /// Query parameter enum test (string) + /// Query parameter enum test (double) + /// Query parameter enum test (double) + /// Invalid request + /// Not found + [HttpGet] + [Route("/v2/fake")] + [SwaggerOperation("TestEnumParameters")] + public virtual void TestEnumParameters([FromForm]List enumFormStringArray, [FromForm]string enumFormString, [FromHeader]List enumHeaderStringArray, [FromHeader]string enumHeaderString, [FromQuery]List enumQueryStringArray, [FromQuery]string enumQueryString, [FromQuery]int? enumQueryInteger, [FromForm]double? enumQueryDouble) + { + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs index 460192fc3fe..0e1f0efa044 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/StoreApi.cs index 467a365679b..5fe3585c541 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/StoreApi.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -37,7 +37,7 @@ public class StoreApiController : Controller /// Invalid ID supplied /// Order not found [HttpDelete] - [Route("/v2/store/order/{orderId}")] + [Route("/v2/store/order/{order_id}")] [SwaggerOperation("DeleteOrder")] public virtual void DeleteOrder([FromRoute]string orderId) { @@ -74,7 +74,7 @@ public virtual IActionResult GetInventory() /// Invalid ID supplied /// Order not found [HttpGet] - [Route("/v2/store/order/{orderId}")] + [Route("/v2/store/order/{order_id}")] [SwaggerOperation("GetOrderById")] [SwaggerResponse(200, type: typeof(Order))] public virtual IActionResult GetOrderById([FromRoute]long? orderId) diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs index c01db365593..cf3baf8fe87 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AdditionalPropertiesClass.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..fde539a295f --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AdditionalPropertiesClass.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class AdditionalPropertiesClass : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// MapProperty. + /// MapOfMapProperty. + public AdditionalPropertiesClass(Dictionary MapProperty = default(Dictionary), Dictionary> MapOfMapProperty = default(Dictionary>)) + { + this.MapProperty = MapProperty; + this.MapOfMapProperty = MapOfMapProperty; + + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name="map_property")] + public Dictionary MapProperty { get; set; } + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name="map_of_map_property")] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((AdditionalPropertiesClass)obj); + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.MapProperty == other.MapProperty || + this.MapProperty != null && + this.MapProperty.SequenceEqual(other.MapProperty) + ) && + ( + this.MapOfMapProperty == other.MapOfMapProperty || + this.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(other.MapOfMapProperty) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.MapProperty != null) + hash = hash * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hash = hash * 59 + this.MapOfMapProperty.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(AdditionalPropertiesClass left, AdditionalPropertiesClass right) + { + return Equals(left, right); + } + + public static bool operator !=(AdditionalPropertiesClass left, AdditionalPropertiesClass right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Animal.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Animal.cs new file mode 100644 index 00000000000..1a701e74a92 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Animal.cs @@ -0,0 +1,164 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class Animal : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// ClassName (required). + /// Color (default to "red"). + public Animal(string ClassName = default(string), string Color = "red") + { + // to ensure "ClassName" is required (not null) + if (ClassName == null) + { + throw new InvalidDataException("ClassName is a required property for Animal and cannot be null"); + } + else + { + this.ClassName = ClassName; + } + // use default value if no "Color" provided + if (Color == null) + { + this.Color = "red"; + } + else + { + this.Color = Color; + } + + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name="className")] + public string ClassName { get; set; } + /// + /// Gets or Sets Color + /// + [DataMember(Name="color")] + public string Color { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.ClassName == other.ClassName || + this.ClassName != null && + this.ClassName.Equals(other.ClassName) + ) && + ( + this.Color == other.Color || + this.Color != null && + this.Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ClassName != null) + hash = hash * 59 + this.ClassName.GetHashCode(); + if (this.Color != null) + hash = hash * 59 + this.Color.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AnimalFarm.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AnimalFarm.cs new file mode 100644 index 00000000000..f0c4733f721 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/AnimalFarm.cs @@ -0,0 +1,118 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class AnimalFarm : List, IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + public AnimalFarm() + { + + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AnimalFarm {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((AnimalFarm)obj); + } + + /// + /// Returns true if AnimalFarm instances are equal + /// + /// Instance of AnimalFarm to be compared + /// Boolean + public bool Equals(AnimalFarm other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + #region Operators + + public static bool operator ==(AnimalFarm left, AnimalFarm right) + { + return Equals(left, right); + } + + public static bool operator !=(AnimalFarm left, AnimalFarm right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ApiResponse.cs index 2782644943b..ee34d11581a 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ApiResponse.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ApiResponse.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -22,7 +22,7 @@ namespace IO.Swagger.Models { /// - /// Describes the result of uploading an image resource + /// /// [DataContract] public partial class ApiResponse : IEquatable diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..50fd34bc7c1 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class ArrayOfArrayOfNumberOnly : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// ArrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> ArrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = ArrayArrayNumber; + + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name="ArrayArrayNumber")] + public List> ArrayArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((ArrayOfArrayOfNumberOnly)obj); + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.ArrayArrayNumber == other.ArrayArrayNumber || + this.ArrayArrayNumber != null && + this.ArrayArrayNumber.SequenceEqual(other.ArrayArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ArrayArrayNumber != null) + hash = hash * 59 + this.ArrayArrayNumber.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(ArrayOfArrayOfNumberOnly left, ArrayOfArrayOfNumberOnly right) + { + return Equals(left, right); + } + + public static bool operator !=(ArrayOfArrayOfNumberOnly left, ArrayOfArrayOfNumberOnly right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfNumberOnly.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..6bd7ed6f647 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayOfNumberOnly.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class ArrayOfNumberOnly : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// ArrayNumber. + public ArrayOfNumberOnly(List ArrayNumber = default(List)) + { + this.ArrayNumber = ArrayNumber; + + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name="ArrayNumber")] + public List ArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((ArrayOfNumberOnly)obj); + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.ArrayNumber == other.ArrayNumber || + this.ArrayNumber != null && + this.ArrayNumber.SequenceEqual(other.ArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ArrayNumber != null) + hash = hash * 59 + this.ArrayNumber.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(ArrayOfNumberOnly left, ArrayOfNumberOnly right) + { + return Equals(left, right); + } + + public static bool operator !=(ArrayOfNumberOnly left, ArrayOfNumberOnly right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayTest.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayTest.cs new file mode 100644 index 00000000000..eb3e387c7e0 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ArrayTest.cs @@ -0,0 +1,163 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class ArrayTest : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// ArrayOfString. + /// ArrayArrayOfInteger. + /// ArrayArrayOfModel. + public ArrayTest(List ArrayOfString = default(List), List> ArrayArrayOfInteger = default(List>), List> ArrayArrayOfModel = default(List>)) + { + this.ArrayOfString = ArrayOfString; + this.ArrayArrayOfInteger = ArrayArrayOfInteger; + this.ArrayArrayOfModel = ArrayArrayOfModel; + + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name="array_of_string")] + public List ArrayOfString { get; set; } + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name="array_array_of_integer")] + public List> ArrayArrayOfInteger { get; set; } + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name="array_array_of_model")] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((ArrayTest)obj); + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.ArrayOfString == other.ArrayOfString || + this.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(other.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == other.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(other.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == other.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(other.ArrayArrayOfModel) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ArrayOfString != null) + hash = hash * 59 + this.ArrayOfString.GetHashCode(); + if (this.ArrayArrayOfInteger != null) + hash = hash * 59 + this.ArrayArrayOfInteger.GetHashCode(); + if (this.ArrayArrayOfModel != null) + hash = hash * 59 + this.ArrayArrayOfModel.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(ArrayTest left, ArrayTest right) + { + return Equals(left, right); + } + + public static bool operator !=(ArrayTest left, ArrayTest right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Capitalization.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Capitalization.cs new file mode 100644 index 00000000000..c577228b5cd --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Capitalization.cs @@ -0,0 +1,209 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class Capitalization : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// SmallCamel. + /// CapitalCamel. + /// SmallSnake. + /// CapitalSnake. + /// SCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string SmallCamel = default(string), string CapitalCamel = default(string), string SmallSnake = default(string), string CapitalSnake = default(string), string SCAETHFlowPoints = default(string), string ATT_NAME = default(string)) + { + this.SmallCamel = SmallCamel; + this.CapitalCamel = CapitalCamel; + this.SmallSnake = SmallSnake; + this.CapitalSnake = CapitalSnake; + this.SCAETHFlowPoints = SCAETHFlowPoints; + this.ATT_NAME = ATT_NAME; + + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name="smallCamel")] + public string SmallCamel { get; set; } + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name="CapitalCamel")] + public string CapitalCamel { get; set; } + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name="small_Snake")] + public string SmallSnake { get; set; } + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name="Capital_Snake")] + public string CapitalSnake { get; set; } + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name="SCA_ETH_Flow_Points")] + public string SCAETHFlowPoints { get; set; } + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name="ATT_NAME")] + public string ATT_NAME { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Capitalization)obj); + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.SmallCamel == other.SmallCamel || + this.SmallCamel != null && + this.SmallCamel.Equals(other.SmallCamel) + ) && + ( + this.CapitalCamel == other.CapitalCamel || + this.CapitalCamel != null && + this.CapitalCamel.Equals(other.CapitalCamel) + ) && + ( + this.SmallSnake == other.SmallSnake || + this.SmallSnake != null && + this.SmallSnake.Equals(other.SmallSnake) + ) && + ( + this.CapitalSnake == other.CapitalSnake || + this.CapitalSnake != null && + this.CapitalSnake.Equals(other.CapitalSnake) + ) && + ( + this.SCAETHFlowPoints == other.SCAETHFlowPoints || + this.SCAETHFlowPoints != null && + this.SCAETHFlowPoints.Equals(other.SCAETHFlowPoints) + ) && + ( + this.ATT_NAME == other.ATT_NAME || + this.ATT_NAME != null && + this.ATT_NAME.Equals(other.ATT_NAME) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.SmallCamel != null) + hash = hash * 59 + this.SmallCamel.GetHashCode(); + if (this.CapitalCamel != null) + hash = hash * 59 + this.CapitalCamel.GetHashCode(); + if (this.SmallSnake != null) + hash = hash * 59 + this.SmallSnake.GetHashCode(); + if (this.CapitalSnake != null) + hash = hash * 59 + this.CapitalSnake.GetHashCode(); + if (this.SCAETHFlowPoints != null) + hash = hash * 59 + this.SCAETHFlowPoints.GetHashCode(); + if (this.ATT_NAME != null) + hash = hash * 59 + this.ATT_NAME.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Capitalization left, Capitalization right) + { + return Equals(left, right); + } + + public static bool operator !=(Capitalization left, Capitalization right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Cat.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Cat.cs new file mode 100644 index 00000000000..dab7a6be4cf --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Cat.cs @@ -0,0 +1,179 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// ClassName (required). + /// Color (default to "red"). + /// Declawed. + public Cat(string ClassName = default(string), string Color = "red", bool? Declawed = default(bool?)) + { + // to ensure "ClassName" is required (not null) + if (ClassName == null) + { + throw new InvalidDataException("ClassName is a required property for Cat and cannot be null"); + } + else + { + this.ClassName = ClassName; + } + // use default value if no "Color" provided + if (Color == null) + { + this.Color = "red"; + } + else + { + this.Color = Color; + } + this.Declawed = Declawed; + + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name="className")] + public string ClassName { get; set; } + /// + /// Gets or Sets Color + /// + [DataMember(Name="color")] + public string Color { get; set; } + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed")] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.ClassName == other.ClassName || + this.ClassName != null && + this.ClassName.Equals(other.ClassName) + ) && + ( + this.Color == other.Color || + this.Color != null && + this.Color.Equals(other.Color) + ) && + ( + this.Declawed == other.Declawed || + this.Declawed != null && + this.Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ClassName != null) + hash = hash * 59 + this.ClassName.GetHashCode(); + if (this.Color != null) + hash = hash * 59 + this.Color.GetHashCode(); + if (this.Declawed != null) + hash = hash * 59 + this.Declawed.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Category.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Category.cs index 55a7bcdc113..2b576213b65 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Category.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Category.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -22,7 +22,7 @@ namespace IO.Swagger.Models { /// - /// A category for a pet + /// /// [DataContract] public partial class Category : IEquatable diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ClassModel.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ClassModel.cs new file mode 100644 index 00000000000..2b86a8bc1ff --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ClassModel.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// Model for testing model with \"_class\" property + /// + [DataContract] + public partial class ClassModel : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// Class. + public ClassModel(string Class = default(string)) + { + this.Class = Class; + + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="_class")] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((ClassModel)obj); + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.Class == other.Class || + this.Class != null && + this.Class.Equals(other.Class) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Class != null) + hash = hash * 59 + this.Class.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(ClassModel left, ClassModel right) + { + return Equals(left, right); + } + + public static bool operator !=(ClassModel left, ClassModel right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Client.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Client.cs new file mode 100644 index 00000000000..bdf2f644bc4 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Client.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class Client : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// _Client. + public Client(string _Client = default(string)) + { + this._Client = _Client; + + } + + /// + /// Gets or Sets _Client + /// + [DataMember(Name="client")] + public string _Client { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Client {\n"); + sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Client)obj); + } + + /// + /// Returns true if Client instances are equal + /// + /// Instance of Client to be compared + /// Boolean + public bool Equals(Client other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this._Client == other._Client || + this._Client != null && + this._Client.Equals(other._Client) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this._Client != null) + hash = hash * 59 + this._Client.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Client left, Client right) + { + return Equals(left, right); + } + + public static bool operator !=(Client left, Client right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Dog.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Dog.cs new file mode 100644 index 00000000000..7e8b1469a87 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Dog.cs @@ -0,0 +1,179 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// ClassName (required). + /// Color (default to "red"). + /// Breed. + public Dog(string ClassName = default(string), string Color = "red", string Breed = default(string)) + { + // to ensure "ClassName" is required (not null) + if (ClassName == null) + { + throw new InvalidDataException("ClassName is a required property for Dog and cannot be null"); + } + else + { + this.ClassName = ClassName; + } + // use default value if no "Color" provided + if (Color == null) + { + this.Color = "red"; + } + else + { + this.Color = Color; + } + this.Breed = Breed; + + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name="className")] + public string ClassName { get; set; } + /// + /// Gets or Sets Color + /// + [DataMember(Name="color")] + public string Color { get; set; } + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed")] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.ClassName == other.ClassName || + this.ClassName != null && + this.ClassName.Equals(other.ClassName) + ) && + ( + this.Color == other.Color || + this.Color != null && + this.Color.Equals(other.Color) + ) && + ( + this.Breed == other.Breed || + this.Breed != null && + this.Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.ClassName != null) + hash = hash * 59 + this.ClassName.GetHashCode(); + if (this.Color != null) + hash = hash * 59 + this.Color.GetHashCode(); + if (this.Breed != null) + hash = hash * 59 + this.Breed.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumArrays.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumArrays.cs new file mode 100644 index 00000000000..f5398244ab2 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumArrays.cs @@ -0,0 +1,202 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class EnumArrays : IEquatable + { + /// + /// Gets or Sets JustSymbol + /// + public enum JustSymbolEnum + { + + /// + /// Enum GreaterThanOrEqualTo for ">=" + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo, + + /// + /// Enum Dollar for "$" + /// + [EnumMember(Value = "$")] + Dollar + } + /// + /// Gets or Sets ArrayEnum + /// + public enum List<ArrayEnumEnum> + { + + /// + /// Enum FishEnum for "fish" + /// + [EnumMember(Value = "fish")] + FishEnum, + + /// + /// Enum CrabEnum for "crab" + /// + [EnumMember(Value = "crab")] + CrabEnum + } + /// + /// Gets or Sets ArrayEnum + /// + public enum ArrayEnumEnum + { + + /// + /// Enum FishEnum for "fish" + /// + [EnumMember(Value = "fish")] + FishEnum, + + /// + /// Enum CrabEnum for "crab" + /// + [EnumMember(Value = "crab")] + CrabEnum + } + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name="just_symbol")] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name="array_enum")] + public List ArrayEnum { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// JustSymbol. + /// ArrayEnum. + public EnumArrays(JustSymbolEnum? JustSymbol = default(JustSymbolEnum?), List ArrayEnum = default(List)) + { + this.JustSymbol = JustSymbol; + this.ArrayEnum = ArrayEnum; + + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((EnumArrays)obj); + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.JustSymbol == other.JustSymbol || + this.JustSymbol != null && + this.JustSymbol.Equals(other.JustSymbol) + ) && + ( + this.ArrayEnum == other.ArrayEnum || + this.ArrayEnum != null && + this.ArrayEnum.SequenceEqual(other.ArrayEnum) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.JustSymbol != null) + hash = hash * 59 + this.JustSymbol.GetHashCode(); + if (this.ArrayEnum != null) + hash = hash * 59 + this.ArrayEnum.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(EnumArrays left, EnumArrays right) + { + return Equals(left, right); + } + + public static bool operator !=(EnumArrays left, EnumArrays right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumClass.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumClass.cs new file mode 100644 index 00000000000..4c7a5d29cbb --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumClass.cs @@ -0,0 +1,46 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets EnumClass + /// + public enum EnumClass + { + + /// + /// Enum AbcEnum for "_abc" + /// + [EnumMember(Value = "_abc")] + AbcEnum, + + /// + /// Enum EfgEnum for "-efg" + /// + [EnumMember(Value = "-efg")] + EfgEnum, + + /// + /// Enum XyzEnum for "(xyz)" + /// + [EnumMember(Value = "(xyz)")] + XyzEnum + }} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumTest.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumTest.cs new file mode 100644 index 00000000000..42631007e61 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/EnumTest.cs @@ -0,0 +1,238 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class EnumTest : IEquatable + { + /// + /// Gets or Sets EnumString + /// + public enum EnumStringEnum + { + + /// + /// Enum UPPEREnum for "UPPER" + /// + [EnumMember(Value = "UPPER")] + UPPEREnum, + + /// + /// Enum LowerEnum for "lower" + /// + [EnumMember(Value = "lower")] + LowerEnum, + + /// + /// Enum Empty for "" + /// + [EnumMember(Value = "")] + Empty + } + /// + /// Gets or Sets EnumInteger + /// + public enum EnumIntegerEnum + { + + /// + /// Enum _1Enum for "1" + /// + [EnumMember(Value = ""1"")] + _1Enum = "1", + + /// + /// Enum _1Enum for "-1" + /// + [EnumMember(Value = ""-1"")] + _1Enum = "-1" + } + /// + /// Gets or Sets EnumNumber + /// + public enum EnumNumberEnum + { + + /// + /// Enum _11Enum for "1.1" + /// + [EnumMember(Value = ""1.1"")] + _11Enum, + + /// + /// Enum _12Enum for "-1.2" + /// + [EnumMember(Value = ""-1.2"")] + _12Enum + } + /// + /// Gets or Sets EnumString + /// + [DataMember(Name="enum_string")] + public EnumStringEnum? EnumString { get; set; } + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name="enum_integer")] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name="enum_number")] + public EnumNumberEnum? EnumNumber { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// EnumString. + /// EnumInteger. + /// EnumNumber. + /// OuterEnum. + public EnumTest(EnumStringEnum? EnumString = default(EnumStringEnum?), EnumIntegerEnum? EnumInteger = default(EnumIntegerEnum?), EnumNumberEnum? EnumNumber = default(EnumNumberEnum?), OuterEnum OuterEnum = default(OuterEnum)) + { + this.EnumString = EnumString; + this.EnumInteger = EnumInteger; + this.EnumNumber = EnumNumber; + this.OuterEnum = OuterEnum; + + } + + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name="outerEnum")] + public OuterEnum OuterEnum { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((EnumTest)obj); + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.EnumString == other.EnumString || + this.EnumString != null && + this.EnumString.Equals(other.EnumString) + ) && + ( + this.EnumInteger == other.EnumInteger || + this.EnumInteger != null && + this.EnumInteger.Equals(other.EnumInteger) + ) && + ( + this.EnumNumber == other.EnumNumber || + this.EnumNumber != null && + this.EnumNumber.Equals(other.EnumNumber) + ) && + ( + this.OuterEnum == other.OuterEnum || + this.OuterEnum != null && + this.OuterEnum.Equals(other.OuterEnum) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.EnumString != null) + hash = hash * 59 + this.EnumString.GetHashCode(); + if (this.EnumInteger != null) + hash = hash * 59 + this.EnumInteger.GetHashCode(); + if (this.EnumNumber != null) + hash = hash * 59 + this.EnumNumber.GetHashCode(); + if (this.OuterEnum != null) + hash = hash * 59 + this.OuterEnum.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(EnumTest left, EnumTest right) + { + return Equals(left, right); + } + + public static bool operator !=(EnumTest left, EnumTest right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/FormatTest.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/FormatTest.cs new file mode 100644 index 00000000000..6df814b35c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/FormatTest.cs @@ -0,0 +1,345 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class FormatTest : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// Integer. + /// Int32. + /// Int64. + /// Number (required). + /// Float. + /// Double. + /// String. + /// Byte (required). + /// Binary. + /// Date (required). + /// DateTime. + /// Uuid. + /// Password (required). + public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? Float = default(float?), double? Double = default(double?), string String = default(string), byte[] Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) + { + // to ensure "Number" is required (not null) + if (Number == null) + { + throw new InvalidDataException("Number is a required property for FormatTest and cannot be null"); + } + else + { + this.Number = Number; + } + // to ensure "Byte" is required (not null) + if (Byte == null) + { + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); + } + else + { + this.Byte = Byte; + } + // to ensure "Date" is required (not null) + if (Date == null) + { + throw new InvalidDataException("Date is a required property for FormatTest and cannot be null"); + } + else + { + this.Date = Date; + } + // to ensure "Password" is required (not null) + if (Password == null) + { + throw new InvalidDataException("Password is a required property for FormatTest and cannot be null"); + } + else + { + this.Password = Password; + } + this.Integer = Integer; + this.Int32 = Int32; + this.Int64 = Int64; + this.Float = Float; + this.Double = Double; + this.String = String; + this.Binary = Binary; + this.DateTime = DateTime; + this.Uuid = Uuid; + + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name="integer")] + public int? Integer { get; set; } + /// + /// Gets or Sets Int32 + /// + [DataMember(Name="int32")] + public int? Int32 { get; set; } + /// + /// Gets or Sets Int64 + /// + [DataMember(Name="int64")] + public long? Int64 { get; set; } + /// + /// Gets or Sets Number + /// + [DataMember(Name="number")] + public decimal? Number { get; set; } + /// + /// Gets or Sets Float + /// + [DataMember(Name="float")] + public float? Float { get; set; } + /// + /// Gets or Sets Double + /// + [DataMember(Name="double")] + public double? Double { get; set; } + /// + /// Gets or Sets String + /// + [DataMember(Name="string")] + public string String { get; set; } + /// + /// Gets or Sets Byte + /// + [DataMember(Name="byte")] + public byte[] Byte { get; set; } + /// + /// Gets or Sets Binary + /// + [DataMember(Name="binary")] + public byte[] Binary { get; set; } + /// + /// Gets or Sets Date + /// + [DataMember(Name="date")] + public DateTime? Date { get; set; } + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime")] + public DateTime? DateTime { get; set; } + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid")] + public Guid? Uuid { get; set; } + /// + /// Gets or Sets Password + /// + [DataMember(Name="password")] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((FormatTest)obj); + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.Integer == other.Integer || + this.Integer != null && + this.Integer.Equals(other.Integer) + ) && + ( + this.Int32 == other.Int32 || + this.Int32 != null && + this.Int32.Equals(other.Int32) + ) && + ( + this.Int64 == other.Int64 || + this.Int64 != null && + this.Int64.Equals(other.Int64) + ) && + ( + this.Number == other.Number || + this.Number != null && + this.Number.Equals(other.Number) + ) && + ( + this.Float == other.Float || + this.Float != null && + this.Float.Equals(other.Float) + ) && + ( + this.Double == other.Double || + this.Double != null && + this.Double.Equals(other.Double) + ) && + ( + this.String == other.String || + this.String != null && + this.String.Equals(other.String) + ) && + ( + this.Byte == other.Byte || + this.Byte != null && + this.Byte.Equals(other.Byte) + ) && + ( + this.Binary == other.Binary || + this.Binary != null && + this.Binary.Equals(other.Binary) + ) && + ( + this.Date == other.Date || + this.Date != null && + this.Date.Equals(other.Date) + ) && + ( + this.DateTime == other.DateTime || + this.DateTime != null && + this.DateTime.Equals(other.DateTime) + ) && + ( + this.Uuid == other.Uuid || + this.Uuid != null && + this.Uuid.Equals(other.Uuid) + ) && + ( + this.Password == other.Password || + this.Password != null && + this.Password.Equals(other.Password) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Integer != null) + hash = hash * 59 + this.Integer.GetHashCode(); + if (this.Int32 != null) + hash = hash * 59 + this.Int32.GetHashCode(); + if (this.Int64 != null) + hash = hash * 59 + this.Int64.GetHashCode(); + if (this.Number != null) + hash = hash * 59 + this.Number.GetHashCode(); + if (this.Float != null) + hash = hash * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hash = hash * 59 + this.Double.GetHashCode(); + if (this.String != null) + hash = hash * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hash = hash * 59 + this.Byte.GetHashCode(); + if (this.Binary != null) + hash = hash * 59 + this.Binary.GetHashCode(); + if (this.Date != null) + hash = hash * 59 + this.Date.GetHashCode(); + if (this.DateTime != null) + hash = hash * 59 + this.DateTime.GetHashCode(); + if (this.Uuid != null) + hash = hash * 59 + this.Uuid.GetHashCode(); + if (this.Password != null) + hash = hash * 59 + this.Password.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(FormatTest left, FormatTest right) + { + return Equals(left, right); + } + + public static bool operator !=(FormatTest left, FormatTest right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/HasOnlyReadOnly.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..823eba63e23 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/HasOnlyReadOnly.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class HasOnlyReadOnly : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// Bar. + /// Foo. + public HasOnlyReadOnly() + { + this.Bar = Bar; + this.Foo = Foo; + + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar")] + public string Bar { get; private set; } + /// + /// Gets or Sets Foo + /// + [DataMember(Name="foo")] + public string Foo { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((HasOnlyReadOnly)obj); + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.Bar == other.Bar || + this.Bar != null && + this.Bar.Equals(other.Bar) + ) && + ( + this.Foo == other.Foo || + this.Foo != null && + this.Foo.Equals(other.Foo) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Bar != null) + hash = hash * 59 + this.Bar.GetHashCode(); + if (this.Foo != null) + hash = hash * 59 + this.Foo.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(HasOnlyReadOnly left, HasOnlyReadOnly right) + { + return Equals(left, right); + } + + public static bool operator !=(HasOnlyReadOnly left, HasOnlyReadOnly right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/List.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/List.cs new file mode 100644 index 00000000000..d1edff16d2a --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/List.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class List : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// _123List. + public List(string _123List = default(string)) + { + this._123List = _123List; + + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name="123-list")] + public string _123List { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((List)obj); + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this._123List == other._123List || + this._123List != null && + this._123List.Equals(other._123List) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this._123List != null) + hash = hash * 59 + this._123List.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(List left, List right) + { + return Equals(left, right); + } + + public static bool operator !=(List left, List right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MapTest.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MapTest.cs new file mode 100644 index 00000000000..5998ff5fe74 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MapTest.cs @@ -0,0 +1,184 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class MapTest : IEquatable + { + /// + /// Gets or Sets MapOfEnumString + /// + public enum Dictionary<string, InnerEnum> + { + + /// + /// Enum UPPEREnum for "UPPER" + /// + [EnumMember(Value = "UPPER")] + UPPEREnum, + + /// + /// Enum LowerEnum for "lower" + /// + [EnumMember(Value = "lower")] + LowerEnum + } + /// + /// Gets or Sets Inner + /// + public enum InnerEnum + { + + /// + /// Enum UPPEREnum for "UPPER" + /// + [EnumMember(Value = "UPPER")] + UPPEREnum, + + /// + /// Enum LowerEnum for "lower" + /// + [EnumMember(Value = "lower")] + LowerEnum + } + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name="map_of_enum_string")] + public Dictionary MapOfEnumString { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// MapMapOfString. + /// MapOfEnumString. + public MapTest(Dictionary> MapMapOfString = default(Dictionary>), Dictionary MapOfEnumString = default(Dictionary)) + { + this.MapMapOfString = MapMapOfString; + this.MapOfEnumString = MapOfEnumString; + + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name="map_map_of_string")] + public Dictionary> MapMapOfString { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((MapTest)obj); + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.MapMapOfString == other.MapMapOfString || + this.MapMapOfString != null && + this.MapMapOfString.SequenceEqual(other.MapMapOfString) + ) && + ( + this.MapOfEnumString == other.MapOfEnumString || + this.MapOfEnumString != null && + this.MapOfEnumString.SequenceEqual(other.MapOfEnumString) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.MapMapOfString != null) + hash = hash * 59 + this.MapMapOfString.GetHashCode(); + if (this.MapOfEnumString != null) + hash = hash * 59 + this.MapOfEnumString.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(MapTest left, MapTest right) + { + return Equals(left, right); + } + + public static bool operator !=(MapTest left, MapTest right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..cc8dbf27d80 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,163 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// Uuid. + /// DateTime. + /// Map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = default(Guid?), DateTime? DateTime = default(DateTime?), Dictionary Map = default(Dictionary)) + { + this.Uuid = Uuid; + this.DateTime = DateTime; + this.Map = Map; + + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid")] + public Guid? Uuid { get; set; } + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime")] + public DateTime? DateTime { get; set; } + /// + /// Gets or Sets Map + /// + [DataMember(Name="map")] + public Dictionary Map { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((MixedPropertiesAndAdditionalPropertiesClass)obj); + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.Uuid == other.Uuid || + this.Uuid != null && + this.Uuid.Equals(other.Uuid) + ) && + ( + this.DateTime == other.DateTime || + this.DateTime != null && + this.DateTime.Equals(other.DateTime) + ) && + ( + this.Map == other.Map || + this.Map != null && + this.Map.SequenceEqual(other.Map) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Uuid != null) + hash = hash * 59 + this.Uuid.GetHashCode(); + if (this.DateTime != null) + hash = hash * 59 + this.DateTime.GetHashCode(); + if (this.Map != null) + hash = hash * 59 + this.Map.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(MixedPropertiesAndAdditionalPropertiesClass left, MixedPropertiesAndAdditionalPropertiesClass right) + { + return Equals(left, right); + } + + public static bool operator !=(MixedPropertiesAndAdditionalPropertiesClass left, MixedPropertiesAndAdditionalPropertiesClass right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Model200Response.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Model200Response.cs new file mode 100644 index 00000000000..a67b704d549 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Model200Response.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// Model for testing model name starting with number + /// + [DataContract] + public partial class Model200Response : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// Name. + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) + { + this.Name = Name; + this.Class = Class; + + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + public int? Name { get; set; } + /// + /// Gets or Sets Class + /// + [DataMember(Name="class")] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Model200Response)obj); + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.Name == other.Name || + this.Name != null && + this.Name.Equals(other.Name) + ) && + ( + this.Class == other.Class || + this.Class != null && + this.Class.Equals(other.Class) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Name != null) + hash = hash * 59 + this.Name.GetHashCode(); + if (this.Class != null) + hash = hash * 59 + this.Class.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Model200Response left, Model200Response right) + { + return Equals(left, right); + } + + public static bool operator !=(Model200Response left, Model200Response right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Name.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Name.cs new file mode 100644 index 00000000000..c9044a87dd6 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Name.cs @@ -0,0 +1,186 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// Model for testing model name same as property name + /// + [DataContract] + public partial class Name : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// _Name (required). + /// SnakeCase. + /// Property. + /// _123Number. + public Name(int? _Name = default(int?), string Property = default(string)) + { + // to ensure "_Name" is required (not null) + if (_Name == null) + { + throw new InvalidDataException("_Name is a required property for Name and cannot be null"); + } + else + { + this._Name = _Name; + } + this.SnakeCase = SnakeCase; + this.Property = Property; + this._123Number = _123Number; + + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name="name")] + public int? _Name { get; set; } + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name="snake_case")] + public int? SnakeCase { get; private set; } + /// + /// Gets or Sets Property + /// + [DataMember(Name="property")] + public string Property { get; set; } + /// + /// Gets or Sets _123Number + /// + [DataMember(Name="123Number")] + public int? _123Number { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Name)obj); + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this._Name == other._Name || + this._Name != null && + this._Name.Equals(other._Name) + ) && + ( + this.SnakeCase == other.SnakeCase || + this.SnakeCase != null && + this.SnakeCase.Equals(other.SnakeCase) + ) && + ( + this.Property == other.Property || + this.Property != null && + this.Property.Equals(other.Property) + ) && + ( + this._123Number == other._123Number || + this._123Number != null && + this._123Number.Equals(other._123Number) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this._Name != null) + hash = hash * 59 + this._Name.GetHashCode(); + if (this.SnakeCase != null) + hash = hash * 59 + this.SnakeCase.GetHashCode(); + if (this.Property != null) + hash = hash * 59 + this.Property.GetHashCode(); + if (this._123Number != null) + hash = hash * 59 + this._123Number.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Name left, Name right) + { + return Equals(left, right); + } + + public static bool operator !=(Name left, Name right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/NumberOnly.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/NumberOnly.cs new file mode 100644 index 00000000000..ccf85db48a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/NumberOnly.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class NumberOnly : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// JustNumber. + public NumberOnly(decimal? JustNumber = default(decimal?)) + { + this.JustNumber = JustNumber; + + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name="JustNumber")] + public decimal? JustNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((NumberOnly)obj); + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.JustNumber == other.JustNumber || + this.JustNumber != null && + this.JustNumber.Equals(other.JustNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.JustNumber != null) + hash = hash * 59 + this.JustNumber.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(NumberOnly left, NumberOnly right) + { + return Equals(left, right); + } + + public static bool operator !=(NumberOnly left, NumberOnly right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Order.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Order.cs index 7b3d9cf31c7..9f251242833 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Order.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Order.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -22,7 +22,7 @@ namespace IO.Swagger.Models { /// - /// An order for a pets from the pet store + /// /// [DataContract] public partial class Order : IEquatable diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/OuterEnum.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/OuterEnum.cs new file mode 100644 index 00000000000..2df83531cb2 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/OuterEnum.cs @@ -0,0 +1,46 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Gets or Sets OuterEnum + /// + public enum OuterEnum + { + + /// + /// Enum PlacedEnum for "placed" + /// + [EnumMember(Value = "placed")] + PlacedEnum, + + /// + /// Enum ApprovedEnum for "approved" + /// + [EnumMember(Value = "approved")] + ApprovedEnum, + + /// + /// Enum DeliveredEnum for "delivered" + /// + [EnumMember(Value = "delivered")] + DeliveredEnum + }} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Pet.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Pet.cs index a6454c61726..bb271e74f5f 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Pet.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -22,7 +22,7 @@ namespace IO.Swagger.Models { /// - /// A pet for sale in the pet store + /// /// [DataContract] public partial class Pet : IEquatable diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ReadOnlyFirst.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ReadOnlyFirst.cs new file mode 100644 index 00000000000..348edc1af6a --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/ReadOnlyFirst.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class ReadOnlyFirst : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// Bar. + /// Baz. + public ReadOnlyFirst(string Baz = default(string)) + { + this.Bar = Bar; + this.Baz = Baz; + + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar")] + public string Bar { get; private set; } + /// + /// Gets or Sets Baz + /// + [DataMember(Name="baz")] + public string Baz { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((ReadOnlyFirst)obj); + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.Bar == other.Bar || + this.Bar != null && + this.Bar.Equals(other.Bar) + ) && + ( + this.Baz == other.Baz || + this.Baz != null && + this.Baz.Equals(other.Baz) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Bar != null) + hash = hash * 59 + this.Bar.GetHashCode(); + if (this.Baz != null) + hash = hash * 59 + this.Baz.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(ReadOnlyFirst left, ReadOnlyFirst right) + { + return Equals(left, right); + } + + public static bool operator !=(ReadOnlyFirst left, ReadOnlyFirst right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Return.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Return.cs new file mode 100644 index 00000000000..90f8a080252 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Return.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return")] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((Return)obj); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this._Return == other._Return || + this._Return != null && + this._Return.Equals(other._Return) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this._Return != null) + hash = hash * 59 + this._Return.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(Return left, Return right) + { + return Equals(left, right); + } + + public static bool operator !=(Return left, Return right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/SpecialModelName.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/SpecialModelName.cs new file mode 100644 index 00000000000..58989baa7b1 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/SpecialModelName.cs @@ -0,0 +1,133 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + + /// + /// + /// + [DataContract] + public partial class SpecialModelName : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// + /// SpecialPropertyName. + public SpecialModelName(long? SpecialPropertyName = default(long?)) + { + this.SpecialPropertyName = SpecialPropertyName; + + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name="$special[property.name]")] + public long? SpecialPropertyName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((SpecialModelName)obj); + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName other) + { + + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + this.SpecialPropertyName == other.SpecialPropertyName || + this.SpecialPropertyName != null && + this.SpecialPropertyName.Equals(other.SpecialPropertyName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.SpecialPropertyName != null) + hash = hash * 59 + this.SpecialPropertyName.GetHashCode(); + return hash; + } + } + + #region Operators + + public static bool operator ==(SpecialModelName left, SpecialModelName right) + { + return Equals(left, right); + } + + public static bool operator !=(SpecialModelName left, SpecialModelName right) + { + return !Equals(left, right); + } + + #endregion Operators + + } +} diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Tag.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Tag.cs index ea2ca1d6c1e..7ee3445388d 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Tag.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/Tag.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -22,7 +22,7 @@ namespace IO.Swagger.Models { /// - /// A tag for a pet + /// /// [DataContract] public partial class Tag : IEquatable diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/User.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/User.cs index 54b0a00d989..76289531a41 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/User.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Models/User.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -22,7 +22,7 @@ namespace IO.Swagger.Models { /// - /// A User who is purchasing from the pet store + /// /// [DataContract] public partial class User : IEquatable diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs index 43438ff0582..45a815b83c1 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs @@ -1,7 +1,7 @@ /* * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io diff --git a/samples/server/petstore/nancyfx/IO.Swagger.sln b/samples/server/petstore/nancyfx/IO.Swagger.sln index 1e40deb1a14..f4355ee96ca 100644 --- a/samples/server/petstore/nancyfx/IO.Swagger.sln +++ b/samples/server/petstore/nancyfx/IO.Swagger.sln @@ -2,7 +2,7 @@ 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}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{5F69BBC5-88E4-441F-8DA0-5542C8530751}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU +{5F69BBC5-88E4-441F-8DA0-5542C8530751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{5F69BBC5-88E4-441F-8DA0-5542C8530751}.Debug|Any CPU.Build.0 = Debug|Any CPU +{5F69BBC5-88E4-441F-8DA0-5542C8530751}.Release|Any CPU.ActiveCfg = Release|Any CPU +{5F69BBC5-88E4-441F-8DA0-5542C8530751}.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 diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj index e1577197b6f..e17af9d4d94 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - {768B8DC6-54EE-4D40-9B20-7857E1D742A4} + {5F69BBC5-88E4-441F-8DA0-5542C8530751} Library Properties IO.Swagger.v2 diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/AdditionalPropertiesClass.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..de6ba6141a8 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/AdditionalPropertiesClass.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// AdditionalPropertiesClass + /// + public sealed class AdditionalPropertiesClass: IEquatable + { + /// + /// MapProperty + /// + public Dictionary MapProperty { get; private set; } + + /// + /// MapOfMapProperty + /// + public Dictionary> MapOfMapProperty { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use AdditionalPropertiesClass.Builder() for instance creation instead. + /// + [Obsolete] + public AdditionalPropertiesClass() + { + } + + private AdditionalPropertiesClass(Dictionary MapProperty, Dictionary> MapOfMapProperty) + { + + this.MapProperty = MapProperty; + + this.MapOfMapProperty = MapOfMapProperty; + + } + + /// + /// Returns builder of AdditionalPropertiesClass. + /// + /// AdditionalPropertiesClassBuilder + public static AdditionalPropertiesClassBuilder Builder() + { + return new AdditionalPropertiesClassBuilder(); + } + + /// + /// Returns AdditionalPropertiesClassBuilder with properties set. + /// Use it to change properties. + /// + /// AdditionalPropertiesClassBuilder + public AdditionalPropertiesClassBuilder With() + { + return Builder() + .MapProperty(MapProperty) + .MapOfMapProperty(MapOfMapProperty); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(AdditionalPropertiesClass other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (AdditionalPropertiesClass. + /// + /// Compared (AdditionalPropertiesClass + /// Compared (AdditionalPropertiesClass + /// true if compared items are equals, false otherwise + public static bool operator == (AdditionalPropertiesClass left, AdditionalPropertiesClass right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (AdditionalPropertiesClass. + /// + /// Compared (AdditionalPropertiesClass + /// Compared (AdditionalPropertiesClass + /// true if compared items are not equals, false otherwise + public static bool operator != (AdditionalPropertiesClass left, AdditionalPropertiesClass right) + { + return !Equals(left, right); + } + + /// + /// Builder of AdditionalPropertiesClass. + /// + public sealed class AdditionalPropertiesClassBuilder + { + private Dictionary _MapProperty; + private Dictionary> _MapOfMapProperty; + + internal AdditionalPropertiesClassBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for AdditionalPropertiesClass.MapProperty property. + /// + /// MapProperty + public AdditionalPropertiesClassBuilder MapProperty(Dictionary value) + { + _MapProperty = value; + return this; + } + + /// + /// Sets value for AdditionalPropertiesClass.MapOfMapProperty property. + /// + /// MapOfMapProperty + public AdditionalPropertiesClassBuilder MapOfMapProperty(Dictionary> value) + { + _MapOfMapProperty = value; + return this; + } + + + /// + /// Builds instance of AdditionalPropertiesClass. + /// + /// AdditionalPropertiesClass + public AdditionalPropertiesClass Build() + { + Validate(); + return new AdditionalPropertiesClass( + MapProperty: _MapProperty, + MapOfMapProperty: _MapOfMapProperty + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Animal.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Animal.cs new file mode 100644 index 00000000000..d2bb86516fa --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Animal.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Animal + /// + public class Animal: IEquatable + { + /// + /// ClassName + /// + public string ClassName { get; private set; } + + /// + /// Color + /// + public string Color { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Animal.Builder() for instance creation instead. + /// + [Obsolete] + public Animal() + { + } + + protected Animal(string ClassName, string Color) + { + + this.ClassName = ClassName; + + this.Color = Color; + + } + + /// + /// Returns builder of Animal. + /// + /// AnimalBuilder + public static AnimalBuilder Builder() + { + return new AnimalBuilder(); + } + + /// + /// Returns AnimalBuilder with properties set. + /// Use it to change properties. + /// + /// AnimalBuilder + public AnimalBuilder With() + { + return Builder() + .ClassName(ClassName) + .Color(Color); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Animal other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Animal. + /// + /// Compared (Animal + /// Compared (Animal + /// true if compared items are equals, false otherwise + public static bool operator == (Animal left, Animal right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Animal. + /// + /// Compared (Animal + /// Compared (Animal + /// true if compared items are not equals, false otherwise + public static bool operator != (Animal left, Animal right) + { + return !Equals(left, right); + } + + /// + /// Builder of Animal. + /// + public sealed class AnimalBuilder + { + private string _ClassName; + private string _Color; + + internal AnimalBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + _Color = "red"; + } + + /// + /// Sets value for Animal.ClassName property. + /// + /// ClassName + public AnimalBuilder ClassName(string value) + { + _ClassName = value; + return this; + } + + /// + /// Sets value for Animal.Color property. + /// + /// Color + public AnimalBuilder Color(string value) + { + _Color = value; + return this; + } + + + /// + /// Builds instance of Animal. + /// + /// Animal + public Animal Build() + { + Validate(); + return new Animal( + ClassName: _ClassName, + Color: _Color + ); + } + + private void Validate() + { + if (_ClassName == null) + { + throw new ArgumentException("ClassName is a required property for Animal and cannot be null"); + } + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/AnimalFarm.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/AnimalFarm.cs new file mode 100644 index 00000000000..dbe268ff7b7 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/AnimalFarm.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// AnimalFarm + /// + public sealed class AnimalFarm: List, IEquatable + { + + /// + /// Empty constructor required by some serializers. + /// Use AnimalFarm.Builder() for instance creation instead. + /// + [Obsolete] + public AnimalFarm() : base() + { + } + + private AnimalFarm() : base() + { + + } + + /// + /// Returns builder of AnimalFarm. + /// + /// AnimalFarmBuilder + public static new AnimalFarmBuilder Builder() + { + return new AnimalFarmBuilder(); + } + + /// + /// Returns AnimalFarmBuilder with properties set. + /// Use it to change properties. + /// + /// AnimalFarmBuilder + public new AnimalFarmBuilder With() + { + return Builder() +; + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(AnimalFarm other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (AnimalFarm. + /// + /// Compared (AnimalFarm + /// Compared (AnimalFarm + /// true if compared items are equals, false otherwise + public static bool operator == (AnimalFarm left, AnimalFarm right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (AnimalFarm. + /// + /// Compared (AnimalFarm + /// Compared (AnimalFarm + /// true if compared items are not equals, false otherwise + public static bool operator != (AnimalFarm left, AnimalFarm right) + { + return !Equals(left, right); + } + + /// + /// Builder of AnimalFarm. + /// + public sealed class AnimalFarmBuilder + { + + internal AnimalFarmBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + + /// + /// Builds instance of AnimalFarm. + /// + /// AnimalFarm + public AnimalFarm Build() + { + Validate(); + return new AnimalFarm( + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ApiResponse.cs index 3b8ad566af8..8eb40938412 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ApiResponse.cs @@ -8,7 +8,7 @@ namespace IO.Swagger.v2.Models { /// - /// Describes the result of uploading an image resource + /// ApiResponse /// public sealed class ApiResponse: IEquatable { diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..d69ab31cf9b --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + public sealed class ArrayOfArrayOfNumberOnly: IEquatable + { + /// + /// ArrayArrayNumber + /// + public List> ArrayArrayNumber { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ArrayOfArrayOfNumberOnly.Builder() for instance creation instead. + /// + [Obsolete] + public ArrayOfArrayOfNumberOnly() + { + } + + private ArrayOfArrayOfNumberOnly(List> ArrayArrayNumber) + { + + this.ArrayArrayNumber = ArrayArrayNumber; + + } + + /// + /// Returns builder of ArrayOfArrayOfNumberOnly. + /// + /// ArrayOfArrayOfNumberOnlyBuilder + public static ArrayOfArrayOfNumberOnlyBuilder Builder() + { + return new ArrayOfArrayOfNumberOnlyBuilder(); + } + + /// + /// Returns ArrayOfArrayOfNumberOnlyBuilder with properties set. + /// Use it to change properties. + /// + /// ArrayOfArrayOfNumberOnlyBuilder + public ArrayOfArrayOfNumberOnlyBuilder With() + { + return Builder() + .ArrayArrayNumber(ArrayArrayNumber); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ArrayOfArrayOfNumberOnly other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ArrayOfArrayOfNumberOnly. + /// + /// Compared (ArrayOfArrayOfNumberOnly + /// Compared (ArrayOfArrayOfNumberOnly + /// true if compared items are equals, false otherwise + public static bool operator == (ArrayOfArrayOfNumberOnly left, ArrayOfArrayOfNumberOnly right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ArrayOfArrayOfNumberOnly. + /// + /// Compared (ArrayOfArrayOfNumberOnly + /// Compared (ArrayOfArrayOfNumberOnly + /// true if compared items are not equals, false otherwise + public static bool operator != (ArrayOfArrayOfNumberOnly left, ArrayOfArrayOfNumberOnly right) + { + return !Equals(left, right); + } + + /// + /// Builder of ArrayOfArrayOfNumberOnly. + /// + public sealed class ArrayOfArrayOfNumberOnlyBuilder + { + private List> _ArrayArrayNumber; + + internal ArrayOfArrayOfNumberOnlyBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ArrayOfArrayOfNumberOnly.ArrayArrayNumber property. + /// + /// ArrayArrayNumber + public ArrayOfArrayOfNumberOnlyBuilder ArrayArrayNumber(List> value) + { + _ArrayArrayNumber = value; + return this; + } + + + /// + /// Builds instance of ArrayOfArrayOfNumberOnly. + /// + /// ArrayOfArrayOfNumberOnly + public ArrayOfArrayOfNumberOnly Build() + { + Validate(); + return new ArrayOfArrayOfNumberOnly( + ArrayArrayNumber: _ArrayArrayNumber + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfNumberOnly.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..96209f1b341 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayOfNumberOnly.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// ArrayOfNumberOnly + /// + public sealed class ArrayOfNumberOnly: IEquatable + { + /// + /// ArrayNumber + /// + public List ArrayNumber { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ArrayOfNumberOnly.Builder() for instance creation instead. + /// + [Obsolete] + public ArrayOfNumberOnly() + { + } + + private ArrayOfNumberOnly(List ArrayNumber) + { + + this.ArrayNumber = ArrayNumber; + + } + + /// + /// Returns builder of ArrayOfNumberOnly. + /// + /// ArrayOfNumberOnlyBuilder + public static ArrayOfNumberOnlyBuilder Builder() + { + return new ArrayOfNumberOnlyBuilder(); + } + + /// + /// Returns ArrayOfNumberOnlyBuilder with properties set. + /// Use it to change properties. + /// + /// ArrayOfNumberOnlyBuilder + public ArrayOfNumberOnlyBuilder With() + { + return Builder() + .ArrayNumber(ArrayNumber); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ArrayOfNumberOnly other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ArrayOfNumberOnly. + /// + /// Compared (ArrayOfNumberOnly + /// Compared (ArrayOfNumberOnly + /// true if compared items are equals, false otherwise + public static bool operator == (ArrayOfNumberOnly left, ArrayOfNumberOnly right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ArrayOfNumberOnly. + /// + /// Compared (ArrayOfNumberOnly + /// Compared (ArrayOfNumberOnly + /// true if compared items are not equals, false otherwise + public static bool operator != (ArrayOfNumberOnly left, ArrayOfNumberOnly right) + { + return !Equals(left, right); + } + + /// + /// Builder of ArrayOfNumberOnly. + /// + public sealed class ArrayOfNumberOnlyBuilder + { + private List _ArrayNumber; + + internal ArrayOfNumberOnlyBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ArrayOfNumberOnly.ArrayNumber property. + /// + /// ArrayNumber + public ArrayOfNumberOnlyBuilder ArrayNumber(List value) + { + _ArrayNumber = value; + return this; + } + + + /// + /// Builds instance of ArrayOfNumberOnly. + /// + /// ArrayOfNumberOnly + public ArrayOfNumberOnly Build() + { + Validate(); + return new ArrayOfNumberOnly( + ArrayNumber: _ArrayNumber + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayTest.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayTest.cs new file mode 100644 index 00000000000..80725712486 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ArrayTest.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// ArrayTest + /// + public sealed class ArrayTest: IEquatable + { + /// + /// ArrayOfString + /// + public List ArrayOfString { get; private set; } + + /// + /// ArrayArrayOfInteger + /// + public List> ArrayArrayOfInteger { get; private set; } + + /// + /// ArrayArrayOfModel + /// + public List> ArrayArrayOfModel { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ArrayTest.Builder() for instance creation instead. + /// + [Obsolete] + public ArrayTest() + { + } + + private ArrayTest(List ArrayOfString, List> ArrayArrayOfInteger, List> ArrayArrayOfModel) + { + + this.ArrayOfString = ArrayOfString; + + this.ArrayArrayOfInteger = ArrayArrayOfInteger; + + this.ArrayArrayOfModel = ArrayArrayOfModel; + + } + + /// + /// Returns builder of ArrayTest. + /// + /// ArrayTestBuilder + public static ArrayTestBuilder Builder() + { + return new ArrayTestBuilder(); + } + + /// + /// Returns ArrayTestBuilder with properties set. + /// Use it to change properties. + /// + /// ArrayTestBuilder + public ArrayTestBuilder With() + { + return Builder() + .ArrayOfString(ArrayOfString) + .ArrayArrayOfInteger(ArrayArrayOfInteger) + .ArrayArrayOfModel(ArrayArrayOfModel); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ArrayTest other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ArrayTest. + /// + /// Compared (ArrayTest + /// Compared (ArrayTest + /// true if compared items are equals, false otherwise + public static bool operator == (ArrayTest left, ArrayTest right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ArrayTest. + /// + /// Compared (ArrayTest + /// Compared (ArrayTest + /// true if compared items are not equals, false otherwise + public static bool operator != (ArrayTest left, ArrayTest right) + { + return !Equals(left, right); + } + + /// + /// Builder of ArrayTest. + /// + public sealed class ArrayTestBuilder + { + private List _ArrayOfString; + private List> _ArrayArrayOfInteger; + private List> _ArrayArrayOfModel; + + internal ArrayTestBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ArrayTest.ArrayOfString property. + /// + /// ArrayOfString + public ArrayTestBuilder ArrayOfString(List value) + { + _ArrayOfString = value; + return this; + } + + /// + /// Sets value for ArrayTest.ArrayArrayOfInteger property. + /// + /// ArrayArrayOfInteger + public ArrayTestBuilder ArrayArrayOfInteger(List> value) + { + _ArrayArrayOfInteger = value; + return this; + } + + /// + /// Sets value for ArrayTest.ArrayArrayOfModel property. + /// + /// ArrayArrayOfModel + public ArrayTestBuilder ArrayArrayOfModel(List> value) + { + _ArrayArrayOfModel = value; + return this; + } + + + /// + /// Builds instance of ArrayTest. + /// + /// ArrayTest + public ArrayTest Build() + { + Validate(); + return new ArrayTest( + ArrayOfString: _ArrayOfString, + ArrayArrayOfInteger: _ArrayArrayOfInteger, + ArrayArrayOfModel: _ArrayArrayOfModel + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Capitalization.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Capitalization.cs new file mode 100644 index 00000000000..774352cae81 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Capitalization.cs @@ -0,0 +1,245 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Capitalization + /// + public sealed class Capitalization: IEquatable + { + /// + /// SmallCamel + /// + public string SmallCamel { get; private set; } + + /// + /// CapitalCamel + /// + public string CapitalCamel { get; private set; } + + /// + /// SmallSnake + /// + public string SmallSnake { get; private set; } + + /// + /// CapitalSnake + /// + public string CapitalSnake { get; private set; } + + /// + /// SCAETHFlowPoints + /// + public string SCAETHFlowPoints { get; private set; } + + /// + /// Name of the pet + /// + public string ATT_NAME { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Capitalization.Builder() for instance creation instead. + /// + [Obsolete] + public Capitalization() + { + } + + private Capitalization(string SmallCamel, string CapitalCamel, string SmallSnake, string CapitalSnake, string SCAETHFlowPoints, string ATT_NAME) + { + + this.SmallCamel = SmallCamel; + + this.CapitalCamel = CapitalCamel; + + this.SmallSnake = SmallSnake; + + this.CapitalSnake = CapitalSnake; + + this.SCAETHFlowPoints = SCAETHFlowPoints; + + this.ATT_NAME = ATT_NAME; + + } + + /// + /// Returns builder of Capitalization. + /// + /// CapitalizationBuilder + public static CapitalizationBuilder Builder() + { + return new CapitalizationBuilder(); + } + + /// + /// Returns CapitalizationBuilder with properties set. + /// Use it to change properties. + /// + /// CapitalizationBuilder + public CapitalizationBuilder With() + { + return Builder() + .SmallCamel(SmallCamel) + .CapitalCamel(CapitalCamel) + .SmallSnake(SmallSnake) + .CapitalSnake(CapitalSnake) + .SCAETHFlowPoints(SCAETHFlowPoints) + .ATT_NAME(ATT_NAME); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Capitalization other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Capitalization. + /// + /// Compared (Capitalization + /// Compared (Capitalization + /// true if compared items are equals, false otherwise + public static bool operator == (Capitalization left, Capitalization right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Capitalization. + /// + /// Compared (Capitalization + /// Compared (Capitalization + /// true if compared items are not equals, false otherwise + public static bool operator != (Capitalization left, Capitalization right) + { + return !Equals(left, right); + } + + /// + /// Builder of Capitalization. + /// + public sealed class CapitalizationBuilder + { + private string _SmallCamel; + private string _CapitalCamel; + private string _SmallSnake; + private string _CapitalSnake; + private string _SCAETHFlowPoints; + private string _ATT_NAME; + + internal CapitalizationBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Capitalization.SmallCamel property. + /// + /// SmallCamel + public CapitalizationBuilder SmallCamel(string value) + { + _SmallCamel = value; + return this; + } + + /// + /// Sets value for Capitalization.CapitalCamel property. + /// + /// CapitalCamel + public CapitalizationBuilder CapitalCamel(string value) + { + _CapitalCamel = value; + return this; + } + + /// + /// Sets value for Capitalization.SmallSnake property. + /// + /// SmallSnake + public CapitalizationBuilder SmallSnake(string value) + { + _SmallSnake = value; + return this; + } + + /// + /// Sets value for Capitalization.CapitalSnake property. + /// + /// CapitalSnake + public CapitalizationBuilder CapitalSnake(string value) + { + _CapitalSnake = value; + return this; + } + + /// + /// Sets value for Capitalization.SCAETHFlowPoints property. + /// + /// SCAETHFlowPoints + public CapitalizationBuilder SCAETHFlowPoints(string value) + { + _SCAETHFlowPoints = value; + return this; + } + + /// + /// Sets value for Capitalization.ATT_NAME property. + /// + /// Name of the pet + public CapitalizationBuilder ATT_NAME(string value) + { + _ATT_NAME = value; + return this; + } + + + /// + /// Builds instance of Capitalization. + /// + /// Capitalization + public Capitalization Build() + { + Validate(); + return new Capitalization( + SmallCamel: _SmallCamel, + CapitalCamel: _CapitalCamel, + SmallSnake: _SmallSnake, + CapitalSnake: _CapitalSnake, + SCAETHFlowPoints: _SCAETHFlowPoints, + ATT_NAME: _ATT_NAME + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Cat.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Cat.cs new file mode 100644 index 00000000000..efc8048abf0 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Cat.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Cat + /// + public sealed class Cat: Animal, IEquatable + { + /// + /// Declawed + /// + public bool? Declawed { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Cat.Builder() for instance creation instead. + /// + [Obsolete] + public Cat() : base(null, null) + { + } + + private Cat(string ClassName, string Color, bool? Declawed) : base(ClassName, Color) + { + + this.Declawed = Declawed; + + } + + /// + /// Returns builder of Cat. + /// + /// CatBuilder + public static new CatBuilder Builder() + { + return new CatBuilder(); + } + + /// + /// Returns CatBuilder with properties set. + /// Use it to change properties. + /// + /// CatBuilder + public new CatBuilder With() + { + return Builder() + .ClassName(ClassName) + .Color(Color) + .Declawed(Declawed); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Cat other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Cat. + /// + /// Compared (Cat + /// Compared (Cat + /// true if compared items are equals, false otherwise + public static bool operator == (Cat left, Cat right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Cat. + /// + /// Compared (Cat + /// Compared (Cat + /// true if compared items are not equals, false otherwise + public static bool operator != (Cat left, Cat right) + { + return !Equals(left, right); + } + + /// + /// Builder of Cat. + /// + public sealed class CatBuilder + { + private string _ClassName; + private string _Color; + private bool? _Declawed; + + internal CatBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + _Color = "red"; + } + + /// + /// Sets value for Cat.ClassName property. + /// + /// ClassName + public CatBuilder ClassName(string value) + { + _ClassName = value; + return this; + } + + /// + /// Sets value for Cat.Color property. + /// + /// Color + public CatBuilder Color(string value) + { + _Color = value; + return this; + } + + /// + /// Sets value for Cat.Declawed property. + /// + /// Declawed + public CatBuilder Declawed(bool? value) + { + _Declawed = value; + return this; + } + + + /// + /// Builds instance of Cat. + /// + /// Cat + public Cat Build() + { + Validate(); + return new Cat( + ClassName: _ClassName, + Color: _Color, + Declawed: _Declawed + ); + } + + private void Validate() + { + if (_ClassName == null) + { + throw new ArgumentException("ClassName is a required property for Cat and cannot be null"); + } + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Category.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Category.cs index c6089446e51..759bedd74a9 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Category.cs @@ -8,7 +8,7 @@ namespace IO.Swagger.v2.Models { /// - /// A category for a pet + /// Category /// public sealed class Category: IEquatable { diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ClassModel.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ClassModel.cs new file mode 100644 index 00000000000..ab82d81c612 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ClassModel.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Model for testing model with \"_class\" property + /// + public sealed class ClassModel: IEquatable + { + /// + /// Class + /// + public string Class { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ClassModel.Builder() for instance creation instead. + /// + [Obsolete] + public ClassModel() + { + } + + private ClassModel(string Class) + { + + this.Class = Class; + + } + + /// + /// Returns builder of ClassModel. + /// + /// ClassModelBuilder + public static ClassModelBuilder Builder() + { + return new ClassModelBuilder(); + } + + /// + /// Returns ClassModelBuilder with properties set. + /// Use it to change properties. + /// + /// ClassModelBuilder + public ClassModelBuilder With() + { + return Builder() + .Class(Class); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ClassModel other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ClassModel. + /// + /// Compared (ClassModel + /// Compared (ClassModel + /// true if compared items are equals, false otherwise + public static bool operator == (ClassModel left, ClassModel right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ClassModel. + /// + /// Compared (ClassModel + /// Compared (ClassModel + /// true if compared items are not equals, false otherwise + public static bool operator != (ClassModel left, ClassModel right) + { + return !Equals(left, right); + } + + /// + /// Builder of ClassModel. + /// + public sealed class ClassModelBuilder + { + private string _Class; + + internal ClassModelBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ClassModel.Class property. + /// + /// Class + public ClassModelBuilder Class(string value) + { + _Class = value; + return this; + } + + + /// + /// Builds instance of ClassModel. + /// + /// ClassModel + public ClassModel Build() + { + Validate(); + return new ClassModel( + Class: _Class + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Client.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Client.cs new file mode 100644 index 00000000000..60d0fbb61be --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Client.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Client + /// + public sealed class Client: IEquatable + { + /// + /// _Client + /// + public string _Client { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Client.Builder() for instance creation instead. + /// + [Obsolete] + public Client() + { + } + + private Client(string _Client) + { + + this._Client = _Client; + + } + + /// + /// Returns builder of Client. + /// + /// ClientBuilder + public static ClientBuilder Builder() + { + return new ClientBuilder(); + } + + /// + /// Returns ClientBuilder with properties set. + /// Use it to change properties. + /// + /// ClientBuilder + public ClientBuilder With() + { + return Builder() + ._Client(_Client); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Client other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Client. + /// + /// Compared (Client + /// Compared (Client + /// true if compared items are equals, false otherwise + public static bool operator == (Client left, Client right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Client. + /// + /// Compared (Client + /// Compared (Client + /// true if compared items are not equals, false otherwise + public static bool operator != (Client left, Client right) + { + return !Equals(left, right); + } + + /// + /// Builder of Client. + /// + public sealed class ClientBuilder + { + private string __Client; + + internal ClientBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Client._Client property. + /// + /// _Client + public ClientBuilder _Client(string value) + { + __Client = value; + return this; + } + + + /// + /// Builds instance of Client. + /// + /// Client + public Client Build() + { + Validate(); + return new Client( + _Client: __Client + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Dog.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Dog.cs new file mode 100644 index 00000000000..63c7083c080 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Dog.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Dog + /// + public sealed class Dog: Animal, IEquatable + { + /// + /// Breed + /// + public string Breed { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Dog.Builder() for instance creation instead. + /// + [Obsolete] + public Dog() : base(null, null) + { + } + + private Dog(string ClassName, string Color, string Breed) : base(ClassName, Color) + { + + this.Breed = Breed; + + } + + /// + /// Returns builder of Dog. + /// + /// DogBuilder + public static new DogBuilder Builder() + { + return new DogBuilder(); + } + + /// + /// Returns DogBuilder with properties set. + /// Use it to change properties. + /// + /// DogBuilder + public new DogBuilder With() + { + return Builder() + .ClassName(ClassName) + .Color(Color) + .Breed(Breed); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Dog other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Dog. + /// + /// Compared (Dog + /// Compared (Dog + /// true if compared items are equals, false otherwise + public static bool operator == (Dog left, Dog right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Dog. + /// + /// Compared (Dog + /// Compared (Dog + /// true if compared items are not equals, false otherwise + public static bool operator != (Dog left, Dog right) + { + return !Equals(left, right); + } + + /// + /// Builder of Dog. + /// + public sealed class DogBuilder + { + private string _ClassName; + private string _Color; + private string _Breed; + + internal DogBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + _Color = "red"; + } + + /// + /// Sets value for Dog.ClassName property. + /// + /// ClassName + public DogBuilder ClassName(string value) + { + _ClassName = value; + return this; + } + + /// + /// Sets value for Dog.Color property. + /// + /// Color + public DogBuilder Color(string value) + { + _Color = value; + return this; + } + + /// + /// Sets value for Dog.Breed property. + /// + /// Breed + public DogBuilder Breed(string value) + { + _Breed = value; + return this; + } + + + /// + /// Builds instance of Dog. + /// + /// Dog + public Dog Build() + { + Validate(); + return new Dog( + ClassName: _ClassName, + Color: _Color, + Breed: _Breed + ); + } + + private void Validate() + { + if (_ClassName == null) + { + throw new ArgumentException("ClassName is a required property for Dog and cannot be null"); + } + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumArrays.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumArrays.cs new file mode 100644 index 00000000000..285e8150d53 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumArrays.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// EnumArrays + /// + public sealed class EnumArrays: IEquatable + { + /// + /// JustSymbol + /// + public JustSymbolEnum? JustSymbol { get; private set; } + + /// + /// ArrayEnum + /// + public List? ArrayEnum { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use EnumArrays.Builder() for instance creation instead. + /// + [Obsolete] + public EnumArrays() + { + } + + private EnumArrays(JustSymbolEnum? JustSymbol, List? ArrayEnum) + { + + this.JustSymbol = JustSymbol; + + this.ArrayEnum = ArrayEnum; + + } + + /// + /// Returns builder of EnumArrays. + /// + /// EnumArraysBuilder + public static EnumArraysBuilder Builder() + { + return new EnumArraysBuilder(); + } + + /// + /// Returns EnumArraysBuilder with properties set. + /// Use it to change properties. + /// + /// EnumArraysBuilder + public EnumArraysBuilder With() + { + return Builder() + .JustSymbol(JustSymbol) + .ArrayEnum(ArrayEnum); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(EnumArrays other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (EnumArrays. + /// + /// Compared (EnumArrays + /// Compared (EnumArrays + /// true if compared items are equals, false otherwise + public static bool operator == (EnumArrays left, EnumArrays right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (EnumArrays. + /// + /// Compared (EnumArrays + /// Compared (EnumArrays + /// true if compared items are not equals, false otherwise + public static bool operator != (EnumArrays left, EnumArrays right) + { + return !Equals(left, right); + } + + /// + /// Builder of EnumArrays. + /// + public sealed class EnumArraysBuilder + { + private JustSymbolEnum? _JustSymbol; + private List? _ArrayEnum; + + internal EnumArraysBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for EnumArrays.JustSymbol property. + /// + /// JustSymbol + public EnumArraysBuilder JustSymbol(JustSymbolEnum? value) + { + _JustSymbol = value; + return this; + } + + /// + /// Sets value for EnumArrays.ArrayEnum property. + /// + /// ArrayEnum + public EnumArraysBuilder ArrayEnum(List? value) + { + _ArrayEnum = value; + return this; + } + + + /// + /// Builds instance of EnumArrays. + /// + /// EnumArrays + public EnumArrays Build() + { + Validate(); + return new EnumArrays( + JustSymbol: _JustSymbol, + ArrayEnum: _ArrayEnum + ); + } + + private void Validate() + { + } + } + + + public enum JustSymbolEnum { , Value }; + public enum List<ArrayEnumEnum> { Fish, Crab }; + public enum ArrayEnumEnum { Fish, Crab }; + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumClass.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumClass.cs new file mode 100644 index 00000000000..c065b041250 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumClass.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// EnumClass + /// + public sealed class EnumClass: IEquatable + { + + /// + /// Empty constructor required by some serializers. + /// Use EnumClass.Builder() for instance creation instead. + /// + [Obsolete] + public EnumClass() + { + } + + private EnumClass() + { + + } + + /// + /// Returns builder of EnumClass. + /// + /// EnumClassBuilder + public static EnumClassBuilder Builder() + { + return new EnumClassBuilder(); + } + + /// + /// Returns EnumClassBuilder with properties set. + /// Use it to change properties. + /// + /// EnumClassBuilder + public EnumClassBuilder With() + { + return Builder() +; + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(EnumClass other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (EnumClass. + /// + /// Compared (EnumClass + /// Compared (EnumClass + /// true if compared items are equals, false otherwise + public static bool operator == (EnumClass left, EnumClass right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (EnumClass. + /// + /// Compared (EnumClass + /// Compared (EnumClass + /// true if compared items are not equals, false otherwise + public static bool operator != (EnumClass left, EnumClass right) + { + return !Equals(left, right); + } + + /// + /// Builder of EnumClass. + /// + public sealed class EnumClassBuilder + { + + internal EnumClassBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + + /// + /// Builds instance of EnumClass. + /// + /// EnumClass + public EnumClass Build() + { + Validate(); + return new EnumClass( + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumTest.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumTest.cs new file mode 100644 index 00000000000..39a6b54a31c --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/EnumTest.cs @@ -0,0 +1,208 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// EnumTest + /// + public sealed class EnumTest: IEquatable + { + /// + /// EnumString + /// + public EnumStringEnum? EnumString { get; private set; } + + /// + /// EnumInteger + /// + public EnumIntegerEnum? EnumInteger { get; private set; } + + /// + /// EnumNumber + /// + public EnumNumberEnum? EnumNumber { get; private set; } + + /// + /// OuterEnum + /// + public OuterEnum OuterEnum { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use EnumTest.Builder() for instance creation instead. + /// + [Obsolete] + public EnumTest() + { + } + + private EnumTest(EnumStringEnum? EnumString, EnumIntegerEnum? EnumInteger, EnumNumberEnum? EnumNumber, OuterEnum OuterEnum) + { + + this.EnumString = EnumString; + + this.EnumInteger = EnumInteger; + + this.EnumNumber = EnumNumber; + + this.OuterEnum = OuterEnum; + + } + + /// + /// Returns builder of EnumTest. + /// + /// EnumTestBuilder + public static EnumTestBuilder Builder() + { + return new EnumTestBuilder(); + } + + /// + /// Returns EnumTestBuilder with properties set. + /// Use it to change properties. + /// + /// EnumTestBuilder + public EnumTestBuilder With() + { + return Builder() + .EnumString(EnumString) + .EnumInteger(EnumInteger) + .EnumNumber(EnumNumber) + .OuterEnum(OuterEnum); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(EnumTest other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (EnumTest. + /// + /// Compared (EnumTest + /// Compared (EnumTest + /// true if compared items are equals, false otherwise + public static bool operator == (EnumTest left, EnumTest right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (EnumTest. + /// + /// Compared (EnumTest + /// Compared (EnumTest + /// true if compared items are not equals, false otherwise + public static bool operator != (EnumTest left, EnumTest right) + { + return !Equals(left, right); + } + + /// + /// Builder of EnumTest. + /// + public sealed class EnumTestBuilder + { + private EnumStringEnum? _EnumString; + private EnumIntegerEnum? _EnumInteger; + private EnumNumberEnum? _EnumNumber; + private OuterEnum _OuterEnum; + + internal EnumTestBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for EnumTest.EnumString property. + /// + /// EnumString + public EnumTestBuilder EnumString(EnumStringEnum? value) + { + _EnumString = value; + return this; + } + + /// + /// Sets value for EnumTest.EnumInteger property. + /// + /// EnumInteger + public EnumTestBuilder EnumInteger(EnumIntegerEnum? value) + { + _EnumInteger = value; + return this; + } + + /// + /// Sets value for EnumTest.EnumNumber property. + /// + /// EnumNumber + public EnumTestBuilder EnumNumber(EnumNumberEnum? value) + { + _EnumNumber = value; + return this; + } + + /// + /// Sets value for EnumTest.OuterEnum property. + /// + /// OuterEnum + public EnumTestBuilder OuterEnum(OuterEnum value) + { + _OuterEnum = value; + return this; + } + + + /// + /// Builds instance of EnumTest. + /// + /// EnumTest + public EnumTest Build() + { + Validate(); + return new EnumTest( + EnumString: _EnumString, + EnumInteger: _EnumInteger, + EnumNumber: _EnumNumber, + OuterEnum: _OuterEnum + ); + } + + private void Validate() + { + } + } + + + public enum EnumStringEnum { UPPER, Lower, Empty }; + public enum EnumIntegerEnum { _1, _1 }; + public enum EnumNumberEnum { _11, _12 }; + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/FormatTest.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/FormatTest.cs new file mode 100644 index 00000000000..3ec04048e60 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/FormatTest.cs @@ -0,0 +1,401 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// FormatTest + /// + public sealed class FormatTest: IEquatable + { + /// + /// Integer + /// + public int? Integer { get; private set; } + + /// + /// Int32 + /// + public int? Int32 { get; private set; } + + /// + /// Int64 + /// + public long? Int64 { get; private set; } + + /// + /// Number + /// + public decimal? Number { get; private set; } + + /// + /// Float + /// + public float? Float { get; private set; } + + /// + /// Double + /// + public double? Double { get; private set; } + + /// + /// String + /// + public string String { get; private set; } + + /// + /// Byte + /// + public byte[] Byte { get; private set; } + + /// + /// Binary + /// + public byte[] Binary { get; private set; } + + /// + /// Date + /// + public ZonedDateTime? Date { get; private set; } + + /// + /// DateTime + /// + public ZonedDateTime? DateTime { get; private set; } + + /// + /// Uuid + /// + public Guid? Uuid { get; private set; } + + /// + /// Password + /// + public string Password { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use FormatTest.Builder() for instance creation instead. + /// + [Obsolete] + public FormatTest() + { + } + + private FormatTest(int? Integer, int? Int32, long? Int64, decimal? Number, float? Float, double? Double, string String, byte[] Byte, byte[] Binary, ZonedDateTime? Date, ZonedDateTime? DateTime, Guid? Uuid, string Password) + { + + this.Integer = Integer; + + this.Int32 = Int32; + + this.Int64 = Int64; + + this.Number = Number; + + this.Float = Float; + + this.Double = Double; + + this.String = String; + + this.Byte = Byte; + + this.Binary = Binary; + + this.Date = Date; + + this.DateTime = DateTime; + + this.Uuid = Uuid; + + this.Password = Password; + + } + + /// + /// Returns builder of FormatTest. + /// + /// FormatTestBuilder + public static FormatTestBuilder Builder() + { + return new FormatTestBuilder(); + } + + /// + /// Returns FormatTestBuilder with properties set. + /// Use it to change properties. + /// + /// FormatTestBuilder + public FormatTestBuilder With() + { + return Builder() + .Integer(Integer) + .Int32(Int32) + .Int64(Int64) + .Number(Number) + .Float(Float) + .Double(Double) + .String(String) + .Byte(Byte) + .Binary(Binary) + .Date(Date) + .DateTime(DateTime) + .Uuid(Uuid) + .Password(Password); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(FormatTest other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (FormatTest. + /// + /// Compared (FormatTest + /// Compared (FormatTest + /// true if compared items are equals, false otherwise + public static bool operator == (FormatTest left, FormatTest right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (FormatTest. + /// + /// Compared (FormatTest + /// Compared (FormatTest + /// true if compared items are not equals, false otherwise + public static bool operator != (FormatTest left, FormatTest right) + { + return !Equals(left, right); + } + + /// + /// Builder of FormatTest. + /// + public sealed class FormatTestBuilder + { + private int? _Integer; + private int? _Int32; + private long? _Int64; + private decimal? _Number; + private float? _Float; + private double? _Double; + private string _String; + private byte[] _Byte; + private byte[] _Binary; + private ZonedDateTime? _Date; + private ZonedDateTime? _DateTime; + private Guid? _Uuid; + private string _Password; + + internal FormatTestBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for FormatTest.Integer property. + /// + /// Integer + public FormatTestBuilder Integer(int? value) + { + _Integer = value; + return this; + } + + /// + /// Sets value for FormatTest.Int32 property. + /// + /// Int32 + public FormatTestBuilder Int32(int? value) + { + _Int32 = value; + return this; + } + + /// + /// Sets value for FormatTest.Int64 property. + /// + /// Int64 + public FormatTestBuilder Int64(long? value) + { + _Int64 = value; + return this; + } + + /// + /// Sets value for FormatTest.Number property. + /// + /// Number + public FormatTestBuilder Number(decimal? value) + { + _Number = value; + return this; + } + + /// + /// Sets value for FormatTest.Float property. + /// + /// Float + public FormatTestBuilder Float(float? value) + { + _Float = value; + return this; + } + + /// + /// Sets value for FormatTest.Double property. + /// + /// Double + public FormatTestBuilder Double(double? value) + { + _Double = value; + return this; + } + + /// + /// Sets value for FormatTest.String property. + /// + /// String + public FormatTestBuilder String(string value) + { + _String = value; + return this; + } + + /// + /// Sets value for FormatTest.Byte property. + /// + /// Byte + public FormatTestBuilder Byte(byte[] value) + { + _Byte = value; + return this; + } + + /// + /// Sets value for FormatTest.Binary property. + /// + /// Binary + public FormatTestBuilder Binary(byte[] value) + { + _Binary = value; + return this; + } + + /// + /// Sets value for FormatTest.Date property. + /// + /// Date + public FormatTestBuilder Date(ZonedDateTime? value) + { + _Date = value; + return this; + } + + /// + /// Sets value for FormatTest.DateTime property. + /// + /// DateTime + public FormatTestBuilder DateTime(ZonedDateTime? value) + { + _DateTime = value; + return this; + } + + /// + /// Sets value for FormatTest.Uuid property. + /// + /// Uuid + public FormatTestBuilder Uuid(Guid? value) + { + _Uuid = value; + return this; + } + + /// + /// Sets value for FormatTest.Password property. + /// + /// Password + public FormatTestBuilder Password(string value) + { + _Password = value; + return this; + } + + + /// + /// Builds instance of FormatTest. + /// + /// FormatTest + public FormatTest Build() + { + Validate(); + return new FormatTest( + Integer: _Integer, + Int32: _Int32, + Int64: _Int64, + Number: _Number, + Float: _Float, + Double: _Double, + String: _String, + Byte: _Byte, + Binary: _Binary, + Date: _Date, + DateTime: _DateTime, + Uuid: _Uuid, + Password: _Password + ); + } + + private void Validate() + { + if (_Number == null) + { + throw new ArgumentException("Number is a required property for FormatTest and cannot be null"); + } + if (_Byte == null) + { + throw new ArgumentException("Byte is a required property for FormatTest and cannot be null"); + } + if (_Date == null) + { + throw new ArgumentException("Date is a required property for FormatTest and cannot be null"); + } + if (_Password == null) + { + throw new ArgumentException("Password is a required property for FormatTest and cannot be null"); + } + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/HasOnlyReadOnly.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..53e212644d9 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/HasOnlyReadOnly.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// HasOnlyReadOnly + /// + public sealed class HasOnlyReadOnly: IEquatable + { + /// + /// Bar + /// + public string Bar { get; private set; } + + /// + /// Foo + /// + public string Foo { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use HasOnlyReadOnly.Builder() for instance creation instead. + /// + [Obsolete] + public HasOnlyReadOnly() + { + } + + private HasOnlyReadOnly(string Bar, string Foo) + { + + this.Bar = Bar; + + this.Foo = Foo; + + } + + /// + /// Returns builder of HasOnlyReadOnly. + /// + /// HasOnlyReadOnlyBuilder + public static HasOnlyReadOnlyBuilder Builder() + { + return new HasOnlyReadOnlyBuilder(); + } + + /// + /// Returns HasOnlyReadOnlyBuilder with properties set. + /// Use it to change properties. + /// + /// HasOnlyReadOnlyBuilder + public HasOnlyReadOnlyBuilder With() + { + return Builder() + .Bar(Bar) + .Foo(Foo); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(HasOnlyReadOnly other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (HasOnlyReadOnly. + /// + /// Compared (HasOnlyReadOnly + /// Compared (HasOnlyReadOnly + /// true if compared items are equals, false otherwise + public static bool operator == (HasOnlyReadOnly left, HasOnlyReadOnly right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (HasOnlyReadOnly. + /// + /// Compared (HasOnlyReadOnly + /// Compared (HasOnlyReadOnly + /// true if compared items are not equals, false otherwise + public static bool operator != (HasOnlyReadOnly left, HasOnlyReadOnly right) + { + return !Equals(left, right); + } + + /// + /// Builder of HasOnlyReadOnly. + /// + public sealed class HasOnlyReadOnlyBuilder + { + private string _Bar; + private string _Foo; + + internal HasOnlyReadOnlyBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for HasOnlyReadOnly.Bar property. + /// + /// Bar + public HasOnlyReadOnlyBuilder Bar(string value) + { + _Bar = value; + return this; + } + + /// + /// Sets value for HasOnlyReadOnly.Foo property. + /// + /// Foo + public HasOnlyReadOnlyBuilder Foo(string value) + { + _Foo = value; + return this; + } + + + /// + /// Builds instance of HasOnlyReadOnly. + /// + /// HasOnlyReadOnly + public HasOnlyReadOnly Build() + { + Validate(); + return new HasOnlyReadOnly( + Bar: _Bar, + Foo: _Foo + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/List.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/List.cs new file mode 100644 index 00000000000..1ff0f4c6af3 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/List.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// List + /// + public sealed class List: IEquatable + { + /// + /// _123List + /// + public string _123List { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use List.Builder() for instance creation instead. + /// + [Obsolete] + public List() + { + } + + private List(string _123List) + { + + this._123List = _123List; + + } + + /// + /// Returns builder of List. + /// + /// ListBuilder + public static ListBuilder Builder() + { + return new ListBuilder(); + } + + /// + /// Returns ListBuilder with properties set. + /// Use it to change properties. + /// + /// ListBuilder + public ListBuilder With() + { + return Builder() + ._123List(_123List); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(List other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (List. + /// + /// Compared (List + /// Compared (List + /// true if compared items are equals, false otherwise + public static bool operator == (List left, List right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (List. + /// + /// Compared (List + /// Compared (List + /// true if compared items are not equals, false otherwise + public static bool operator != (List left, List right) + { + return !Equals(left, right); + } + + /// + /// Builder of List. + /// + public sealed class ListBuilder + { + private string __123List; + + internal ListBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for List._123List property. + /// + /// _123List + public ListBuilder _123List(string value) + { + __123List = value; + return this; + } + + + /// + /// Builds instance of List. + /// + /// List + public List Build() + { + Validate(); + return new List( + _123List: __123List + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/MapTest.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/MapTest.cs new file mode 100644 index 00000000000..d942f08dbe0 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/MapTest.cs @@ -0,0 +1,167 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// MapTest + /// + public sealed class MapTest: IEquatable + { + /// + /// MapMapOfString + /// + public Dictionary> MapMapOfString { get; private set; } + + /// + /// MapOfEnumString + /// + public Dictionary? MapOfEnumString { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use MapTest.Builder() for instance creation instead. + /// + [Obsolete] + public MapTest() + { + } + + private MapTest(Dictionary> MapMapOfString, Dictionary? MapOfEnumString) + { + + this.MapMapOfString = MapMapOfString; + + this.MapOfEnumString = MapOfEnumString; + + } + + /// + /// Returns builder of MapTest. + /// + /// MapTestBuilder + public static MapTestBuilder Builder() + { + return new MapTestBuilder(); + } + + /// + /// Returns MapTestBuilder with properties set. + /// Use it to change properties. + /// + /// MapTestBuilder + public MapTestBuilder With() + { + return Builder() + .MapMapOfString(MapMapOfString) + .MapOfEnumString(MapOfEnumString); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(MapTest other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (MapTest. + /// + /// Compared (MapTest + /// Compared (MapTest + /// true if compared items are equals, false otherwise + public static bool operator == (MapTest left, MapTest right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (MapTest. + /// + /// Compared (MapTest + /// Compared (MapTest + /// true if compared items are not equals, false otherwise + public static bool operator != (MapTest left, MapTest right) + { + return !Equals(left, right); + } + + /// + /// Builder of MapTest. + /// + public sealed class MapTestBuilder + { + private Dictionary> _MapMapOfString; + private Dictionary? _MapOfEnumString; + + internal MapTestBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for MapTest.MapMapOfString property. + /// + /// MapMapOfString + public MapTestBuilder MapMapOfString(Dictionary> value) + { + _MapMapOfString = value; + return this; + } + + /// + /// Sets value for MapTest.MapOfEnumString property. + /// + /// MapOfEnumString + public MapTestBuilder MapOfEnumString(Dictionary? value) + { + _MapOfEnumString = value; + return this; + } + + + /// + /// Builds instance of MapTest. + /// + /// MapTest + public MapTest Build() + { + Validate(); + return new MapTest( + MapMapOfString: _MapMapOfString, + MapOfEnumString: _MapOfEnumString + ); + } + + private void Validate() + { + } + } + + + public enum Dictionary<string, InnerEnum> { UPPER, Lower }; + public enum InnerEnum { UPPER, Lower }; + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d13a104df44 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + public sealed class MixedPropertiesAndAdditionalPropertiesClass: IEquatable + { + /// + /// Uuid + /// + public Guid? Uuid { get; private set; } + + /// + /// DateTime + /// + public ZonedDateTime? DateTime { get; private set; } + + /// + /// Map + /// + public Dictionary Map { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use MixedPropertiesAndAdditionalPropertiesClass.Builder() for instance creation instead. + /// + [Obsolete] + public MixedPropertiesAndAdditionalPropertiesClass() + { + } + + private MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid, ZonedDateTime? DateTime, Dictionary Map) + { + + this.Uuid = Uuid; + + this.DateTime = DateTime; + + this.Map = Map; + + } + + /// + /// Returns builder of MixedPropertiesAndAdditionalPropertiesClass. + /// + /// MixedPropertiesAndAdditionalPropertiesClassBuilder + public static MixedPropertiesAndAdditionalPropertiesClassBuilder Builder() + { + return new MixedPropertiesAndAdditionalPropertiesClassBuilder(); + } + + /// + /// Returns MixedPropertiesAndAdditionalPropertiesClassBuilder with properties set. + /// Use it to change properties. + /// + /// MixedPropertiesAndAdditionalPropertiesClassBuilder + public MixedPropertiesAndAdditionalPropertiesClassBuilder With() + { + return Builder() + .Uuid(Uuid) + .DateTime(DateTime) + .Map(Map); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (MixedPropertiesAndAdditionalPropertiesClass. + /// + /// Compared (MixedPropertiesAndAdditionalPropertiesClass + /// Compared (MixedPropertiesAndAdditionalPropertiesClass + /// true if compared items are equals, false otherwise + public static bool operator == (MixedPropertiesAndAdditionalPropertiesClass left, MixedPropertiesAndAdditionalPropertiesClass right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (MixedPropertiesAndAdditionalPropertiesClass. + /// + /// Compared (MixedPropertiesAndAdditionalPropertiesClass + /// Compared (MixedPropertiesAndAdditionalPropertiesClass + /// true if compared items are not equals, false otherwise + public static bool operator != (MixedPropertiesAndAdditionalPropertiesClass left, MixedPropertiesAndAdditionalPropertiesClass right) + { + return !Equals(left, right); + } + + /// + /// Builder of MixedPropertiesAndAdditionalPropertiesClass. + /// + public sealed class MixedPropertiesAndAdditionalPropertiesClassBuilder + { + private Guid? _Uuid; + private ZonedDateTime? _DateTime; + private Dictionary _Map; + + internal MixedPropertiesAndAdditionalPropertiesClassBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for MixedPropertiesAndAdditionalPropertiesClass.Uuid property. + /// + /// Uuid + public MixedPropertiesAndAdditionalPropertiesClassBuilder Uuid(Guid? value) + { + _Uuid = value; + return this; + } + + /// + /// Sets value for MixedPropertiesAndAdditionalPropertiesClass.DateTime property. + /// + /// DateTime + public MixedPropertiesAndAdditionalPropertiesClassBuilder DateTime(ZonedDateTime? value) + { + _DateTime = value; + return this; + } + + /// + /// Sets value for MixedPropertiesAndAdditionalPropertiesClass.Map property. + /// + /// Map + public MixedPropertiesAndAdditionalPropertiesClassBuilder Map(Dictionary value) + { + _Map = value; + return this; + } + + + /// + /// Builds instance of MixedPropertiesAndAdditionalPropertiesClass. + /// + /// MixedPropertiesAndAdditionalPropertiesClass + public MixedPropertiesAndAdditionalPropertiesClass Build() + { + Validate(); + return new MixedPropertiesAndAdditionalPropertiesClass( + Uuid: _Uuid, + DateTime: _DateTime, + Map: _Map + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Model200Response.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Model200Response.cs new file mode 100644 index 00000000000..1fceaee550e --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Model200Response.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Model for testing model name starting with number + /// + public sealed class Model200Response: IEquatable + { + /// + /// Name + /// + public int? Name { get; private set; } + + /// + /// Class + /// + public string Class { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Model200Response.Builder() for instance creation instead. + /// + [Obsolete] + public Model200Response() + { + } + + private Model200Response(int? Name, string Class) + { + + this.Name = Name; + + this.Class = Class; + + } + + /// + /// Returns builder of Model200Response. + /// + /// Model200ResponseBuilder + public static Model200ResponseBuilder Builder() + { + return new Model200ResponseBuilder(); + } + + /// + /// Returns Model200ResponseBuilder with properties set. + /// Use it to change properties. + /// + /// Model200ResponseBuilder + public Model200ResponseBuilder With() + { + return Builder() + .Name(Name) + .Class(Class); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Model200Response other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Model200Response. + /// + /// Compared (Model200Response + /// Compared (Model200Response + /// true if compared items are equals, false otherwise + public static bool operator == (Model200Response left, Model200Response right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Model200Response. + /// + /// Compared (Model200Response + /// Compared (Model200Response + /// true if compared items are not equals, false otherwise + public static bool operator != (Model200Response left, Model200Response right) + { + return !Equals(left, right); + } + + /// + /// Builder of Model200Response. + /// + public sealed class Model200ResponseBuilder + { + private int? _Name; + private string _Class; + + internal Model200ResponseBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Model200Response.Name property. + /// + /// Name + public Model200ResponseBuilder Name(int? value) + { + _Name = value; + return this; + } + + /// + /// Sets value for Model200Response.Class property. + /// + /// Class + public Model200ResponseBuilder Class(string value) + { + _Class = value; + return this; + } + + + /// + /// Builds instance of Model200Response. + /// + /// Model200Response + public Model200Response Build() + { + Validate(); + return new Model200Response( + Name: _Name, + Class: _Class + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Name.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Name.cs new file mode 100644 index 00000000000..8172ba908d7 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Name.cs @@ -0,0 +1,209 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Model for testing model name same as property name + /// + public sealed class Name: IEquatable + { + /// + /// _Name + /// + public int? _Name { get; private set; } + + /// + /// SnakeCase + /// + public int? SnakeCase { get; private set; } + + /// + /// Property + /// + public string Property { get; private set; } + + /// + /// _123Number + /// + public int? _123Number { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Name.Builder() for instance creation instead. + /// + [Obsolete] + public Name() + { + } + + private Name(int? _Name, int? SnakeCase, string Property, int? _123Number) + { + + this._Name = _Name; + + this.SnakeCase = SnakeCase; + + this.Property = Property; + + this._123Number = _123Number; + + } + + /// + /// Returns builder of Name. + /// + /// NameBuilder + public static NameBuilder Builder() + { + return new NameBuilder(); + } + + /// + /// Returns NameBuilder with properties set. + /// Use it to change properties. + /// + /// NameBuilder + public NameBuilder With() + { + return Builder() + ._Name(_Name) + .SnakeCase(SnakeCase) + .Property(Property) + ._123Number(_123Number); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Name other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Name. + /// + /// Compared (Name + /// Compared (Name + /// true if compared items are equals, false otherwise + public static bool operator == (Name left, Name right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Name. + /// + /// Compared (Name + /// Compared (Name + /// true if compared items are not equals, false otherwise + public static bool operator != (Name left, Name right) + { + return !Equals(left, right); + } + + /// + /// Builder of Name. + /// + public sealed class NameBuilder + { + private int? __Name; + private int? _SnakeCase; + private string _Property; + private int? __123Number; + + internal NameBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Name._Name property. + /// + /// _Name + public NameBuilder _Name(int? value) + { + __Name = value; + return this; + } + + /// + /// Sets value for Name.SnakeCase property. + /// + /// SnakeCase + public NameBuilder SnakeCase(int? value) + { + _SnakeCase = value; + return this; + } + + /// + /// Sets value for Name.Property property. + /// + /// Property + public NameBuilder Property(string value) + { + _Property = value; + return this; + } + + /// + /// Sets value for Name._123Number property. + /// + /// _123Number + public NameBuilder _123Number(int? value) + { + __123Number = value; + return this; + } + + + /// + /// Builds instance of Name. + /// + /// Name + public Name Build() + { + Validate(); + return new Name( + _Name: __Name, + SnakeCase: _SnakeCase, + Property: _Property, + _123Number: __123Number + ); + } + + private void Validate() + { + if (__Name == null) + { + throw new ArgumentException("_Name is a required property for Name and cannot be null"); + } + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/NumberOnly.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/NumberOnly.cs new file mode 100644 index 00000000000..436431270aa --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/NumberOnly.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// NumberOnly + /// + public sealed class NumberOnly: IEquatable + { + /// + /// JustNumber + /// + public decimal? JustNumber { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use NumberOnly.Builder() for instance creation instead. + /// + [Obsolete] + public NumberOnly() + { + } + + private NumberOnly(decimal? JustNumber) + { + + this.JustNumber = JustNumber; + + } + + /// + /// Returns builder of NumberOnly. + /// + /// NumberOnlyBuilder + public static NumberOnlyBuilder Builder() + { + return new NumberOnlyBuilder(); + } + + /// + /// Returns NumberOnlyBuilder with properties set. + /// Use it to change properties. + /// + /// NumberOnlyBuilder + public NumberOnlyBuilder With() + { + return Builder() + .JustNumber(JustNumber); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(NumberOnly other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (NumberOnly. + /// + /// Compared (NumberOnly + /// Compared (NumberOnly + /// true if compared items are equals, false otherwise + public static bool operator == (NumberOnly left, NumberOnly right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (NumberOnly. + /// + /// Compared (NumberOnly + /// Compared (NumberOnly + /// true if compared items are not equals, false otherwise + public static bool operator != (NumberOnly left, NumberOnly right) + { + return !Equals(left, right); + } + + /// + /// Builder of NumberOnly. + /// + public sealed class NumberOnlyBuilder + { + private decimal? _JustNumber; + + internal NumberOnlyBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for NumberOnly.JustNumber property. + /// + /// JustNumber + public NumberOnlyBuilder JustNumber(decimal? value) + { + _JustNumber = value; + return this; + } + + + /// + /// Builds instance of NumberOnly. + /// + /// NumberOnly + public NumberOnly Build() + { + Validate(); + return new NumberOnly( + JustNumber: _JustNumber + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Order.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Order.cs index f1f94f39d77..7404b483830 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Order.cs @@ -8,7 +8,7 @@ namespace IO.Swagger.v2.Models { /// - /// An order for a pets from the pet store + /// Order /// public sealed class Order: IEquatable { diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/OuterEnum.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/OuterEnum.cs new file mode 100644 index 00000000000..e56e5cfed85 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/OuterEnum.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// OuterEnum + /// + public sealed class OuterEnum: IEquatable + { + + /// + /// Empty constructor required by some serializers. + /// Use OuterEnum.Builder() for instance creation instead. + /// + [Obsolete] + public OuterEnum() + { + } + + private OuterEnum() + { + + } + + /// + /// Returns builder of OuterEnum. + /// + /// OuterEnumBuilder + public static OuterEnumBuilder Builder() + { + return new OuterEnumBuilder(); + } + + /// + /// Returns OuterEnumBuilder with properties set. + /// Use it to change properties. + /// + /// OuterEnumBuilder + public OuterEnumBuilder With() + { + return Builder() +; + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(OuterEnum other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (OuterEnum. + /// + /// Compared (OuterEnum + /// Compared (OuterEnum + /// true if compared items are equals, false otherwise + public static bool operator == (OuterEnum left, OuterEnum right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (OuterEnum. + /// + /// Compared (OuterEnum + /// Compared (OuterEnum + /// true if compared items are not equals, false otherwise + public static bool operator != (OuterEnum left, OuterEnum right) + { + return !Equals(left, right); + } + + /// + /// Builder of OuterEnum. + /// + public sealed class OuterEnumBuilder + { + + internal OuterEnumBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + + /// + /// Builds instance of OuterEnum. + /// + /// OuterEnum + public OuterEnum Build() + { + Validate(); + return new OuterEnum( + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Pet.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Pet.cs index b092feb9e85..aef03f6ba97 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Pet.cs @@ -8,7 +8,7 @@ namespace IO.Swagger.v2.Models { /// - /// A pet for sale in the pet store + /// Pet /// public sealed class Pet: IEquatable { diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ReadOnlyFirst.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ReadOnlyFirst.cs new file mode 100644 index 00000000000..c3b00ea44e7 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/ReadOnlyFirst.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// ReadOnlyFirst + /// + public sealed class ReadOnlyFirst: IEquatable + { + /// + /// Bar + /// + public string Bar { get; private set; } + + /// + /// Baz + /// + public string Baz { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ReadOnlyFirst.Builder() for instance creation instead. + /// + [Obsolete] + public ReadOnlyFirst() + { + } + + private ReadOnlyFirst(string Bar, string Baz) + { + + this.Bar = Bar; + + this.Baz = Baz; + + } + + /// + /// Returns builder of ReadOnlyFirst. + /// + /// ReadOnlyFirstBuilder + public static ReadOnlyFirstBuilder Builder() + { + return new ReadOnlyFirstBuilder(); + } + + /// + /// Returns ReadOnlyFirstBuilder with properties set. + /// Use it to change properties. + /// + /// ReadOnlyFirstBuilder + public ReadOnlyFirstBuilder With() + { + return Builder() + .Bar(Bar) + .Baz(Baz); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ReadOnlyFirst other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ReadOnlyFirst. + /// + /// Compared (ReadOnlyFirst + /// Compared (ReadOnlyFirst + /// true if compared items are equals, false otherwise + public static bool operator == (ReadOnlyFirst left, ReadOnlyFirst right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ReadOnlyFirst. + /// + /// Compared (ReadOnlyFirst + /// Compared (ReadOnlyFirst + /// true if compared items are not equals, false otherwise + public static bool operator != (ReadOnlyFirst left, ReadOnlyFirst right) + { + return !Equals(left, right); + } + + /// + /// Builder of ReadOnlyFirst. + /// + public sealed class ReadOnlyFirstBuilder + { + private string _Bar; + private string _Baz; + + internal ReadOnlyFirstBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ReadOnlyFirst.Bar property. + /// + /// Bar + public ReadOnlyFirstBuilder Bar(string value) + { + _Bar = value; + return this; + } + + /// + /// Sets value for ReadOnlyFirst.Baz property. + /// + /// Baz + public ReadOnlyFirstBuilder Baz(string value) + { + _Baz = value; + return this; + } + + + /// + /// Builds instance of ReadOnlyFirst. + /// + /// ReadOnlyFirst + public ReadOnlyFirst Build() + { + Validate(); + return new ReadOnlyFirst( + Bar: _Bar, + Baz: _Baz + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Return.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Return.cs new file mode 100644 index 00000000000..d65aaab6f8a --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Return.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// Model for testing reserved words + /// + public sealed class Return: IEquatable + { + /// + /// _Return + /// + public int? _Return { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Return.Builder() for instance creation instead. + /// + [Obsolete] + public Return() + { + } + + private Return(int? _Return) + { + + this._Return = _Return; + + } + + /// + /// Returns builder of Return. + /// + /// ReturnBuilder + public static ReturnBuilder Builder() + { + return new ReturnBuilder(); + } + + /// + /// Returns ReturnBuilder with properties set. + /// Use it to change properties. + /// + /// ReturnBuilder + public ReturnBuilder With() + { + return Builder() + ._Return(_Return); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Return other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Return. + /// + /// Compared (Return + /// Compared (Return + /// true if compared items are equals, false otherwise + public static bool operator == (Return left, Return right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Return. + /// + /// Compared (Return + /// Compared (Return + /// true if compared items are not equals, false otherwise + public static bool operator != (Return left, Return right) + { + return !Equals(left, right); + } + + /// + /// Builder of Return. + /// + public sealed class ReturnBuilder + { + private int? __Return; + + internal ReturnBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Return._Return property. + /// + /// _Return + public ReturnBuilder _Return(int? value) + { + __Return = value; + return this; + } + + + /// + /// Builds instance of Return. + /// + /// Return + public Return Build() + { + Validate(); + return new Return( + _Return: __Return + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/SpecialModelName.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/SpecialModelName.cs new file mode 100644 index 00000000000..ec3e52be11d --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/SpecialModelName.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace IO.Swagger.v2.Models +{ + /// + /// SpecialModelName + /// + public sealed class SpecialModelName: IEquatable + { + /// + /// SpecialPropertyName + /// + public long? SpecialPropertyName { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use SpecialModelName.Builder() for instance creation instead. + /// + [Obsolete] + public SpecialModelName() + { + } + + private SpecialModelName(long? SpecialPropertyName) + { + + this.SpecialPropertyName = SpecialPropertyName; + + } + + /// + /// Returns builder of SpecialModelName. + /// + /// SpecialModelNameBuilder + public static SpecialModelNameBuilder Builder() + { + return new SpecialModelNameBuilder(); + } + + /// + /// Returns SpecialModelNameBuilder with properties set. + /// Use it to change properties. + /// + /// SpecialModelNameBuilder + public SpecialModelNameBuilder With() + { + return Builder() + .SpecialPropertyName(SpecialPropertyName); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(SpecialModelName other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (SpecialModelName. + /// + /// Compared (SpecialModelName + /// Compared (SpecialModelName + /// true if compared items are equals, false otherwise + public static bool operator == (SpecialModelName left, SpecialModelName right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (SpecialModelName. + /// + /// Compared (SpecialModelName + /// Compared (SpecialModelName + /// true if compared items are not equals, false otherwise + public static bool operator != (SpecialModelName left, SpecialModelName right) + { + return !Equals(left, right); + } + + /// + /// Builder of SpecialModelName. + /// + public sealed class SpecialModelNameBuilder + { + private long? _SpecialPropertyName; + + internal SpecialModelNameBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for SpecialModelName.SpecialPropertyName property. + /// + /// SpecialPropertyName + public SpecialModelNameBuilder SpecialPropertyName(long? value) + { + _SpecialPropertyName = value; + return this; + } + + + /// + /// Builds instance of SpecialModelName. + /// + /// SpecialModelName + public SpecialModelName Build() + { + Validate(); + return new SpecialModelName( + SpecialPropertyName: _SpecialPropertyName + ); + } + + private void Validate() + { + } + } + + + } +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Tag.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Tag.cs index 94b15c123a1..36fd8204a8a 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/Tag.cs @@ -8,7 +8,7 @@ namespace IO.Swagger.v2.Models { /// - /// A tag for a pet + /// Tag /// public sealed class Tag: IEquatable { diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/User.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/User.cs index bd720290ad4..69d079ff42d 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Models/User.cs @@ -8,7 +8,7 @@ namespace IO.Swagger.v2.Models { /// - /// A User who is purchasing from the pet store + /// User /// public sealed class User: IEquatable { diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/FakeModule.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/FakeModule.cs new file mode 100644 index 00000000000..0054f911045 --- /dev/null +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/FakeModule.cs @@ -0,0 +1,228 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using IO.Swagger.v2.Models; +using IO.Swagger.v2.Utils; +using NodaTime; + +namespace IO.Swagger.v2.Modules +{ + /// + /// Form parameter enum test (string array) + /// + public enum TestEnumParametersEnumFormStringArrayEnum + { + >, + $ + }; + + /// + /// Form parameter enum test (string) + /// + public enum TestEnumParametersEnumFormStringEnum + { + _abc, + -efg, + (xyz) + }; + + /// + /// Header parameter enum test (string array) + /// + public enum TestEnumParametersEnumHeaderStringArrayEnum + { + >, + $ + }; + + /// + /// Header parameter enum test (string) + /// + public enum TestEnumParametersEnumHeaderStringEnum + { + _abc, + -efg, + (xyz) + }; + + /// + /// Query parameter enum test (string array) + /// + public enum TestEnumParametersEnumQueryStringArrayEnum + { + >, + $ + }; + + /// + /// Query parameter enum test (string) + /// + public enum TestEnumParametersEnumQueryStringEnum + { + _abc, + -efg, + (xyz) + }; + + /// + /// Query parameter enum test (double) + /// + public enum TestEnumParametersEnumQueryIntegerEnum + { + 1, + -2 + }; + + /// + /// Query parameter enum test (double) + /// + public enum TestEnumParametersEnumQueryDoubleEnum + { + 1.1, + -1.2 + }; + + + /// + /// Module processing requests of Fake domain. + /// + public sealed class FakeModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public FakeModule(FakeService service) : base("/v2") + { + Patch["/fake"] = parameters => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'TestClientModel'"); + + return service.TestClientModel(Context, body); + }; + + Post["/fake"] = parameters => + { + var number = Parameters.ValueOf(parameters, Context.Request, "number", ParameterType.Undefined); + var double = Parameters.ValueOf(parameters, Context.Request, "double", ParameterType.Undefined); + var patternWithoutDelimiter = Parameters.ValueOf(parameters, Context.Request, "patternWithoutDelimiter", ParameterType.Undefined); + var byte = Parameters.ValueOf(parameters, Context.Request, "byte", ParameterType.Undefined); + var integer = Parameters.ValueOf(parameters, Context.Request, "integer", ParameterType.Undefined); + var int32 = Parameters.ValueOf(parameters, Context.Request, "int32", ParameterType.Undefined); + var int64 = Parameters.ValueOf(parameters, Context.Request, "int64", ParameterType.Undefined); + var float = Parameters.ValueOf(parameters, Context.Request, "float", ParameterType.Undefined); + var string = Parameters.ValueOf(parameters, Context.Request, "string", ParameterType.Undefined); + var binary = Parameters.ValueOf(parameters, Context.Request, "binary", ParameterType.Undefined); + var date = Parameters.ValueOf(parameters, Context.Request, "date", ParameterType.Undefined); + var dateTime = Parameters.ValueOf(parameters, Context.Request, "dateTime", ParameterType.Undefined); + var password = Parameters.ValueOf(parameters, Context.Request, "password", ParameterType.Undefined); + var callback = Parameters.ValueOf(parameters, Context.Request, "callback", ParameterType.Undefined); + Preconditions.IsNotNull(number, "Required parameter: 'number' is missing at 'TestEndpointParameters'"); + + Preconditions.IsNotNull(double, "Required parameter: 'double' is missing at 'TestEndpointParameters'"); + + Preconditions.IsNotNull(patternWithoutDelimiter, "Required parameter: 'patternWithoutDelimiter' is missing at 'TestEndpointParameters'"); + + Preconditions.IsNotNull(byte, "Required parameter: 'byte' is missing at 'TestEndpointParameters'"); + + service.TestEndpointParameters(Context, number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); + return new Response { ContentType = "application/xml; charset=utf-8"}; + }; + + Get["/fake"] = parameters => + { + var enumFormStringArray = Parameters.ValueOf(parameters, Context.Request, "enumFormStringArray", ParameterType.Undefined); + var enumFormString = Parameters.ValueOf(parameters, Context.Request, "enumFormString", ParameterType.Undefined); + var enumHeaderStringArray = Parameters.ValueOf(parameters, Context.Request, "enumHeaderStringArray", ParameterType.Header); + var enumHeaderString = Parameters.ValueOf(parameters, Context.Request, "enumHeaderString", ParameterType.Header); + var enumQueryStringArray = Parameters.ValueOf(parameters, Context.Request, "enumQueryStringArray", ParameterType.Query); + var enumQueryString = Parameters.ValueOf(parameters, Context.Request, "enumQueryString", ParameterType.Query); + var enumQueryInteger = Parameters.ValueOf(parameters, Context.Request, "enumQueryInteger", ParameterType.Query); + var enumQueryDouble = Parameters.ValueOf(parameters, Context.Request, "enumQueryDouble", ParameterType.Undefined); + service.TestEnumParameters(Context, enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + return new Response { ContentType = "*/*"}; + }; + } + } + + /// + /// Service handling Fake requests. + /// + public interface FakeService + { + /// + /// To test \"client\" model + /// + /// Context of request + /// client model + /// Client + Client TestClientModel(NancyContext context, Client body); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Context of request + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + void TestEndpointParameters(NancyContext context, decimal? number, double? double, string patternWithoutDelimiter, byte[] byte, int? integer, int? int32, long? int64, float? float, string string, byte[] binary, ZonedDateTime? date, ZonedDateTime? dateTime, string password, string callback); + + /// + /// To test enum parameters + /// + /// Context of request + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + void TestEnumParameters(NancyContext context, TestEnumParametersEnumFormStringArrayEnum? enumFormStringArray, TestEnumParametersEnumFormStringEnum? enumFormString, TestEnumParametersEnumHeaderStringArrayEnum? enumHeaderStringArray, TestEnumParametersEnumHeaderStringEnum? enumHeaderString, TestEnumParametersEnumQueryStringArrayEnum? enumQueryStringArray, TestEnumParametersEnumQueryStringEnum? enumQueryString, TestEnumParametersEnumQueryIntegerEnum? enumQueryInteger, TestEnumParametersEnumQueryDoubleEnum? enumQueryDouble); + } + + /// + /// Abstraction of FakeService. + /// + public abstract class AbstractFakeService: FakeService + { + public virtual Client TestClientModel(NancyContext context, Client body) + { + return TestClientModel(body); + } + + public virtual void TestEndpointParameters(NancyContext context, decimal? number, double? double, string patternWithoutDelimiter, byte[] byte, int? integer, int? int32, long? int64, float? float, string string, byte[] binary, ZonedDateTime? date, ZonedDateTime? dateTime, string password, string callback) + { + TestEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); + } + + public virtual void TestEnumParameters(NancyContext context, TestEnumParametersEnumFormStringArrayEnum? enumFormStringArray, TestEnumParametersEnumFormStringEnum? enumFormString, TestEnumParametersEnumHeaderStringArrayEnum? enumHeaderStringArray, TestEnumParametersEnumHeaderStringEnum? enumHeaderString, TestEnumParametersEnumQueryStringArrayEnum? enumQueryStringArray, TestEnumParametersEnumQueryStringEnum? enumQueryString, TestEnumParametersEnumQueryIntegerEnum? enumQueryInteger, TestEnumParametersEnumQueryDoubleEnum? enumQueryDouble) + { + TestEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + + protected abstract Client TestClientModel(Client body); + + protected abstract void TestEndpointParameters(decimal? number, double? double, string patternWithoutDelimiter, byte[] byte, int? integer, int? int32, long? int64, float? float, string string, byte[] binary, ZonedDateTime? date, ZonedDateTime? dateTime, string password, string callback); + + protected abstract void TestEnumParameters(TestEnumParametersEnumFormStringArrayEnum? enumFormStringArray, TestEnumParametersEnumFormStringEnum? enumFormString, TestEnumParametersEnumHeaderStringArrayEnum? enumHeaderStringArray, TestEnumParametersEnumHeaderStringEnum? enumHeaderString, TestEnumParametersEnumQueryStringArrayEnum? enumQueryStringArray, TestEnumParametersEnumQueryStringEnum? enumQueryString, TestEnumParametersEnumQueryIntegerEnum? enumQueryInteger, TestEnumParametersEnumQueryDoubleEnum? enumQueryDouble); + } + +} diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/StoreModule.cs index e5eed7a2485..347f356a3dc 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/Modules/StoreModule.cs @@ -21,7 +21,7 @@ public sealed class StoreModule : NancyModule /// Service handling requests public StoreModule(StoreService service) : base("/v2") { - Delete["/store/order/{orderId}"] = parameters => + Delete["/store/order/{order_id}"] = parameters => { var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'DeleteOrder'"); @@ -36,7 +36,7 @@ public StoreModule(StoreService service) : base("/v2") return service.GetInventory(Context); }; - Get["/store/order/{orderId}"] = parameters => + Get["/store/order/{order_id}"] = parameters => { var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'GetOrderById'");