From 872471996080df93ec5314706a72b9019e879c4a Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 22 Jan 2018 01:14:17 -0500 Subject: [PATCH] [csharp] Support arrays of arrays for properties and models (#7400) * [csharp] Support composition on toJson Previous implementation assumed specification only supports polymorphic associations (via discrimator), although the code didn't seem to be setup correctly for that in the first place. That is, the parent object must define the discriminator (see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support), so NOT HAS parent AND HAS discriminator doesn't make sense. From a C# perspective, base classes should have the method marked virtual and derived classes should override the method. This supports both composition and polymorphic definitions. * [csharp] this.Configuration in api template Unprefixed Configuration property access leads to ambiguous references when spec defines a Configuration model. * [csharp] Models/properties support nested arrays Previous implementation didn't support multiple levels of array with array items as OpenAPI spec supports. This means an object defined as type: array with items = type: array|items=double (which is common in GIS) would not be possible. This implementation assumes generics in the nested type definitions, so the above would generate List> for model parent types as well as property type declarations. * [csharp] Regenerate integration test sample * [csharp] Set "Client" case sensitive as reserved * [csharp] Regenerate security sample * [csharp] Regenerate samples --- .../languages/AbstractCSharpCodegen.java | 44 +++++- .../languages/AspNetCoreServerCodegen.java | 3 +- .../languages/CSharpClientCodegen.java | 2 + .../codegen/csharp/CSharpModelTest.java | 56 ++++++- .../csharp/SwaggerClient/README.md | 2 +- .../csharp/SwaggerClient/docs/Return.md | 9 ++ .../src/IO.Swagger.Test/Model/ReturnTests.cs | 80 ++++++++++ .../src/IO.Swagger/Api/FakeApi.cs | 28 ++-- .../src/IO.Swagger/Model/Return.cs | 125 +++++++++++++++ .../petstore/csharp/SwaggerClient/README.md | 2 +- .../csharp/SwaggerClient/docs/ClassModel.md | 2 +- .../csharp/SwaggerClient/docs/FormatTest.md | 8 +- .../SwaggerClient/docs/Model200Response.md | 2 +- .../csharp/SwaggerClient/docs/ModelClient.md | 2 +- .../csharp/SwaggerClient/docs/Return.md | 9 ++ .../src/IO.Swagger.Test/Model/ReturnTests.cs | 80 ++++++++++ .../src/IO.Swagger/Model/ClassModel.cs | 22 +-- .../src/IO.Swagger/Model/FormatTest.cs | 120 +++++++------- .../src/IO.Swagger/Model/Model200Response.cs | 22 +-- .../src/IO.Swagger/Model/ModelClient.cs | 22 +-- .../src/IO.Swagger/Model/Return.cs | 124 +++++++++++++++ .../csharp/SwaggerClientNet35/README.md | 2 +- .../SwaggerClientNet35/docs/ClassModel.md | 2 +- .../SwaggerClientNet35/docs/FormatTest.md | 8 +- .../docs/Model200Response.md | 2 +- .../SwaggerClientNet35/docs/ModelClient.md | 2 +- .../csharp/SwaggerClientNet35/docs/Return.md | 9 ++ .../src/IO.Swagger.Test/Model/ReturnTests.cs | 80 ++++++++++ .../src/IO.Swagger/Model/ClassModel.cs | 22 +-- .../src/IO.Swagger/Model/FormatTest.cs | 88 +++++------ .../src/IO.Swagger/Model/Model200Response.cs | 22 +-- .../src/IO.Swagger/Model/ModelClient.cs | 22 +-- .../src/IO.Swagger/Model/Return.cs | 115 ++++++++++++++ .../csharp/SwaggerClientNet40/README.md | 2 +- .../SwaggerClientNet40/docs/ClassModel.md | 2 +- .../SwaggerClientNet40/docs/FormatTest.md | 8 +- .../docs/Model200Response.md | 2 +- .../SwaggerClientNet40/docs/ModelClient.md | 2 +- .../csharp/SwaggerClientNet40/docs/Return.md | 9 ++ .../src/IO.Swagger.Test/Model/ReturnTests.cs | 80 ++++++++++ .../src/IO.Swagger/Model/ClassModel.cs | 22 +-- .../src/IO.Swagger/Model/FormatTest.cs | 120 +++++++------- .../src/IO.Swagger/Model/Model200Response.cs | 22 +-- .../src/IO.Swagger/Model/ModelClient.cs | 22 +-- .../src/IO.Swagger/Model/Return.cs | 124 +++++++++++++++ .../csharp/SwaggerClientNetStandard/README.md | 2 +- .../docs/ClassModel.md | 2 +- .../docs/FormatTest.md | 8 +- .../docs/Model200Response.md | 2 +- .../docs/ModelClient.md | 2 +- .../SwaggerClientNetStandard/docs/Return.md | 9 ++ .../src/IO.Swagger/Model/ClassModel.cs | 22 +-- .../src/IO.Swagger/Model/FormatTest.cs | 88 +++++------ .../src/IO.Swagger/Model/Model200Response.cs | 22 +-- .../src/IO.Swagger/Model/ModelClient.cs | 22 +-- .../src/IO.Swagger/Model/Return.cs | 112 +++++++++++++ .../README.md | 2 +- .../docs/ClassModel.md | 2 +- .../docs/FormatTest.md | 8 +- .../docs/Model200Response.md | 2 +- .../docs/ModelClient.md | 2 +- .../docs/Return.md | 9 ++ .../src/IO.Swagger.Test/Model/ReturnTests.cs | 80 ++++++++++ .../src/IO.Swagger/Model/ClassModel.cs | 22 +-- .../src/IO.Swagger/Model/FormatTest.cs | 120 +++++++------- .../src/IO.Swagger/Model/Model200Response.cs | 22 +-- .../src/IO.Swagger/Model/ModelClient.cs | 22 +-- .../src/IO.Swagger/Model/Return.cs | 147 ++++++++++++++++++ 68 files changed, 1781 insertions(+), 501 deletions(-) create mode 100644 samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md create mode 100644 samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs create mode 100644 samples/client/petstore/csharp/SwaggerClient/docs/Return.md create mode 100644 samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientNet35/docs/Return.md create mode 100644 samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientNet40/docs/Return.md create mode 100644 samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Return.md create mode 100644 samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Return.md create mode 100644 samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs create mode 100644 samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index 1a288e7c2ea..2d34ae6b1dc 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -67,12 +67,13 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co Arrays.asList("IDictionary") ); - setReservedWordsLowerCase( + // NOTE: C# uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons. + reservedWords.addAll( Arrays.asList( // set "client" as a reserved word to avoid conflicts with IO.Swagger.Client // this is a workaround and can be removed if c# api client is updated to use // fully qualified name - "client", "parameter", + "Client", "client", "parameter", // local variable names in API methods (endpoints) "localVarPath", "localVarPathParams", "localVarQueryParams", "localVarHeaderParams", "localVarFormParams", "localVarFileParams", "localVarStatusCode", "localVarResponse", @@ -718,6 +719,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co return null; } + @Override + protected boolean isReservedWord(String word) { + // NOTE: This differs from super's implementation in that C# does _not_ want case insensitive matching. + return reservedWords.contains(word); + } + @Override public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); @@ -727,6 +734,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co swaggerType = ""; // set swagger type to empty string if null } + // NOTE: typeMapping here supports things like string/String, long/Long, datetime/DateTime as lowercase keys. + // Should we require explicit casing here (values are not insensitive). // TODO avoid using toLowerCase as typeMapping should be case-sensitive if (typeMapping.containsKey(swaggerType.toLowerCase())) { type = typeMapping.get(swaggerType.toLowerCase()); @@ -739,16 +748,39 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co return toModelName(type); } + /** + * Provides C# strongly typed declaration for simple arrays of some type and arrays of arrays of some type. + * @param arr + * @return + */ + private String getArrayTypeDeclaration(ArrayProperty arr) { + // TODO: collection type here should be fully qualified namespace to avoid model conflicts + // This supports arrays of arrays. + String arrayType = typeMapping.get("array"); + StringBuilder instantiationType = new StringBuilder(arrayType); + Property items = arr.getItems(); + String nestedType = getTypeDeclaration(items); + // TODO: We may want to differentiate here between generics and primitive arrays. + instantiationType.append("<").append(nestedType).append(">"); + return instantiationType.toString(); + } + + @Override + public String toInstantiationType(Property p) { + if (p instanceof ArrayProperty) { + return getArrayTypeDeclaration((ArrayProperty) p); + } + return super.toInstantiationType(p); + } + @Override public String getTypeDeclaration(Property p) { if (p instanceof ArrayProperty) { - ArrayProperty ap = (ArrayProperty) p; - Property inner = ap.getItems(); - return getSwaggerType(p) + "<" + getTypeDeclaration(inner) + ">"; + return getArrayTypeDeclaration((ArrayProperty) p); } else if (p instanceof MapProperty) { + // Should we also support maps of maps? MapProperty mp = (MapProperty) p; Property inner = mp.getAdditionalProperties(); - return getSwaggerType(p) + ""; } return super.getTypeDeclaration(p); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java index 22de7a1e6f3..f5f05bf456a 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java @@ -35,7 +35,8 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { apiTemplateFiles.put("controller.mustache", ".cs"); // contextually reserved words - setReservedWordsLowerCase( + // NOTE: C# uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons. + reservedWords.addAll( Arrays.asList("var", "async", "await", "dynamic", "yield") ); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index ab42bbaf80c..b4b9c0c4d48 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -4,6 +4,8 @@ import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; import io.swagger.codegen.*; import io.swagger.models.Model; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.Property; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java index 6e5c2076f5d..4d87e7d12b7 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java @@ -9,18 +9,15 @@ import io.swagger.models.Model; import io.swagger.models.ModelImpl; import io.swagger.models.Path; import io.swagger.models.Swagger; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.DateTimeProperty; -import io.swagger.models.properties.LongProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import io.swagger.models.properties.*; import io.swagger.parser.SwaggerParser; import com.google.common.collect.Sets; import org.testng.Assert; import org.testng.annotations.Test; +import java.util.Arrays; +import java.util.HashMap; import java.util.Map; @SuppressWarnings("static-method") @@ -331,4 +328,51 @@ public class CSharpModelTest { Assert.assertEquals(cm.imports.size(), 1); Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); } + + @Test(description = "convert an array of array models") + public void arraysOfArraysModelTest() { + final Model model = new ArrayModel() + .description("a sample geolocation model") + .items( + new ArrayProperty().items(new DoubleProperty()) + ); + + final DefaultCodegen codegen = new CSharpClientCodegen(); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.parent, "List>"); + } + + @Test(description = "convert an array of array properties") + public void arraysOfArraysPropertyTest() { + final Model model = new ModelImpl() + .description("a sample geolocation model") + .property("points", new ArrayProperty() + .items( + new ArrayProperty().items(new DoubleProperty()) + ) + ); + + final DefaultCodegen codegen = new CSharpClientCodegen(); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertNull(cm.parent); + + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "points"); + Assert.assertNull(property1.complexType); + Assert.assertEquals(property1.datatype, "List>"); + Assert.assertEquals(property1.name, "Points"); + Assert.assertEquals(property1.baseType, "List"); + Assert.assertEquals(property1.containerType, "array"); + Assert.assertFalse(property1.required); + Assert.assertTrue(property1.isContainer); + Assert.assertFalse(property1.isNotContainer); + } } diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/README.md b/samples/client/petstore-security-test/csharp/SwaggerClient/README.md index d8ed7f1c12d..4bc77a18568 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/README.md +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/README.md @@ -101,7 +101,7 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Model.ModelReturn](docs/ModelReturn.md) + - [Model.Return](docs/Return.md) diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md b/samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md new file mode 100644 index 00000000000..af0d4ce739f --- /dev/null +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | property description *_/ ' \" =end - - \\r\\n \\n \\r | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..e9532e2f5b2 --- /dev/null +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore *_/ ' \" =end - - \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end - - + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index fa50c6bd07e..04828623861 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -83,7 +83,7 @@ namespace IO.Swagger.Api /// public FakeApi(String basePath) { - this.Configuration = new Configuration { BasePath = basePath }; + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; } @@ -94,10 +94,10 @@ namespace IO.Swagger.Api /// /// An instance of Configuration /// - public FakeApi(Configuration configuration = null) + public FakeApi(IO.Swagger.Client.Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Configuration.Default; + this.Configuration = IO.Swagger.Client.Configuration.Default; else this.Configuration = configuration; @@ -127,7 +127,7 @@ namespace IO.Swagger.Api /// Gets or sets the configuration object /// /// An instance of the Configuration - public Configuration Configuration {get; set;} + public IO.Swagger.Client.Configuration Configuration {get; set;} /// /// Provides a factory method hook for the creation of exceptions. @@ -190,7 +190,7 @@ namespace IO.Swagger.Api var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; @@ -200,22 +200,22 @@ namespace IO.Swagger.Api "application/json", "*_/ ' =end - - " }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "*_/ ' =end - - " }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter + if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", this.Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); @@ -256,7 +256,7 @@ namespace IO.Swagger.Api var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; @@ -266,22 +266,22 @@ namespace IO.Swagger.Api "application/json", "*_/ ' =end - - " }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "*_/ ' =end - - " }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter + if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", this.Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..7867fe5cda5 --- /dev/null +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,125 @@ +/* + * Swagger Petstore *_/ ' \" =end - - \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end - - + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words *_/ ' \" =end - - \\r\\n \\n \\r + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// property description *_/ ' \" =end - - \\r\\n \\n \\r. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// property description *_/ ' \" =end - - \\r\\n \\n \\r + /// + /// property description *_/ ' \" =end - - \\r\\n \\n \\r + [DataMember(Name="return", EmitDefaultValue=false)] + 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 virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 7b5b59a8dcb..8e64bcaf148 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md index 760130f053c..9bfd15db501 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md index 1d366bd7cab..1108a1af428 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md index cfaddb67027..62db21288f2 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md index 9ecdc0e1141..c3817230640 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Return.md b/samples/client/petstore/csharp/SwaggerClient/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..ec2a68a5fbb --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * 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 NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs index cccdd843f00..cd82cd31dec 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs @@ -33,17 +33,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ namespace IO.Swagger.Model return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -104,8 +104,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs index 25e6c7925f3..4a0c3f97383 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs @@ -42,16 +42,16 @@ namespace IO.Swagger.Model /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (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)) + 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) @@ -62,14 +62,14 @@ namespace IO.Swagger.Model { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -92,9 +92,9 @@ namespace IO.Swagger.Model this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -125,28 +125,28 @@ namespace IO.Swagger.Model public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -191,10 +191,10 @@ namespace IO.Swagger.Model 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(" 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"); @@ -255,24 +255,24 @@ namespace IO.Swagger.Model this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -318,14 +318,14 @@ namespace IO.Swagger.Model hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) @@ -383,35 +383,35 @@ namespace IO.Swagger.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // _Float (float?) maximum - if(this._Float > (float?)987.6) + // Float (float?) maximum + if(this.Float > (float?)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value less than or equal to 987.6.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // _Float (float?) minimum - if(this._Float < (float?)54.3) + // Float (float?) minimum + if(this.Float < (float?)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value greater than or equal to 54.3.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // _Double (double?) maximum - if(this._Double > (double?)123.4) + // Double (double?) maximum + if(this.Double > (double?)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value less than or equal to 123.4.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // _Double (double?) minimum - if(this._Double < (double?)67.8) + // Double (double?) minimum + if(this.Double < (double?)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value greater than or equal to 67.8.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } - // _String (string) pattern - Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (false == regex_String.Match(this._String).Success) + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } // Password (string) maxLength diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs index 71b4d96c871..ece573ce162 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs @@ -34,11 +34,11 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -48,10 +48,10 @@ namespace IO.Swagger.Model public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +62,7 @@ namespace IO.Swagger.Model 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(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,9 +103,9 @@ namespace IO.Swagger.Model this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -120,8 +120,8 @@ namespace IO.Swagger.Model int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs index a01c9487ce6..117463e0bf4 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs @@ -33,17 +33,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ namespace IO.Swagger.Model return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -104,8 +104,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..39b03628206 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,124 @@ +/* + * 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.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + 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 virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/README.md b/samples/client/petstore/csharp/SwaggerClientNet35/README.md index 7b5b59a8dcb..8e64bcaf148 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md index 760130f053c..9bfd15db501 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md index 1d366bd7cab..1108a1af428 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md index cfaddb67027..62db21288f2 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md index 9ecdc0e1141..c3817230640 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..ec2a68a5fbb --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * 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 NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs index cf9f0eed3d2..54842287cf6 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs @@ -33,17 +33,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ namespace IO.Swagger.Model return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -104,8 +104,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs index 9d8c1997523..02f96e6c5be 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs @@ -42,16 +42,16 @@ namespace IO.Swagger.Model /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (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)) + 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) @@ -62,14 +62,14 @@ namespace IO.Swagger.Model { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -92,9 +92,9 @@ namespace IO.Swagger.Model this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -125,28 +125,28 @@ namespace IO.Swagger.Model public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -191,10 +191,10 @@ namespace IO.Swagger.Model 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(" 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"); @@ -255,24 +255,24 @@ namespace IO.Swagger.Model this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -318,14 +318,14 @@ namespace IO.Swagger.Model hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs index 331923b20ff..d81f20e5757 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs @@ -34,11 +34,11 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -48,10 +48,10 @@ namespace IO.Swagger.Model public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +62,7 @@ namespace IO.Swagger.Model 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(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,9 +103,9 @@ namespace IO.Swagger.Model this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -120,8 +120,8 @@ namespace IO.Swagger.Model int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs index a971e66e192..db5426bfb05 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs @@ -33,17 +33,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ namespace IO.Swagger.Model return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -104,8 +104,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..0743d0ffa75 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,115 @@ +/* + * 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.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// 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", EmitDefaultValue=false)] + 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 virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/README.md b/samples/client/petstore/csharp/SwaggerClientNet40/README.md index 7b5b59a8dcb..8e64bcaf148 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md index 760130f053c..9bfd15db501 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md index 1d366bd7cab..1108a1af428 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md index cfaddb67027..62db21288f2 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md index 9ecdc0e1141..c3817230640 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..ec2a68a5fbb --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * 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 NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs index cccdd843f00..cd82cd31dec 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs @@ -33,17 +33,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ namespace IO.Swagger.Model return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -104,8 +104,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs index 25e6c7925f3..4a0c3f97383 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs @@ -42,16 +42,16 @@ namespace IO.Swagger.Model /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (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)) + 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) @@ -62,14 +62,14 @@ namespace IO.Swagger.Model { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -92,9 +92,9 @@ namespace IO.Swagger.Model this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -125,28 +125,28 @@ namespace IO.Swagger.Model public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -191,10 +191,10 @@ namespace IO.Swagger.Model 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(" 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"); @@ -255,24 +255,24 @@ namespace IO.Swagger.Model this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -318,14 +318,14 @@ namespace IO.Swagger.Model hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) @@ -383,35 +383,35 @@ namespace IO.Swagger.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // _Float (float?) maximum - if(this._Float > (float?)987.6) + // Float (float?) maximum + if(this.Float > (float?)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value less than or equal to 987.6.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // _Float (float?) minimum - if(this._Float < (float?)54.3) + // Float (float?) minimum + if(this.Float < (float?)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value greater than or equal to 54.3.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // _Double (double?) maximum - if(this._Double > (double?)123.4) + // Double (double?) maximum + if(this.Double > (double?)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value less than or equal to 123.4.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // _Double (double?) minimum - if(this._Double < (double?)67.8) + // Double (double?) minimum + if(this.Double < (double?)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value greater than or equal to 67.8.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } - // _String (string) pattern - Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (false == regex_String.Match(this._String).Success) + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } // Password (string) maxLength diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs index 71b4d96c871..ece573ce162 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs @@ -34,11 +34,11 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -48,10 +48,10 @@ namespace IO.Swagger.Model public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +62,7 @@ namespace IO.Swagger.Model 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(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,9 +103,9 @@ namespace IO.Swagger.Model this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -120,8 +120,8 @@ namespace IO.Swagger.Model int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs index a01c9487ce6..117463e0bf4 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs @@ -33,17 +33,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ namespace IO.Swagger.Model return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -104,8 +104,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..39b03628206 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,124 @@ +/* + * 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.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + 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 virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md index 0e226b9c0e6..10eef36cdd0 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md @@ -130,7 +130,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -141,6 +140,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md index 760130f053c..9bfd15db501 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md index 1d366bd7cab..1108a1af428 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md index cfaddb67027..62db21288f2 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md index 9ecdc0e1141..c3817230640 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs index 3fcff106b2a..67e9e204d0a 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs @@ -31,17 +31,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -51,7 +51,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,9 +87,9 @@ namespace IO.Swagger.Model return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -102,8 +102,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs index 6ea25d953f0..8507759542f 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs @@ -40,16 +40,16 @@ namespace IO.Swagger.Model /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (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)) + 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) @@ -60,14 +60,14 @@ namespace IO.Swagger.Model { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -90,9 +90,9 @@ namespace IO.Swagger.Model this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -123,28 +123,28 @@ namespace IO.Swagger.Model public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -189,10 +189,10 @@ namespace IO.Swagger.Model 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(" 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"); @@ -253,24 +253,24 @@ namespace IO.Swagger.Model this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -316,14 +316,14 @@ namespace IO.Swagger.Model hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs index 1a6eb33e334..a0ea98056e6 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs @@ -32,11 +32,11 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -46,10 +46,10 @@ namespace IO.Swagger.Model public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -60,7 +60,7 @@ namespace IO.Swagger.Model 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(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -101,9 +101,9 @@ namespace IO.Swagger.Model this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -118,8 +118,8 @@ namespace IO.Swagger.Model int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs index 13f8f0cff52..cd1aee27b4c 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs @@ -31,17 +31,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -51,7 +51,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,9 +87,9 @@ namespace IO.Swagger.Model return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -102,8 +102,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..b11bad752f9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,112 @@ +/* + * 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; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// 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", EmitDefaultValue=false)] + 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 virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index 7b5b59a8dcb..8e64bcaf148 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md index 760130f053c..9bfd15db501 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md index 1d366bd7cab..1108a1af428 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md index cfaddb67027..62db21288f2 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md index 9ecdc0e1141..c3817230640 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..ec2a68a5fbb --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * 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 NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs index e45f78059b2..f52476f7b29 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs @@ -36,17 +36,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -56,7 +56,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -92,9 +92,9 @@ namespace IO.Swagger.Model return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -107,8 +107,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs index 2671ccea2d0..c92aed7f349 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs @@ -45,16 +45,16 @@ namespace IO.Swagger.Model /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (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)) + 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) @@ -65,14 +65,14 @@ namespace IO.Swagger.Model { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -95,9 +95,9 @@ namespace IO.Swagger.Model this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -128,28 +128,28 @@ namespace IO.Swagger.Model public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -194,10 +194,10 @@ namespace IO.Swagger.Model 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(" 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"); @@ -258,24 +258,24 @@ namespace IO.Swagger.Model this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -321,14 +321,14 @@ namespace IO.Swagger.Model hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) @@ -406,35 +406,35 @@ namespace IO.Swagger.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // _Float (float?) maximum - if(this._Float > (float?)987.6) + // Float (float?) maximum + if(this.Float > (float?)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value less than or equal to 987.6.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // _Float (float?) minimum - if(this._Float < (float?)54.3) + // Float (float?) minimum + if(this.Float < (float?)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value greater than or equal to 54.3.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // _Double (double?) maximum - if(this._Double > (double?)123.4) + // Double (double?) maximum + if(this.Double > (double?)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value less than or equal to 123.4.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // _Double (double?) minimum - if(this._Double < (double?)67.8) + // Double (double?) minimum + if(this.Double < (double?)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value greater than or equal to 67.8.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } - // _String (string) pattern - Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (false == regex_String.Match(this._String).Success) + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } // Password (string) maxLength diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs index 5e61f28fec2..5503837c064 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs @@ -37,11 +37,11 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -51,10 +51,10 @@ namespace IO.Swagger.Model public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -65,7 +65,7 @@ namespace IO.Swagger.Model 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(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -106,9 +106,9 @@ namespace IO.Swagger.Model this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -123,8 +123,8 @@ namespace IO.Swagger.Model int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs index bd959a8a26c..1fe5ee1c1be 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs @@ -36,17 +36,17 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -56,7 +56,7 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -92,9 +92,9 @@ namespace IO.Swagger.Model return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -107,8 +107,8 @@ namespace IO.Swagger.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..c8b264faba1 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,147 @@ +/* + * 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.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + [ImplementPropertyChanged] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + 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 virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +}