diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 1d47c0b4e9bf..78155a74ea09 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -604,7 +604,7 @@ public CodegenModel fromModel(String name, Schema model) { } for (final CodegenProperty property : codegenModel.readWriteVars) { - if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.name.equals(parentCodegenModel.discriminator.getPropertyName())) { property.defaultValue = "\"" + name + "\""; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 2d2f563bf210..c1fa060c8ff9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -299,7 +299,7 @@ public CodegenModel fromModel(String name, Schema model) { } for (final CodegenProperty property : codegenModel.readWriteVars) { - if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.name.equals(parentCodegenModel.discriminator.getPropertyName())) { property.defaultValue = "\"" + name + "\""; } } diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject.md new file mode 100644 index 000000000000..40e16da1bb7d --- /dev/null +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineObject +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Updated name of the pet | [optional] +**Status** | **string** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject1.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject1.md new file mode 100644 index 000000000000..2e6d226754e4 --- /dev/null +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject1.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineObject1 +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**File** | **System.IO.Stream** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 84f1ca007a33..72483978c81d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -41,9 +41,9 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - /// className (required). + /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index ca4115b1e4dc..4d711f396aa5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -41,9 +41,9 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - /// className (required). + /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs index 84f1ca007a33..72483978c81d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs @@ -41,9 +41,9 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - /// className (required). + /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs index ca4115b1e4dc..4d711f396aa5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs @@ -41,9 +41,9 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - /// className (required). + /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 42674c5ffce8..2326d55ac486 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -39,7 +39,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index 96e568628fe5..b925fb99c324 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -39,7 +39,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs index fd2f581e7dcf..ed0f0ced795a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1568,7 +1568,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs index 036ed97c89ef..9ca5d9c2b5ea 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs @@ -39,7 +39,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Dog.cs index bc15d1113639..cfc41f564489 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Dog.cs @@ -39,7 +39,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs index 08abd59233e9..8d2b08278ac2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1568,7 +1568,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs index 42674c5ffce8..2326d55ac486 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs @@ -39,7 +39,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Dog.cs index 96e568628fe5..b925fb99c324 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Dog.cs @@ -39,7 +39,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/FILES new file mode 100644 index 000000000000..44a82f622d56 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/FILES @@ -0,0 +1,122 @@ +.gitignore +Org.OpenAPITools.sln +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md index d07f57619d5e..12f3292db0bf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md @@ -13,9 +13,9 @@ Name | Type | Description | Notes **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**Anytype1** | **Object** | | [optional] +**Anytype2** | **Object** | | [optional] +**Anytype3** | **Object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs index 82c10e3d0a06..66f42e33e394 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3004,7 +3004,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3095,7 +3095,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs index 9659342cda9c..6f283567bf53 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs @@ -37,7 +37,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs index 503fe9a20ac2..75b181560184 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs @@ -37,7 +37,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md new file mode 100644 index 000000000000..7ee074eba27c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md @@ -0,0 +1,77 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#fooget) | **GET** /foo | + + + +## FooGet + +> InlineResponseDefault FooGet () + + + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(Configuration.Default); + + try + { + InlineResponseDefault result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md new file mode 100644 index 000000000000..ea6f4245da6e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/HealthCheckResult.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/HealthCheckResult.md new file mode 100644 index 000000000000..08e5992d20cb --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/HealthCheckResult.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **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/OpenAPIClientNetStandard/docs/InlineObject.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject.md new file mode 100644 index 000000000000..12ec90a8c699 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Updated name of the pet | [optional] +**Status** | **string** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md new file mode 100644 index 000000000000..581fe20b1e21 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**File** | **System.IO.Stream** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md new file mode 100644 index 000000000000..79abb7a467c4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumFormStringArray** | **List<string>** | Form parameter enum test (string array) | [optional] +**EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to EnumFormStringEnum.Efg] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md new file mode 100644 index 000000000000..684db7f7227b --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md @@ -0,0 +1,26 @@ + +# Org.OpenAPITools.Model.InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int** | None | [optional] +**Int32** | **int** | None | [optional] +**Int64** | **long** | None | [optional] +**Number** | **decimal** | None | +**Float** | **float** | None | [optional] +**Double** | **double** | None | +**String** | **string** | None | [optional] +**PatternWithoutDelimiter** | **string** | None | +**Byte** | **byte[]** | None | +**Binary** | **System.IO.Stream** | None | [optional] +**Date** | **DateTime** | None | [optional] +**DateTime** | **DateTime** | None | [optional] +**Password** | **string** | None | [optional] +**Callback** | **string** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md new file mode 100644 index 000000000000..18e4a1f3ce50 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Param** | **string** | field1 | +**Param2** | **string** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md new file mode 100644 index 000000000000..291c88623eea --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**RequiredFile** | **System.IO.Stream** | file to upload | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..ecfb254001a2 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NullableClass.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NullableClass.md new file mode 100644 index 000000000000..84dd092d8a38 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NullableClass.md @@ -0,0 +1,24 @@ + +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | **string** | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [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/OpenAPIClientNetStandard/docs/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..41474099f2ee --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumDefaultValue.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumInteger.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b82abc3adac4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumInteger.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..46939d01522e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 000000000000..75b49ea3ee28 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,300 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// InlineResponseDefault + InlineResponseDefault FooGet (); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of InlineResponseDefault + ApiResponse FooGetWithHttpInfo (); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of InlineResponseDefault + System.Threading.Tasks.Task FooGetAsync (); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (InlineResponseDefault) + System.Threading.Tasks.Task> FooGetAsyncWithHttpInfo (); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDefaultApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(String basePath) + { + this.Configuration = new Org.OpenAPITools.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// + /// + public DefaultApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public DefaultApi(Org.OpenAPITools.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// InlineResponseDefault + public InlineResponseDefault FooGet () + { + ApiResponse localVarResponse = FooGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of InlineResponseDefault + public ApiResponse FooGetWithHttpInfo () + { + + var localVarPath = "./foo"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FooGet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (InlineResponseDefault) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponseDefault))); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Task of InlineResponseDefault + public async System.Threading.Tasks.Task FooGetAsync () + { + ApiResponse localVarResponse = await FooGetAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (InlineResponseDefault) + public async System.Threading.Tasks.Task> FooGetAsyncWithHttpInfo () + { + + var localVarPath = "./foo"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FooGet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (InlineResponseDefault) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponseDefault))); + } + + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs index 82c10e3d0a06..66f42e33e394 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3004,7 +3004,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3095,7 +3095,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs index 9659342cda9c..6f283567bf53 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs @@ -37,7 +37,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Dog.cs index 503fe9a20ac2..75b181560184 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Dog.cs @@ -37,7 +37,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 000000000000..312590522484 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Foo + /// + [DataContract] + public partial class Foo : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar"). + public Foo(string bar = "bar") + { + // use default value if no "bar" provided + if (bar == null) + { + this.Bar = "bar"; + } + else + { + this.Bar = bar; + } + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { 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 Foo {\n"); + sb.Append(" Bar: ").Append(Bar).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 Foo); + } + + /// + /// Returns true if Foo instances are equal + /// + /// Instance of Foo to be compared + /// Boolean + public bool Equals(Foo input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 000000000000..ab1b6405fdab --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract] + public partial class HealthCheckResult : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string nullableMessage = default(string)) + { + this.NullableMessage = nullableMessage; + this.NullableMessage = nullableMessage; + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name="NullableMessage", EmitDefaultValue=true)] + public string NullableMessage { 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 HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).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 HealthCheckResult); + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + if (input == null) + return false; + + return + ( + this.NullableMessage == input.NullableMessage || + (this.NullableMessage != null && + this.NullableMessage.Equals(input.NullableMessage)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs new file mode 100644 index 000000000000..c9b5274e83bc --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs @@ -0,0 +1,130 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject + /// + [DataContract] + public partial class InlineObject : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// Updated name of the pet. + /// Updated status of the pet. + public InlineObject(string name = default(string), string status = default(string)) + { + this.Name = name; + this.Status = status; + } + + /// + /// Updated name of the pet + /// + /// Updated name of the pet + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Updated status of the pet + /// + /// Updated status of the pet + [DataMember(Name="status", EmitDefaultValue=false)] + public string Status { 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 InlineObject {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Status: ").Append(Status).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 InlineObject); + } + + /// + /// Returns true if InlineObject instances are equal + /// + /// Instance of InlineObject to be compared + /// Boolean + public bool Equals(InlineObject input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs new file mode 100644 index 000000000000..586aea86ee63 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -0,0 +1,130 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject1 + /// + [DataContract] + public partial class InlineObject1 : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// Additional data to pass to server. + /// file to upload. + public InlineObject1(string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + { + this.AdditionalMetadata = additionalMetadata; + this.File = file; + } + + /// + /// Additional data to pass to server + /// + /// Additional data to pass to server + [DataMember(Name="additionalMetadata", EmitDefaultValue=false)] + public string AdditionalMetadata { get; set; } + + /// + /// file to upload + /// + /// file to upload + [DataMember(Name="file", EmitDefaultValue=false)] + public System.IO.Stream File { 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 InlineObject1 {\n"); + sb.Append(" AdditionalMetadata: ").Append(AdditionalMetadata).Append("\n"); + sb.Append(" File: ").Append(File).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 InlineObject1); + } + + /// + /// Returns true if InlineObject1 instances are equal + /// + /// Instance of InlineObject1 to be compared + /// Boolean + public bool Equals(InlineObject1 input) + { + if (input == null) + return false; + + return + ( + this.AdditionalMetadata == input.AdditionalMetadata || + (this.AdditionalMetadata != null && + this.AdditionalMetadata.Equals(input.AdditionalMetadata)) + ) && + ( + this.File == input.File || + (this.File != null && + this.File.Equals(input.File)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AdditionalMetadata != null) + hashCode = hashCode * 59 + this.AdditionalMetadata.GetHashCode(); + if (this.File != null) + hashCode = hashCode * 59 + this.File.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs new file mode 100644 index 000000000000..ec1a6e1bacf5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -0,0 +1,187 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject2 + /// + [DataContract] + public partial class InlineObject2 : IEquatable + { + /// + /// Defines EnumFormStringArray + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumFormStringArrayEnum + { + /// + /// Enum GreaterThan for value: > + /// + [EnumMember(Value = ">")] + GreaterThan = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + + } + + + /// + /// Form parameter enum test (string array) + /// + /// Form parameter enum test (string array) + [DataMember(Name="enum_form_string_array", EmitDefaultValue=false)] + public List EnumFormStringArray { get; set; } + /// + /// Form parameter enum test (string) + /// + /// Form parameter enum test (string) + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumFormStringEnum + { + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + + } + + /// + /// Form parameter enum test (string) + /// + /// Form parameter enum test (string) + [DataMember(Name="enum_form_string", EmitDefaultValue=false)] + public EnumFormStringEnum? EnumFormString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// Form parameter enum test (string array). + /// Form parameter enum test (string) (default to EnumFormStringEnum.Efg). + public InlineObject2(List enumFormStringArray = default(List), EnumFormStringEnum? enumFormString = EnumFormStringEnum.Efg) + { + this.EnumFormStringArray = enumFormStringArray; + // use default value if no "enumFormString" provided + if (enumFormString == null) + { + this.EnumFormString = EnumFormStringEnum.Efg; + } + else + { + this.EnumFormString = enumFormString; + } + } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InlineObject2 {\n"); + sb.Append(" EnumFormStringArray: ").Append(EnumFormStringArray).Append("\n"); + sb.Append(" EnumFormString: ").Append(EnumFormString).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 InlineObject2); + } + + /// + /// Returns true if InlineObject2 instances are equal + /// + /// Instance of InlineObject2 to be compared + /// Boolean + public bool Equals(InlineObject2 input) + { + if (input == null) + return false; + + return + ( + this.EnumFormStringArray == input.EnumFormStringArray || + this.EnumFormStringArray != null && + input.EnumFormStringArray != null && + this.EnumFormStringArray.SequenceEqual(input.EnumFormStringArray) + ) && + ( + this.EnumFormString == input.EnumFormString || + (this.EnumFormString != null && + this.EnumFormString.Equals(input.EnumFormString)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnumFormStringArray != null) + hashCode = hashCode * 59 + this.EnumFormStringArray.GetHashCode(); + if (this.EnumFormString != null) + hashCode = hashCode * 59 + this.EnumFormString.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs new file mode 100644 index 000000000000..97139fd90b2a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs @@ -0,0 +1,376 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject3 + /// + [DataContract] + public partial class InlineObject3 : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject3() { } + /// + /// Initializes a new instance of the class. + /// + /// None. + /// None. + /// None. + /// None (required). + /// None. + /// None (required). + /// None. + /// None (required). + /// None (required). + /// None. + /// None. + /// None. + /// None. + /// None. + public InlineObject3(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), string patternWithoutDelimiter = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) + { + // to ensure "number" is required (not null) + if (number == null) + { + throw new InvalidDataException("number is a required property for InlineObject3 and cannot be null"); + } + else + { + this.Number = number; + } + + // to ensure "_double" is required (not null) + if (_double == null) + { + throw new InvalidDataException("_double is a required property for InlineObject3 and cannot be null"); + } + else + { + this.Double = _double; + } + + // to ensure "patternWithoutDelimiter" is required (not null) + if (patternWithoutDelimiter == null) + { + throw new InvalidDataException("patternWithoutDelimiter is a required property for InlineObject3 and cannot be null"); + } + else + { + this.PatternWithoutDelimiter = patternWithoutDelimiter; + } + + // to ensure "_byte" is required (not null) + if (_byte == null) + { + throw new InvalidDataException("_byte is a required property for InlineObject3 and cannot be null"); + } + else + { + this.Byte = _byte; + } + + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.String = _string; + this.Binary = binary; + this.Date = date; + this.DateTime = dateTime; + this.Password = password; + this.Callback = callback; + } + + /// + /// None + /// + /// None + [DataMember(Name="integer", EmitDefaultValue=false)] + public int Integer { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="int32", EmitDefaultValue=false)] + public int Int32 { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="int64", EmitDefaultValue=false)] + public long Int64 { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="number", EmitDefaultValue=true)] + public decimal Number { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="float", EmitDefaultValue=false)] + public float Float { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="double", EmitDefaultValue=true)] + public double Double { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="string", EmitDefaultValue=false)] + public string String { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="pattern_without_delimiter", EmitDefaultValue=true)] + public string PatternWithoutDelimiter { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="byte", EmitDefaultValue=true)] + public byte[] Byte { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="binary", EmitDefaultValue=false)] + public System.IO.Stream Binary { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="date", EmitDefaultValue=false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime DateTime { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="callback", EmitDefaultValue=false)] + public string Callback { 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 InlineObject3 {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" PatternWithoutDelimiter: ").Append(PatternWithoutDelimiter).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Callback: ").Append(Callback).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 InlineObject3); + } + + /// + /// Returns true if InlineObject3 instances are equal + /// + /// Instance of InlineObject3 to be compared + /// Boolean + public bool Equals(InlineObject3 input) + { + if (input == null) + return false; + + return + ( + this.Integer == input.Integer || + (this.Integer != null && + this.Integer.Equals(input.Integer)) + ) && + ( + this.Int32 == input.Int32 || + (this.Int32 != null && + this.Int32.Equals(input.Int32)) + ) && + ( + this.Int64 == input.Int64 || + (this.Int64 != null && + this.Int64.Equals(input.Int64)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + 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.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ) && + ( + this.PatternWithoutDelimiter == input.PatternWithoutDelimiter || + (this.PatternWithoutDelimiter != null && + this.PatternWithoutDelimiter.Equals(input.PatternWithoutDelimiter)) + ) && + ( + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) + ) && + ( + this.Binary == input.Binary || + (this.Binary != null && + this.Binary.Equals(input.Binary)) + ) && + ( + this.Date == input.Date || + (this.Date != null && + this.Date.Equals(input.Date)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Callback == input.Callback || + (this.Callback != null && + this.Callback.Equals(input.Callback)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Integer != null) + hashCode = hashCode * 59 + this.Integer.GetHashCode(); + if (this.Int32 != null) + hashCode = hashCode * 59 + this.Int32.GetHashCode(); + if (this.Int64 != null) + 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.PatternWithoutDelimiter != null) + hashCode = hashCode * 59 + this.PatternWithoutDelimiter.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) + hashCode = hashCode * 59 + this.Date.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Callback != null) + hashCode = hashCode * 59 + this.Callback.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs new file mode 100644 index 000000000000..1cff92535feb --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject4 + /// + [DataContract] + public partial class InlineObject4 : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject4() { } + /// + /// Initializes a new instance of the class. + /// + /// field1 (required). + /// field2 (required). + public InlineObject4(string param = default(string), string param2 = default(string)) + { + // to ensure "param" is required (not null) + if (param == null) + { + throw new InvalidDataException("param is a required property for InlineObject4 and cannot be null"); + } + else + { + this.Param = param; + } + + // to ensure "param2" is required (not null) + if (param2 == null) + { + throw new InvalidDataException("param2 is a required property for InlineObject4 and cannot be null"); + } + else + { + this.Param2 = param2; + } + + } + + /// + /// field1 + /// + /// field1 + [DataMember(Name="param", EmitDefaultValue=true)] + public string Param { get; set; } + + /// + /// field2 + /// + /// field2 + [DataMember(Name="param2", EmitDefaultValue=true)] + public string Param2 { 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 InlineObject4 {\n"); + sb.Append(" Param: ").Append(Param).Append("\n"); + sb.Append(" Param2: ").Append(Param2).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 InlineObject4); + } + + /// + /// Returns true if InlineObject4 instances are equal + /// + /// Instance of InlineObject4 to be compared + /// Boolean + public bool Equals(InlineObject4 input) + { + if (input == null) + return false; + + return + ( + this.Param == input.Param || + (this.Param != null && + this.Param.Equals(input.Param)) + ) && + ( + this.Param2 == input.Param2 || + (this.Param2 != null && + this.Param2.Equals(input.Param2)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Param != null) + hashCode = hashCode * 59 + this.Param.GetHashCode(); + if (this.Param2 != null) + hashCode = hashCode * 59 + this.Param2.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs new file mode 100644 index 000000000000..f63950b34095 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject5 + /// + [DataContract] + public partial class InlineObject5 : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject5() { } + /// + /// Initializes a new instance of the class. + /// + /// Additional data to pass to server. + /// file to upload (required). + public InlineObject5(string additionalMetadata = default(string), System.IO.Stream requiredFile = default(System.IO.Stream)) + { + // to ensure "requiredFile" is required (not null) + if (requiredFile == null) + { + throw new InvalidDataException("requiredFile is a required property for InlineObject5 and cannot be null"); + } + else + { + this.RequiredFile = requiredFile; + } + + this.AdditionalMetadata = additionalMetadata; + } + + /// + /// Additional data to pass to server + /// + /// Additional data to pass to server + [DataMember(Name="additionalMetadata", EmitDefaultValue=false)] + public string AdditionalMetadata { get; set; } + + /// + /// file to upload + /// + /// file to upload + [DataMember(Name="requiredFile", EmitDefaultValue=true)] + public System.IO.Stream RequiredFile { 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 InlineObject5 {\n"); + sb.Append(" AdditionalMetadata: ").Append(AdditionalMetadata).Append("\n"); + sb.Append(" RequiredFile: ").Append(RequiredFile).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 InlineObject5); + } + + /// + /// Returns true if InlineObject5 instances are equal + /// + /// Instance of InlineObject5 to be compared + /// Boolean + public bool Equals(InlineObject5 input) + { + if (input == null) + return false; + + return + ( + this.AdditionalMetadata == input.AdditionalMetadata || + (this.AdditionalMetadata != null && + this.AdditionalMetadata.Equals(input.AdditionalMetadata)) + ) && + ( + this.RequiredFile == input.RequiredFile || + (this.RequiredFile != null && + this.RequiredFile.Equals(input.RequiredFile)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AdditionalMetadata != null) + hashCode = hashCode * 59 + this.AdditionalMetadata.GetHashCode(); + if (this.RequiredFile != null) + hashCode = hashCode * 59 + this.RequiredFile.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs new file mode 100644 index 000000000000..56d89df27aad --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineResponseDefault + /// + [DataContract] + public partial class InlineResponseDefault : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _string. + public InlineResponseDefault(Foo _string = default(Foo)) + { + this.String = _string; + } + + /// + /// Gets or Sets String + /// + [DataMember(Name="string", EmitDefaultValue=false)] + public Foo String { 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 InlineResponseDefault {\n"); + sb.Append(" String: ").Append(String).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 InlineResponseDefault); + } + + /// + /// Returns true if InlineResponseDefault instances are equal + /// + /// Instance of InlineResponseDefault to be compared + /// Boolean + public bool Equals(InlineResponseDefault input) + { + if (input == null) + return false; + + return + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 000000000000..35e9bd2ccf68 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract] + public partial class NullableClass : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name="integer_prop", EmitDefaultValue=true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name="number_prop", EmitDefaultValue=true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name="boolean_prop", EmitDefaultValue=true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name="string_prop", EmitDefaultValue=true)] + public string StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name="date_prop", EmitDefaultValue=true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name="datetime_prop", EmitDefaultValue=true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name="array_nullable_prop", EmitDefaultValue=true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name="array_items_nullable", EmitDefaultValue=false)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name="object_nullable_prop", EmitDefaultValue=true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name="object_items_nullable", EmitDefaultValue=false)] + public Dictionary ObjectItemsNullable { 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 NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NullableClass); + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.IntegerProp == input.IntegerProp || + (this.IntegerProp != null && + this.IntegerProp.Equals(input.IntegerProp)) + ) && base.Equals(input) && + ( + this.NumberProp == input.NumberProp || + (this.NumberProp != null && + this.NumberProp.Equals(input.NumberProp)) + ) && base.Equals(input) && + ( + this.BooleanProp == input.BooleanProp || + (this.BooleanProp != null && + this.BooleanProp.Equals(input.BooleanProp)) + ) && base.Equals(input) && + ( + this.StringProp == input.StringProp || + (this.StringProp != null && + this.StringProp.Equals(input.StringProp)) + ) && base.Equals(input) && + ( + this.DateProp == input.DateProp || + (this.DateProp != null && + this.DateProp.Equals(input.DateProp)) + ) && base.Equals(input) && + ( + this.DatetimeProp == input.DatetimeProp || + (this.DatetimeProp != null && + this.DatetimeProp.Equals(input.DatetimeProp)) + ) && base.Equals(input) && + ( + this.ArrayNullableProp == input.ArrayNullableProp || + this.ArrayNullableProp != null && + input.ArrayNullableProp != null && + this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) + ) && base.Equals(input) && + ( + this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || + this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && + this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ArrayItemsNullable == input.ArrayItemsNullable || + this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && + this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) + ) && base.Equals(input) && + ( + this.ObjectNullableProp == input.ObjectNullableProp || + this.ObjectNullableProp != null && + input.ObjectNullableProp != null && + this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) + ) && base.Equals(input) && + ( + this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || + this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && + this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ObjectItemsNullable == input.ObjectItemsNullable || + this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && + this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + if (this.NumberProp != null) + hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + if (this.BooleanProp != null) + hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + if (this.StringProp != null) + hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + if (this.DateProp != null) + hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + if (this.DatetimeProp != null) + hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + if (this.ArrayNullableProp != null) + hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + if (this.ArrayAndItemsNullableProp != null) + hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + if (this.ArrayItemsNullable != null) + hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + if (this.ObjectNullableProp != null) + hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + if (this.ObjectAndItemsNullableProp != null) + hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + if (this.ObjectItemsNullable != null) + hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 000000000000..36a3f4322acb --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 000000000000..7908216a230c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 000000000000..0c75ede67b32 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 7c827a81c332..df362a6df375 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,7 +18,7 @@ The version of the OpenAPI document: 1.0.0 Org.OpenAPITools Org.OpenAPITools {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - v5.0 + netstandard1.3 512 diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md new file mode 100644 index 000000000000..7ee074eba27c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md @@ -0,0 +1,77 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#fooget) | **GET** /foo | + + + +## FooGet + +> InlineResponseDefault FooGet () + + + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(Configuration.Default); + + try + { + InlineResponseDefault result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md new file mode 100644 index 000000000000..ea6f4245da6e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md new file mode 100644 index 000000000000..08e5992d20cb --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **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/OpenAPIClientWithPropertyChanged/docs/InlineObject.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject.md new file mode 100644 index 000000000000..12ec90a8c699 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Updated name of the pet | [optional] +**Status** | **string** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md new file mode 100644 index 000000000000..581fe20b1e21 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**File** | **System.IO.Stream** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md new file mode 100644 index 000000000000..79abb7a467c4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumFormStringArray** | **List<string>** | Form parameter enum test (string array) | [optional] +**EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to EnumFormStringEnum.Efg] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md new file mode 100644 index 000000000000..684db7f7227b --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md @@ -0,0 +1,26 @@ + +# Org.OpenAPITools.Model.InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int** | None | [optional] +**Int32** | **int** | None | [optional] +**Int64** | **long** | None | [optional] +**Number** | **decimal** | None | +**Float** | **float** | None | [optional] +**Double** | **double** | None | +**String** | **string** | None | [optional] +**PatternWithoutDelimiter** | **string** | None | +**Byte** | **byte[]** | None | +**Binary** | **System.IO.Stream** | None | [optional] +**Date** | **DateTime** | None | [optional] +**DateTime** | **DateTime** | None | [optional] +**Password** | **string** | None | [optional] +**Callback** | **string** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md new file mode 100644 index 000000000000..18e4a1f3ce50 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Param** | **string** | field1 | +**Param2** | **string** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md new file mode 100644 index 000000000000..291c88623eea --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**RequiredFile** | **System.IO.Stream** | file to upload | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..ecfb254001a2 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md new file mode 100644 index 000000000000..84dd092d8a38 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md @@ -0,0 +1,24 @@ + +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | **string** | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [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/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..41474099f2ee --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b82abc3adac4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..46939d01522e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 000000000000..9a524e2177be --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,300 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// InlineResponseDefault + InlineResponseDefault FooGet (); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of InlineResponseDefault + ApiResponse FooGetWithHttpInfo (); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of InlineResponseDefault + System.Threading.Tasks.Task FooGetAsync (); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (InlineResponseDefault) + System.Threading.Tasks.Task> FooGetAsyncWithHttpInfo (); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDefaultApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(String basePath) + { + this.Configuration = new Org.OpenAPITools.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// + /// + public DefaultApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public DefaultApi(Org.OpenAPITools.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// InlineResponseDefault + public InlineResponseDefault FooGet () + { + ApiResponse localVarResponse = FooGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of InlineResponseDefault + public ApiResponse FooGetWithHttpInfo () + { + + var localVarPath = "/foo"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FooGet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (InlineResponseDefault) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponseDefault))); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Task of InlineResponseDefault + public async System.Threading.Tasks.Task FooGetAsync () + { + ApiResponse localVarResponse = await FooGetAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (InlineResponseDefault) + public async System.Threading.Tasks.Task> FooGetAsyncWithHttpInfo () + { + + var localVarPath = "/foo"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FooGet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (InlineResponseDefault) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponseDefault))); + } + + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs index 6ed5af7439da..45b78bb8db07 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3004,7 +3004,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3095,7 +3095,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs index 364ef5df0d8f..1c2c2baf2976 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs @@ -42,7 +42,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Dog.cs index 36fdef563493..b60019d438fa 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Dog.cs @@ -42,7 +42,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 000000000000..a05cfe1cd742 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Foo + /// + [DataContract] + [ImplementPropertyChanged] + public partial class Foo : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar"). + public Foo(string bar = "bar") + { + // use default value if no "bar" provided + if (bar == null) + { + this.Bar = "bar"; + } + else + { + this.Bar = bar; + } + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=true)] + public string Bar { 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 Foo {\n"); + sb.Append(" Bar: ").Append(Bar).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 Foo); + } + + /// + /// Returns true if Foo instances are equal + /// + /// Instance of Foo to be compared + /// Boolean + public bool Equals(Foo input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 000000000000..46f6afb0ebdc --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract] + [ImplementPropertyChanged] + public partial class HealthCheckResult : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string nullableMessage = default(string)) + { + this.NullableMessage = nullableMessage; + this.NullableMessage = nullableMessage; + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name="NullableMessage", EmitDefaultValue=true)] + public string NullableMessage { 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 HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).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 HealthCheckResult); + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + if (input == null) + return false; + + return + ( + this.NullableMessage == input.NullableMessage || + (this.NullableMessage != null && + this.NullableMessage.Equals(input.NullableMessage)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + hashCode = hashCode * 59 + this.NullableMessage.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs new file mode 100644 index 000000000000..83271c2f5d1e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Updated name of the pet. + /// Updated status of the pet. + public InlineObject(string name = default(string), string status = default(string)) + { + this.Name = name; + this.Status = status; + } + + /// + /// Updated name of the pet + /// + /// Updated name of the pet + [DataMember(Name="name", EmitDefaultValue=true)] + public string Name { get; set; } + + /// + /// Updated status of the pet + /// + /// Updated status of the pet + [DataMember(Name="status", EmitDefaultValue=true)] + public string Status { 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 InlineObject {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Status: ").Append(Status).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 InlineObject); + } + + /// + /// Returns true if InlineObject instances are equal + /// + /// Instance of InlineObject to be compared + /// Boolean + public bool Equals(InlineObject input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs new file mode 100644 index 000000000000..591132a73933 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject1 + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineObject1 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Additional data to pass to server. + /// file to upload. + public InlineObject1(string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + { + this.AdditionalMetadata = additionalMetadata; + this.File = file; + } + + /// + /// Additional data to pass to server + /// + /// Additional data to pass to server + [DataMember(Name="additionalMetadata", EmitDefaultValue=true)] + public string AdditionalMetadata { get; set; } + + /// + /// file to upload + /// + /// file to upload + [DataMember(Name="file", EmitDefaultValue=true)] + public System.IO.Stream File { 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 InlineObject1 {\n"); + sb.Append(" AdditionalMetadata: ").Append(AdditionalMetadata).Append("\n"); + sb.Append(" File: ").Append(File).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 InlineObject1); + } + + /// + /// Returns true if InlineObject1 instances are equal + /// + /// Instance of InlineObject1 to be compared + /// Boolean + public bool Equals(InlineObject1 input) + { + if (input == null) + return false; + + return + ( + this.AdditionalMetadata == input.AdditionalMetadata || + (this.AdditionalMetadata != null && + this.AdditionalMetadata.Equals(input.AdditionalMetadata)) + ) && + ( + this.File == input.File || + (this.File != null && + this.File.Equals(input.File)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AdditionalMetadata != null) + hashCode = hashCode * 59 + this.AdditionalMetadata.GetHashCode(); + if (this.File != null) + hashCode = hashCode * 59 + this.File.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs new file mode 100644 index 000000000000..f6b3cdc10d2c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -0,0 +1,222 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject2 + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineObject2 : IEquatable, IValidatableObject + { + /// + /// Defines EnumFormStringArray + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumFormStringArrayEnum + { + /// + /// Enum GreaterThan for value: > + /// + [EnumMember(Value = ">")] + GreaterThan = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + + } + + + /// + /// Form parameter enum test (string array) + /// + /// Form parameter enum test (string array) + [DataMember(Name="enum_form_string_array", EmitDefaultValue=true)] + public List EnumFormStringArray { get; set; } + /// + /// Form parameter enum test (string) + /// + /// Form parameter enum test (string) + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumFormStringEnum + { + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + + } + + /// + /// Form parameter enum test (string) + /// + /// Form parameter enum test (string) + [DataMember(Name="enum_form_string", EmitDefaultValue=true)] + public EnumFormStringEnum? EnumFormString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// Form parameter enum test (string array). + /// Form parameter enum test (string) (default to EnumFormStringEnum.Efg). + public InlineObject2(List enumFormStringArray = default(List), EnumFormStringEnum? enumFormString = EnumFormStringEnum.Efg) + { + this.EnumFormStringArray = enumFormStringArray; + // use default value if no "enumFormString" provided + if (enumFormString == null) + { + this.EnumFormString = EnumFormStringEnum.Efg; + } + else + { + this.EnumFormString = enumFormString; + } + } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class InlineObject2 {\n"); + sb.Append(" EnumFormStringArray: ").Append(EnumFormStringArray).Append("\n"); + sb.Append(" EnumFormString: ").Append(EnumFormString).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 InlineObject2); + } + + /// + /// Returns true if InlineObject2 instances are equal + /// + /// Instance of InlineObject2 to be compared + /// Boolean + public bool Equals(InlineObject2 input) + { + if (input == null) + return false; + + return + ( + this.EnumFormStringArray == input.EnumFormStringArray || + this.EnumFormStringArray != null && + input.EnumFormStringArray != null && + this.EnumFormStringArray.SequenceEqual(input.EnumFormStringArray) + ) && + ( + this.EnumFormString == input.EnumFormString || + (this.EnumFormString != null && + this.EnumFormString.Equals(input.EnumFormString)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnumFormStringArray != null) + hashCode = hashCode * 59 + this.EnumFormStringArray.GetHashCode(); + if (this.EnumFormString != null) + hashCode = hashCode * 59 + this.EnumFormString.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs new file mode 100644 index 000000000000..57f4bc33ea69 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs @@ -0,0 +1,505 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject3 + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineObject3 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject3() { } + /// + /// Initializes a new instance of the class. + /// + /// None. + /// None. + /// None. + /// None (required). + /// None. + /// None (required). + /// None. + /// None (required). + /// None (required). + /// None. + /// None. + /// None. + /// None. + /// None. + public InlineObject3(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), string patternWithoutDelimiter = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) + { + // to ensure "number" is required (not null) + if (number == null) + { + throw new InvalidDataException("number is a required property for InlineObject3 and cannot be null"); + } + else + { + this.Number = number; + } + + // to ensure "_double" is required (not null) + if (_double == null) + { + throw new InvalidDataException("_double is a required property for InlineObject3 and cannot be null"); + } + else + { + this.Double = _double; + } + + // to ensure "patternWithoutDelimiter" is required (not null) + if (patternWithoutDelimiter == null) + { + throw new InvalidDataException("patternWithoutDelimiter is a required property for InlineObject3 and cannot be null"); + } + else + { + this.PatternWithoutDelimiter = patternWithoutDelimiter; + } + + // to ensure "_byte" is required (not null) + if (_byte == null) + { + throw new InvalidDataException("_byte is a required property for InlineObject3 and cannot be null"); + } + else + { + this.Byte = _byte; + } + + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.String = _string; + this.Binary = binary; + this.Date = date; + this.DateTime = dateTime; + this.Password = password; + this.Callback = callback; + } + + /// + /// None + /// + /// None + [DataMember(Name="integer", EmitDefaultValue=true)] + public int Integer { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="int32", EmitDefaultValue=true)] + public int Int32 { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="int64", EmitDefaultValue=true)] + public long Int64 { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="number", EmitDefaultValue=true)] + public decimal Number { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="float", EmitDefaultValue=true)] + public float Float { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="double", EmitDefaultValue=true)] + public double Double { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="string", EmitDefaultValue=true)] + public string String { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="pattern_without_delimiter", EmitDefaultValue=true)] + public string PatternWithoutDelimiter { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="byte", EmitDefaultValue=true)] + public byte[] Byte { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="binary", EmitDefaultValue=true)] + public System.IO.Stream Binary { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="date", EmitDefaultValue=true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="dateTime", EmitDefaultValue=true)] + public DateTime DateTime { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="password", EmitDefaultValue=true)] + public string Password { get; set; } + + /// + /// None + /// + /// None + [DataMember(Name="callback", EmitDefaultValue=true)] + public string Callback { 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 InlineObject3 {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" PatternWithoutDelimiter: ").Append(PatternWithoutDelimiter).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Callback: ").Append(Callback).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 InlineObject3); + } + + /// + /// Returns true if InlineObject3 instances are equal + /// + /// Instance of InlineObject3 to be compared + /// Boolean + public bool Equals(InlineObject3 input) + { + if (input == null) + return false; + + return + ( + this.Integer == input.Integer || + (this.Integer != null && + this.Integer.Equals(input.Integer)) + ) && + ( + this.Int32 == input.Int32 || + (this.Int32 != null && + this.Int32.Equals(input.Int32)) + ) && + ( + this.Int64 == input.Int64 || + (this.Int64 != null && + this.Int64.Equals(input.Int64)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + 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.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ) && + ( + this.PatternWithoutDelimiter == input.PatternWithoutDelimiter || + (this.PatternWithoutDelimiter != null && + this.PatternWithoutDelimiter.Equals(input.PatternWithoutDelimiter)) + ) && + ( + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) + ) && + ( + this.Binary == input.Binary || + (this.Binary != null && + this.Binary.Equals(input.Binary)) + ) && + ( + this.Date == input.Date || + (this.Date != null && + this.Date.Equals(input.Date)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Callback == input.Callback || + (this.Callback != null && + this.Callback.Equals(input.Callback)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Integer != null) + hashCode = hashCode * 59 + this.Integer.GetHashCode(); + if (this.Int32 != null) + hashCode = hashCode * 59 + this.Int32.GetHashCode(); + if (this.Int64 != null) + 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.PatternWithoutDelimiter != null) + hashCode = hashCode * 59 + this.PatternWithoutDelimiter.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) + hashCode = hashCode * 59 + this.Date.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Callback != null) + hashCode = hashCode * 59 + this.Callback.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) + { + + + // Integer (int) maximum + if(this.Integer > (int)100) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if(this.Integer < (int)10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + + + // Int32 (int) maximum + if(this.Int32 > (int)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if(this.Int32 < (int)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + + + // Number (decimal) maximum + if(this.Number > (decimal)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if(this.Number < (decimal)32.1) + { + 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) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + + + // 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" }); + } + + // 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" }); + } + + + + // 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 " + regexString, new [] { "String" }); + } + + + + // PatternWithoutDelimiter (string) pattern + Regex regexPatternWithoutDelimiter = new Regex(@"^[A-Z].*", RegexOptions.CultureInvariant); + if (false == regexPatternWithoutDelimiter.Match(this.PatternWithoutDelimiter).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithoutDelimiter, must match a pattern of " + regexPatternWithoutDelimiter, new [] { "PatternWithoutDelimiter" }); + } + + // Password (string) maxLength + if(this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if(this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs new file mode 100644 index 000000000000..9ada27bd52d0 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs @@ -0,0 +1,188 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject4 + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineObject4 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject4() { } + /// + /// Initializes a new instance of the class. + /// + /// field1 (required). + /// field2 (required). + public InlineObject4(string param = default(string), string param2 = default(string)) + { + // to ensure "param" is required (not null) + if (param == null) + { + throw new InvalidDataException("param is a required property for InlineObject4 and cannot be null"); + } + else + { + this.Param = param; + } + + // to ensure "param2" is required (not null) + if (param2 == null) + { + throw new InvalidDataException("param2 is a required property for InlineObject4 and cannot be null"); + } + else + { + this.Param2 = param2; + } + + } + + /// + /// field1 + /// + /// field1 + [DataMember(Name="param", EmitDefaultValue=true)] + public string Param { get; set; } + + /// + /// field2 + /// + /// field2 + [DataMember(Name="param2", EmitDefaultValue=true)] + public string Param2 { 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 InlineObject4 {\n"); + sb.Append(" Param: ").Append(Param).Append("\n"); + sb.Append(" Param2: ").Append(Param2).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 InlineObject4); + } + + /// + /// Returns true if InlineObject4 instances are equal + /// + /// Instance of InlineObject4 to be compared + /// Boolean + public bool Equals(InlineObject4 input) + { + if (input == null) + return false; + + return + ( + this.Param == input.Param || + (this.Param != null && + this.Param.Equals(input.Param)) + ) && + ( + this.Param2 == input.Param2 || + (this.Param2 != null && + this.Param2.Equals(input.Param2)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Param != null) + hashCode = hashCode * 59 + this.Param.GetHashCode(); + if (this.Param2 != null) + hashCode = hashCode * 59 + this.Param2.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs new file mode 100644 index 000000000000..3eb8657d9ac8 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs @@ -0,0 +1,179 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineObject5 + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineObject5 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected InlineObject5() { } + /// + /// Initializes a new instance of the class. + /// + /// Additional data to pass to server. + /// file to upload (required). + public InlineObject5(string additionalMetadata = default(string), System.IO.Stream requiredFile = default(System.IO.Stream)) + { + // to ensure "requiredFile" is required (not null) + if (requiredFile == null) + { + throw new InvalidDataException("requiredFile is a required property for InlineObject5 and cannot be null"); + } + else + { + this.RequiredFile = requiredFile; + } + + this.AdditionalMetadata = additionalMetadata; + } + + /// + /// Additional data to pass to server + /// + /// Additional data to pass to server + [DataMember(Name="additionalMetadata", EmitDefaultValue=true)] + public string AdditionalMetadata { get; set; } + + /// + /// file to upload + /// + /// file to upload + [DataMember(Name="requiredFile", EmitDefaultValue=true)] + public System.IO.Stream RequiredFile { 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 InlineObject5 {\n"); + sb.Append(" AdditionalMetadata: ").Append(AdditionalMetadata).Append("\n"); + sb.Append(" RequiredFile: ").Append(RequiredFile).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 InlineObject5); + } + + /// + /// Returns true if InlineObject5 instances are equal + /// + /// Instance of InlineObject5 to be compared + /// Boolean + public bool Equals(InlineObject5 input) + { + if (input == null) + return false; + + return + ( + this.AdditionalMetadata == input.AdditionalMetadata || + (this.AdditionalMetadata != null && + this.AdditionalMetadata.Equals(input.AdditionalMetadata)) + ) && + ( + this.RequiredFile == input.RequiredFile || + (this.RequiredFile != null && + this.RequiredFile.Equals(input.RequiredFile)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AdditionalMetadata != null) + hashCode = hashCode * 59 + this.AdditionalMetadata.GetHashCode(); + if (this.RequiredFile != null) + hashCode = hashCode * 59 + this.RequiredFile.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs new file mode 100644 index 000000000000..05e5a889dcd3 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// InlineResponseDefault + /// + [DataContract] + [ImplementPropertyChanged] + public partial class InlineResponseDefault : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _string. + public InlineResponseDefault(Foo _string = default(Foo)) + { + this.String = _string; + } + + /// + /// Gets or Sets String + /// + [DataMember(Name="string", EmitDefaultValue=true)] + public Foo String { 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 InlineResponseDefault {\n"); + sb.Append(" String: ").Append(String).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 InlineResponseDefault); + } + + /// + /// Returns true if InlineResponseDefault instances are equal + /// + /// Instance of InlineResponseDefault to be compared + /// Boolean + public bool Equals(InlineResponseDefault input) + { + if (input == null) + return false; + + return + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.String != null) + hashCode = hashCode * 59 + this.String.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 000000000000..f25680980807 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,341 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract] + [ImplementPropertyChanged] + public partial class NullableClass : Dictionary, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name="integer_prop", EmitDefaultValue=true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name="number_prop", EmitDefaultValue=true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name="boolean_prop", EmitDefaultValue=true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name="string_prop", EmitDefaultValue=true)] + public string StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name="date_prop", EmitDefaultValue=true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name="datetime_prop", EmitDefaultValue=true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name="array_nullable_prop", EmitDefaultValue=true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name="array_items_nullable", EmitDefaultValue=true)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name="object_nullable_prop", EmitDefaultValue=true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name="object_items_nullable", EmitDefaultValue=true)] + public Dictionary ObjectItemsNullable { 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 NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NullableClass); + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.IntegerProp == input.IntegerProp || + (this.IntegerProp != null && + this.IntegerProp.Equals(input.IntegerProp)) + ) && base.Equals(input) && + ( + this.NumberProp == input.NumberProp || + (this.NumberProp != null && + this.NumberProp.Equals(input.NumberProp)) + ) && base.Equals(input) && + ( + this.BooleanProp == input.BooleanProp || + (this.BooleanProp != null && + this.BooleanProp.Equals(input.BooleanProp)) + ) && base.Equals(input) && + ( + this.StringProp == input.StringProp || + (this.StringProp != null && + this.StringProp.Equals(input.StringProp)) + ) && base.Equals(input) && + ( + this.DateProp == input.DateProp || + (this.DateProp != null && + this.DateProp.Equals(input.DateProp)) + ) && base.Equals(input) && + ( + this.DatetimeProp == input.DatetimeProp || + (this.DatetimeProp != null && + this.DatetimeProp.Equals(input.DatetimeProp)) + ) && base.Equals(input) && + ( + this.ArrayNullableProp == input.ArrayNullableProp || + this.ArrayNullableProp != null && + input.ArrayNullableProp != null && + this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) + ) && base.Equals(input) && + ( + this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || + this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && + this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ArrayItemsNullable == input.ArrayItemsNullable || + this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && + this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) + ) && base.Equals(input) && + ( + this.ObjectNullableProp == input.ObjectNullableProp || + this.ObjectNullableProp != null && + input.ObjectNullableProp != null && + this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) + ) && base.Equals(input) && + ( + this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || + this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && + this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ObjectItemsNullable == input.ObjectItemsNullable || + this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && + this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + if (this.NumberProp != null) + hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + if (this.BooleanProp != null) + hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + if (this.StringProp != null) + hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + if (this.DateProp != null) + hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + if (this.DatetimeProp != null) + hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + if (this.ArrayNullableProp != null) + hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + if (this.ArrayAndItemsNullableProp != null) + hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + if (this.ArrayItemsNullable != null) + hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + if (this.ObjectNullableProp != null) + hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + if (this.ObjectAndItemsNullableProp != null) + hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + if (this.ObjectItemsNullable != null) + hashCode = hashCode * 59 + this.ObjectItemsNullable.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; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 000000000000..929ec2f35735 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 000000000000..17167a170170 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 000000000000..7bc889406e4f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3 + + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index afa636560641..d99e7162d01f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md index 960cc01cd7e0..4b200ade794d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md @@ -8,18 +8,21 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap - SDK version: 1.0.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen - ## Frameworks supported + + - .NET 4.0 or later - Windows Phone 7.1 (Mango) - ## Dependencies + + - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: + ``` Install-Package RestSharp Install-Package Newtonsoft.Json @@ -28,19 +31,23 @@ Install-Package JsonSubTypes NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) - ## Installation + Run the following command to generate the DLL + - [Mac/Linux] `/bin/sh build.sh` - [Windows] `build.bat` Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: + ```csharp using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; using Org.OpenAPITools.Model; + ``` - + + ## Packaging A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. @@ -53,11 +60,11 @@ nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. - + ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -67,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -79,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } @@ -89,7 +99,6 @@ namespace Example } ``` - ## Documentation for API Endpoints All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -99,6 +108,7 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**FakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -111,6 +121,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet @@ -135,7 +146,6 @@ Class | Method | HTTP request | Description *UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - ## Documentation for Models - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) @@ -146,9 +156,11 @@ Class | Method | HTTP request | Description - [Model.ArrayTest](docs/ArrayTest.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) + - [Model.CatAllOf](docs/CatAllOf.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) - [Model.Dog](docs/Dog.md) + - [Model.DogAllOf](docs/DogAllOf.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) @@ -187,36 +199,44 @@ Class | Method | HTTP request | Description - [Model.User](docs/User.md) - ## Documentation for Authorization - + ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header - + ### api_key_query - **Type**: API key + - **API key parameter name**: api_key_query - **Location**: URL query string - + ### bearer_test -- **Type**: HTTP basic authentication - +- **Type**: HTTP bearer authentication + + ### http_basic_test + - **Type**: HTTP basic authentication - + +### http_signature_test + + + ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat index 88942a71d0f7..9849135797df 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat @@ -10,8 +10,8 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient if not exist ".\bin" mkdir bin -copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll -copy packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll +copy packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\Org.OpenAPITools.dll /recurse:src\Org.OpenAPITools\*.cs /doc:bin\Org.OpenAPITools.xml diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh index 269c087258e9..15365d6014d8 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh @@ -44,9 +44,9 @@ ${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages; echo "[INFO] Copy DLLs to the 'bin' folder" mkdir -p bin; -cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/Newtonsoft.Json.12.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll; -cp packages/JsonSubTypes.1.2.0/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll +cp packages/JsonSubTypes.1.6.0/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll" mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md index 057f5bd65dfc..847bf120968f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.AdditionalPropertiesClass + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **MapProperty** | **Dictionary<string, string>** | | [optional] **MapOfMapProperty** | **Dictionary<string, Dictionary<string, 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) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md index a97ce49b8018..0a05bcdf0616 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Animal + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md index 81cc3106d64f..c7cb3d05138b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md @@ -7,8 +7,9 @@ Method | HTTP request | Description [**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - -# **Call123TestSpecialTags** + +## Call123TestSpecialTags + > ModelClient Call123TestSpecialTags (ModelClient modelClient) To test special tags @@ -16,8 +17,9 @@ To test special tags To test special tags and operation ID starting with number ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -27,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -38,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -49,6 +54,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **modelClient** | [**ModelClient**](ModelClient.md)| client model | @@ -63,8 +69,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md index 01b35815bd40..a3b916355fda 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.ApiResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md index 614546d32564..e05ea7dc240f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md index 1886a6edcb46..5f593d42929a 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md index ff6a6cb24b0e..593bc2d73864 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.ArrayTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md index 74c1ab66db29..0c66f2d2d440 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Capitalization + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **SCAETHFlowPoints** | **string** | | [optional] **ATT_NAME** | **string** | Name of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md index 4b79315204f3..6609de8e12a5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.Cat + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md new file mode 100644 index 000000000000..d623d2a0a6ef --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md index 67e28fe8d08e..42102d4e5084 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Category + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md index 556b05db2410..b2b42407d2b0 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ClassModel + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md index 92f2dc125c04..7ee074eba27c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md @@ -7,15 +7,17 @@ Method | HTTP request | Description [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | - -# **FooGet** + +## FooGet + > InlineResponseDefault FooGet () ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -25,18 +27,21 @@ namespace Example { public class FooGetExample { - public void main() + public static void Main() { - var apiInstance = new DefaultApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(Configuration.Default); try { InlineResponseDefault result = apiInstance.FooGet(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -44,6 +49,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -56,8 +62,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md index aa5df1a927a1..1f39769d2b93 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Dog + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Color** | **string** | | [optional] [default to "red"] **Breed** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DogAllOf.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DogAllOf.md new file mode 100644 index 000000000000..d72134a0f5f6 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DogAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md index 2dfe0e223884..9d58d25f9729 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.EnumArrays + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **JustSymbol** | **string** | | [optional] **ArrayEnum** | **List<string>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md index 4fb1eae9c066..16d21587b4c8 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.EnumClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md index 904379e7adeb..a8a888d45249 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md @@ -1,16 +1,20 @@ + # Org.OpenAPITools.Model.EnumTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] -**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**OuterEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**OuterEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**OuterEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 57ad5eefda36..38ab478e715b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[**FakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -17,17 +18,20 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | - -# **FakeHealthGet** + +## FakeHealthGet + > HealthCheckResult FakeHealthGet () Health check endpoint ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -37,9 +41,10 @@ namespace Example { public class FakeHealthGetExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); try { @@ -47,9 +52,11 @@ namespace Example HealthCheckResult result = apiInstance.FakeHealthGet(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -57,6 +64,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -69,22 +77,109 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **FakeOuterBooleanSerialize** -> bool? FakeOuterBooleanSerialize (bool? body = null) +## FakeHttpSignatureTest + +> void FakeHttpSignatureTest (Pet pet, string query1 = null, string header1 = null) + +test http signature authentication + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHttpSignatureTestExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + + var apiInstance = new FakeApi(Configuration.Default); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var query1 = query1_example; // string | query parameter (optional) + var header1 = header1_example; // string | header parameter (optional) + + try + { + // test http signature authentication + apiInstance.FakeHttpSignatureTest(pet, query1, header1); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHttpSignatureTest: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **string**| query parameter | [optional] + **header1** | **string**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterBooleanSerialize + +> bool FakeOuterBooleanSerialize (bool? body = null) Test serialization of outer boolean types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -94,19 +189,22 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -115,13 +213,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **bool?**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -129,13 +228,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterCompositeSerialize - -# **FakeOuterCompositeSerialize** > OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) @@ -143,8 +251,9 @@ No authorization required Test serialization of object with outer number type ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -154,9 +263,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -164,9 +274,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -175,6 +287,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] @@ -189,22 +302,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **FakeOuterNumberSerialize** -> decimal? FakeOuterNumberSerialize (decimal? body = null) + +## FakeOuterNumberSerialize + +> decimal FakeOuterNumberSerialize (decimal? body = null) Test serialization of outer number types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -214,19 +337,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = 8.14; // decimal? | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -235,13 +361,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **decimal?**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -249,13 +376,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterStringSerialize - -# **FakeOuterStringSerialize** > string FakeOuterStringSerialize (string body = null) @@ -263,8 +399,9 @@ No authorization required Test serialization of outer string types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -274,9 +411,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -284,9 +422,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -295,6 +435,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **string**| Input string as post body | [optional] @@ -309,13 +450,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithFileSchema - -# **TestBodyWithFileSchema** > void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) @@ -323,8 +473,9 @@ No authorization required For this test, the body for this request much reference a schema named `File`. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -334,18 +485,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -354,6 +508,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | @@ -368,20 +523,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithQueryParams - -# **TestBodyWithQueryParams** > void TestBodyWithQueryParams (string query, User user) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -391,9 +556,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var user = new User(); // User | @@ -401,9 +567,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -412,6 +580,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | @@ -427,13 +596,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestClientModel - -# **TestClientModel** > ModelClient TestClientModel (ModelClient modelClient) To test \"client\" model @@ -441,8 +619,9 @@ To test \"client\" model To test \"client\" model ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -452,9 +631,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -463,9 +643,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +656,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **modelClient** | [**ModelClient**](ModelClient.md)| client model | @@ -488,22 +671,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestEndpointParameters** -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +## TestEndpointParameters + +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -513,15 +706,16 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); - var number = 8.14; // decimal? | None - var _double = 1.2D; // double? | None + var apiInstance = new FakeApi(Configuration.Default); + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None var integer = 56; // int? | None (optional) @@ -540,9 +734,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -551,10 +747,11 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | **integer** | **int?**| None | [optional] @@ -578,13 +775,23 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestEnumParameters** +## TestEnumParameters + > void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -592,8 +799,9 @@ To test enum parameters To test enum parameters ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -603,9 +811,10 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) @@ -620,9 +829,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -631,6 +842,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] @@ -652,22 +864,33 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestGroupParameters** -> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +## TestGroupParameters + +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -677,16 +900,16 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - // Configure HTTP basic authorization: bearer_test - Configuration.Default.Username = "YOUR_USERNAME"; - Configuration.Default.Password = "YOUR_PASSWORD"; - - var apiInstance = new FakeApi(); - var requiredStringGroup = 56; // int? | Required String in group parameters - var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters - var requiredInt64Group = 789; // long? | Required Integer in group parameters + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP bearer authorization: bearer_test + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) var int64Group = 789; // long? | Integer in group parameters (optional) @@ -696,9 +919,11 @@ namespace Example // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -707,11 +932,12 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int?**| Required String in group parameters | - **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | - **requiredInt64Group** | **long?**| Required Integer in group parameters | + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | **stringGroup** | **int?**| String in group parameters | [optional] **booleanGroup** | **bool?**| Boolean in group parameters | [optional] **int64Group** | **long?**| Integer in group parameters | [optional] @@ -726,20 +952,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestInlineAdditionalProperties** +## TestInlineAdditionalProperties + > void TestInlineAdditionalProperties (Dictionary requestBody) test inline additionalProperties ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -749,9 +985,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var requestBody = new Dictionary(); // Dictionary | request body try @@ -759,9 +996,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(requestBody); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -770,6 +1009,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **requestBody** | [**Dictionary<string, string>**](string.md)| request body | @@ -784,20 +1024,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestJsonFormData** +## TestJsonFormData + > void TestJsonFormData (string param, string param2) test json serialization of form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -807,9 +1057,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -818,9 +1069,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -829,6 +1082,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **param** | **string**| field1 | @@ -844,8 +1098,97 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestQueryParameterCollectionFormat + +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<string>**](string.md)| | + **ioutil** | [**List<string>**](string.md)| | + **http** | [**List<string>**](string.md)| | + **url** | [**List<string>**](string.md)| | + **context** | [**List<string>**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md index f069b0983997..93eb8b274552 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md @@ -7,8 +7,9 @@ Method | HTTP request | Description [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - -# **TestClassname** + +## TestClassname + > ModelClient TestClassname (ModelClient modelClient) To test class name in snake case @@ -16,8 +17,9 @@ To test class name in snake case To test class name in snake case ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -27,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -43,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -54,6 +59,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **modelClient** | [**ModelClient**](ModelClient.md)| client model | @@ -68,8 +74,16 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md index acf85a4c001a..b71051025797 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.File + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **SourceURI** | **string** | Test capitalization | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md index 244164accbe6..df1453f686bd 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.FileSchemaTestClass + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **File** | [**File**](File.md) | | [optional] **Files** | [**List<File>**](File.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md index fd84dc2038c9..ea6f4245da6e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Foo + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Bar** | **string** | | [optional] [default to "bar"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md index bba9daef559d..6cef48d5b4db 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md @@ -1,23 +1,27 @@ + # Org.OpenAPITools.Model.FormatTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md index 95f49de194c1..043d2442b4ea 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.HasOnlyReadOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] -**Foo** | **string** | | [optional] +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md index c8f299aaa258..08e5992d20cb 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.HealthCheckResult + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **NullableMessage** | **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) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md index 40e16da1bb7d..12ec90a8c699 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Name** | **string** | Updated name of the pet | [optional] **Status** | **string** | Updated status of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md index 2e6d226754e4..581fe20b1e21 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject1 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **File** | **System.IO.Stream** | file to upload | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md index c02c78f9b2d0..79abb7a467c4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject2 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **EnumFormStringArray** | **List<string>** | Form parameter enum test (string array) | [optional] **EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to EnumFormStringEnum.Efg] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md index 192926bbe927..684db7f7227b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md @@ -1,22 +1,26 @@ + # Org.OpenAPITools.Model.InlineObject3 + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | None | [optional] -**Int32** | **int?** | None | [optional] -**Int64** | **long?** | None | [optional] -**Number** | **decimal?** | None | -**Float** | **float?** | None | [optional] -**Double** | **double?** | None | +**Integer** | **int** | None | [optional] +**Int32** | **int** | None | [optional] +**Int64** | **long** | None | [optional] +**Number** | **decimal** | None | +**Float** | **float** | None | [optional] +**Double** | **double** | None | **String** | **string** | None | [optional] **PatternWithoutDelimiter** | **string** | None | **Byte** | **byte[]** | None | **Binary** | **System.IO.Stream** | None | [optional] -**Date** | **DateTime?** | None | [optional] -**DateTime** | **DateTime?** | None | [optional] +**Date** | **DateTime** | None | [optional] +**DateTime** | **DateTime** | None | [optional] **Password** | **string** | None | [optional] **Callback** | **string** | None | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md index c8e00663ee88..18e4a1f3ce50 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject4 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Param** | **string** | field1 | **Param2** | **string** | field2 | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md index a28ff47f2ec0..291c88623eea 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject5 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **RequiredFile** | **System.IO.Stream** | file to upload | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md index 8c96fb62ac88..ecfb254001a2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.InlineResponseDefault + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **String** | [**Foo**](Foo.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md index 484c2a0992c6..cb41193b43eb 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.List + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123List** | **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) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md index 2c44f95808ae..79d499e2cf9a 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md @@ -1,12 +1,16 @@ + # Org.OpenAPITools.Model.MapTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] -**DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | **Dictionary<string, bool?>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 9b8e2e3434c1..dd7b01e49fe9 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md index 16337f9b6b2d..7d826bca1ec2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Model200Response + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md index ecc7b60ce558..e36e1fad802f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ModelClient + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **__Client** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md index e22fef95673d..bfd7955e5b4c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md @@ -1,12 +1,16 @@ + # Org.OpenAPITools.Model.Name + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] [readonly] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] [readonly] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md index 0ca2455a4ab2..84dd092d8a38 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.NullableClass + ## Properties Name | Type | Description | Notes @@ -16,5 +18,7 @@ Name | Type | Description | Notes **ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] **ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md index 5f00dedf1c39..e4b08467e087 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.NumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md index 984bd5ca063e..875f43a30e5c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md @@ -1,14 +1,18 @@ + # Org.OpenAPITools.Model.Order + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md index 4091cd23f2e1..f381fb7fd283 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.OuterComposite + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md index 22713352ca08..edc2300684d9 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnum + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md index 09f6b91ee623..41474099f2ee 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumDefaultValue + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md index 149bb5a8dd16..b82abc3adac4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumInteger + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md index 29de71509745..46939d01522e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md index 0ac711337aa8..0bd5c40fc993 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md @@ -1,14 +1,18 @@ + # Org.OpenAPITools.Model.Pet + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md index dd23df9b3683..5d9c6cb6f791 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md @@ -15,15 +15,17 @@ Method | HTTP request | Description [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - -# **AddPet** + +## AddPet + > void AddPet (Pet pet) Add a new pet to the store ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -33,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var pet = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -46,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -57,6 +62,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -71,20 +77,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DeletePet** -> void DeletePet (long? petId, string apiKey = null) +## DeletePet + +> void DeletePet (long petId, string apiKey = null) Deletes a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -94,13 +110,14 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -108,9 +125,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -119,9 +138,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -134,22 +154,32 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## FindPetsByStatus - -# **FindPetsByStatus** -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -159,23 +189,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -184,13 +217,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **List<string>**| Status values that need to be considered for filter | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -198,22 +232,33 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **FindPetsByTags** -> List FindPetsByTags (List tags) + +## FindPetsByTags + +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -223,23 +268,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -248,13 +296,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<string>**](string.md)| Tags to filter by | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -262,22 +311,33 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GetPetById** -> Pet GetPetById (long? petId) +## GetPetById + +> Pet GetPetById (long petId) Find pet by ID Returns a single pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -287,15 +347,16 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to return try { @@ -303,9 +364,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -314,9 +377,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -328,20 +392,32 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **UpdatePet** +## UpdatePet + > void UpdatePet (Pet pet) Update an existing pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -351,12 +427,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var pet = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -364,9 +441,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -375,6 +454,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -389,20 +469,32 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | - -# **UpdatePetWithForm** -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePetWithForm + +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -412,13 +504,14 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -427,9 +520,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -438,9 +533,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -454,20 +550,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | - -# **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFile + +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -477,13 +583,14 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -493,9 +600,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -504,9 +613,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -520,20 +630,30 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **UploadFileWithRequiredFile** -> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + +## UploadFileWithRequiredFile + +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -543,13 +663,14 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -559,9 +680,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -570,9 +693,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **requiredFile** | **System.IO.Stream**| file to upload | **additionalMetadata** | **string**| Additional data to pass to server | [optional] @@ -586,8 +710,16 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md index 6c2571cb48f5..8ea3b95919bf 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.ReadOnlyFirst + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] +**Bar** | **string** | | [optional] [readonly] **Baz** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md index 21a269c63f4b..4761c70748e4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Return + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_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) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md index 306e65392a2e..ee6489524d09 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.SpecialModelName + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md index f8b4d3422db4..d3c3c7c54053 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - -# **DeleteOrder** + +## DeleteOrder + > void DeleteOrder (string orderId) Delete purchase order by ID @@ -19,8 +20,9 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -30,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -40,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -51,6 +56,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **string**| ID of the order that needs to be deleted | @@ -65,22 +71,33 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **GetInventory** -> Dictionary GetInventory () + +## GetInventory + +> Dictionary<string, int> GetInventory () Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -90,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -115,11 +135,12 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -127,22 +148,32 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **GetOrderById** -> Order GetOrderById (long? orderId) + +## GetOrderById + +> Order GetOrderById (long orderId) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -152,10 +183,11 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -163,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -174,9 +208,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type @@ -188,20 +223,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PlaceOrder - -# **PlaceOrder** > Order PlaceOrder (Order order) Place an order for a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -211,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var order = new Order(); // Order | order placed for purchasing the pet try @@ -222,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(order); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -233,6 +283,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order** | [**Order**](Order.md)| order placed for purchasing the pet | @@ -247,8 +298,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/xml, application/json +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md index 6a76c28595f7..f781c26f017c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Tag + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md index 04dd24a3423c..a25c25d1aa0b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md @@ -1,16 +1,20 @@ + # Org.OpenAPITools.Model.User + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md index 2fb4c422cf56..7c37179a9102 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md @@ -14,8 +14,9 @@ Method | HTTP request | Description [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - -# **CreateUser** + +## CreateUser + > void CreateUser (User user) Create user @@ -23,8 +24,9 @@ Create user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -34,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var user = new User(); // User | Created user object try @@ -44,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -55,6 +60,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| Created user object | @@ -69,20 +75,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithArrayInput - -# **CreateUsersWithArrayInput** > void CreateUsersWithArrayInput (List user) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -92,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var user = new List(); // List | List of user object try @@ -102,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -113,9 +132,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -127,20 +147,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithListInput - -# **CreateUsersWithListInput** > void CreateUsersWithListInput (List user) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -150,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var user = new List(); // List | List of user object try @@ -160,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -171,9 +204,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -185,13 +219,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteUser - -# **DeleteUser** > void DeleteUser (string username) Delete user @@ -199,8 +242,9 @@ Delete user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -210,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -220,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -231,6 +278,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be deleted | @@ -245,20 +293,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUserByName - -# **GetUserByName** > User GetUserByName (string username) Get user by user name ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -268,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -279,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -290,6 +352,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be fetched. Use user1 for testing. | @@ -304,20 +367,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LoginUser - -# **LoginUser** > string LoginUser (string username, string password) Logs user into the system ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -327,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -339,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -350,6 +428,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The user name for login | @@ -365,20 +444,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LogoutUser - -# **LogoutUser** > void LogoutUser () Logs out current logged in user session ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -388,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -407,6 +500,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -419,13 +513,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateUser - -# **UpdateUser** > void UpdateUser (string username, User user) Updated user @@ -433,8 +536,9 @@ Updated user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -444,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var user = new User(); // User | Updated user object @@ -455,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -466,6 +573,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | @@ -481,8 +589,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/git_push.sh b/samples/openapi3/client/petstore/csharp/OpenAPIClient/git_push.sh index 4d22bfef4d71..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/git_push.sh +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh b/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh index 039eba8ed42a..ef4209de27b2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh @@ -14,9 +14,9 @@ wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe mozroots --import --sync mono nuget.exe install src/Org.OpenAPITools.Test/packages.config -o packages -echo "[INFO] Install NUnit runners via NuGet" -mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages +echo "[INFO] Install NUnit Console 3.x runners via NuGet" +mono nuget.exe install NUnit.ConsoleRunner -Version 3.10.0 -OutputDirectory packages echo "[INFO] Build the solution and run the unit test" xbuild Org.OpenAPITools.sln && \ - mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/Org.OpenAPITools.Test/bin/Debug/Org.OpenAPITools.Test.dll + mono ./packages/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe src/Org.OpenAPITools.Test/bin/Debug/Org.OpenAPITools.Test.dll diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs new file mode 100644 index 000000000000..d7afe6310fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing CatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatAllOfTests + { + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of CatAllOf + /// + [Test] + public void CatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" CatAllOf + //Assert.IsInstanceOf(typeof(CatAllOf), instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Test] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 000000000000..30f5bed38e19 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of DogAllOf + /// + [Test] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" DogAllOf + //Assert.IsInstanceOf(typeof(DogAllOf), instance); + } + + + /// + /// Test the property 'Breed' + /// + [Test] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config index ac390c1dcb3c..a3a1bab35101 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config @@ -1,7 +1,7 @@ - + - - + + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 563a1e9f64ab..558709f5d014 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -197,7 +197,7 @@ public ModelClient Call123TestSpecialTags (ModelClient modelClient) /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient) + public ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient) { // verify the required parameter 'modelClient' is set if (modelClient == null) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs index 20e11dbf458e..9a524e2177be 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -191,7 +191,7 @@ public InlineResponseDefault FooGet () /// /// Thrown when fails to make API call /// ApiResponse of InlineResponseDefault - public ApiResponse< InlineResponseDefault > FooGetWithHttpInfo () + public ApiResponse FooGetWithHttpInfo () { var localVarPath = "/foo"; diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 22f8ef1bafce..03488173822d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -44,6 +44,31 @@ public interface IFakeApi : IApiAccessor /// ApiResponse of HealthCheckResult ApiResponse FakeHealthGetWithHttpInfo (); /// + /// test http signature authentication + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// + void FakeHttpSignatureTest (Pet pet, string query1 = default(string), string header1 = default(string)); + + /// + /// test http signature authentication + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// ApiResponse of Object(void) + ApiResponse FakeHttpSignatureTestWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)); + /// /// /// /// @@ -51,8 +76,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool? body = default(bool?)); /// /// @@ -62,8 +87,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = default(bool?)); /// /// /// @@ -73,7 +98,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = default(OuterComposite)); /// /// @@ -84,7 +109,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = default(OuterComposite)); /// /// /// @@ -93,8 +118,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal? body = default(decimal?)); /// /// @@ -104,8 +129,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = default(decimal?)); /// /// /// @@ -115,7 +140,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input string as post body (optional) /// string - string FakeOuterStringSerialize (string body = null); + string FakeOuterStringSerialize (string body = default(string)); /// /// @@ -126,7 +151,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)); /// /// /// @@ -214,7 +239,7 @@ public interface IFakeApi : IApiAccessor /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -238,7 +263,7 @@ public interface IFakeApi : IApiAccessor /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -255,7 +280,7 @@ public interface IFakeApi : IApiAccessor /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -273,7 +298,7 @@ public interface IFakeApi : IApiAccessor /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -288,7 +313,7 @@ public interface IFakeApi : IApiAccessor /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); /// /// Fake endpoint to test group parameters (optional) @@ -304,7 +329,7 @@ public interface IFakeApi : IApiAccessor /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); /// /// test inline additionalProperties /// @@ -349,6 +374,35 @@ public interface IFakeApi : IApiAccessor /// field2 /// ApiResponse of Object(void) ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -371,6 +425,31 @@ public interface IFakeApi : IApiAccessor /// Task of ApiResponse (HealthCheckResult) System.Threading.Tasks.Task> FakeHealthGetAsyncWithHttpInfo (); /// + /// test http signature authentication + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Task of void + System.Threading.Tasks.Task FakeHttpSignatureTestAsync (Pet pet, string query1 = default(string), string header1 = default(string)); + + /// + /// test http signature authentication + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> FakeHttpSignatureTestAsyncWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)); + /// /// /// /// @@ -378,8 +457,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); + /// Task of bool + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)); /// /// @@ -389,8 +468,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); + /// Task of ApiResponse (bool) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)); /// /// /// @@ -400,7 +479,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = default(OuterComposite)); /// /// @@ -411,7 +490,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = default(OuterComposite)); /// /// /// @@ -420,8 +499,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); + /// Task of decimal + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)); /// /// @@ -431,8 +510,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); + /// Task of ApiResponse (decimal) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)); /// /// /// @@ -442,7 +521,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); /// /// @@ -453,7 +532,7 @@ public interface IFakeApi : IApiAccessor /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); /// /// /// @@ -541,7 +620,7 @@ public interface IFakeApi : IApiAccessor /// None (optional) /// None (optional) /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -565,7 +644,7 @@ public interface IFakeApi : IApiAccessor /// None (optional) /// None (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -582,7 +661,7 @@ public interface IFakeApi : IApiAccessor /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -600,7 +679,7 @@ public interface IFakeApi : IApiAccessor /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -615,7 +694,7 @@ public interface IFakeApi : IApiAccessor /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); /// /// Fake endpoint to test group parameters (optional) @@ -631,7 +710,7 @@ public interface IFakeApi : IApiAccessor /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); /// /// test inline additionalProperties /// @@ -676,6 +755,35 @@ public interface IFakeApi : IApiAccessor /// field2 /// Task of ApiResponse System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Asynchronous Operations } @@ -803,7 +911,7 @@ public HealthCheckResult FakeHealthGet () /// /// Thrown when fails to make API call /// ApiResponse of HealthCheckResult - public ApiResponse< HealthCheckResult > FakeHealthGetWithHttpInfo () + public ApiResponse FakeHealthGetWithHttpInfo () { var localVarPath = "/fake/health"; @@ -908,15 +1016,176 @@ public async System.Threading.Tasks.Task> FakeHea (HealthCheckResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(HealthCheckResult))); } + /// + /// test http signature authentication + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// + public void FakeHttpSignatureTest (Pet pet, string query1 = default(string), string header1 = default(string)) + { + FakeHttpSignatureTestWithHttpInfo(pet, query1, header1); + } + + /// + /// test http signature authentication + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// ApiResponse of Object(void) + public ApiResponse FakeHttpSignatureTestWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling FakeApi->FakeHttpSignatureTest"); + + var localVarPath = "/fake/http-signature-test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (query1 != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query_1", query1)); // query parameter + if (header1 != null) localVarHeaderParams.Add("header_1", this.Configuration.ApiClient.ParameterToString(header1)); // header parameter + if (pet != null && pet.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + } + else + { + localVarPostBody = pet; // byte array + } + + // authentication (http_signature_test) required + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeHttpSignatureTest", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// test http signature authentication + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Task of void + public async System.Threading.Tasks.Task FakeHttpSignatureTestAsync (Pet pet, string query1 = default(string), string header1 = default(string)) + { + await FakeHttpSignatureTestAsyncWithHttpInfo(pet, query1, header1); + + } + + /// + /// test http signature authentication + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// query parameter (optional) + /// header parameter (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> FakeHttpSignatureTestAsyncWithHttpInfo (Pet pet, string query1 = default(string), string header1 = default(string)) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling FakeApi->FakeHttpSignatureTest"); + + var localVarPath = "/fake/http-signature-test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (query1 != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query_1", query1)); // query parameter + if (header1 != null) localVarHeaderParams.Add("header_1", this.Configuration.ApiClient.ParameterToString(header1)); // header parameter + if (pet != null && pet.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + } + else + { + localVarPostBody = pet; // byte array + } + + // authentication (http_signature_test) required + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeHttpSignatureTest", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + /// /// Test serialization of outer boolean types /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool? body = default(bool?)) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -925,8 +1194,8 @@ public async System.Threading.Tasks.Task> FakeHea /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = default(bool?)) { var localVarPath = "/fake/outer/boolean"; @@ -974,9 +1243,9 @@ public async System.Threading.Tasks.Task> FakeHea if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -984,10 +1253,10 @@ public async System.Threading.Tasks.Task> FakeHea /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) + /// Task of bool + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -997,8 +1266,8 @@ public async System.Threading.Tasks.Task> FakeHea /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) + /// Task of ApiResponse (bool) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)) { var localVarPath = "/fake/outer/boolean"; @@ -1046,9 +1315,9 @@ public async System.Threading.Tasks.Task> FakeHea if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1057,7 +1326,7 @@ public async System.Threading.Tasks.Task> FakeHea /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = default(OuterComposite)) { ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); return localVarResponse.Data; @@ -1069,7 +1338,7 @@ public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null) + public ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -1128,7 +1397,7 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = default(OuterComposite)) { ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite); return localVarResponse.Data; @@ -1141,7 +1410,7 @@ public async System.Threading.Tasks.Task FakeOuterCompositeSeria /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -1199,10 +1468,10 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal? body = default(decimal?)) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1211,8 +1480,8 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = default(decimal?)) { var localVarPath = "/fake/outer/number"; @@ -1260,9 +1529,9 @@ public async System.Threading.Tasks.Task> FakeOuterC if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1270,10 +1539,10 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) + /// Task of decimal + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1283,8 +1552,8 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) + /// Task of ApiResponse (decimal) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)) { var localVarPath = "/fake/outer/number"; @@ -1332,9 +1601,9 @@ public async System.Threading.Tasks.Task> FakeOuterC if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1343,7 +1612,7 @@ public async System.Threading.Tasks.Task> FakeOuterC /// Thrown when fails to make API call /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize (string body = null) + public string FakeOuterStringSerialize (string body = default(string)) { ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1355,7 +1624,7 @@ public string FakeOuterStringSerialize (string body = null) /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) + public ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -1414,7 +1683,7 @@ public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) { ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1427,7 +1696,7 @@ public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync ( /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -1800,7 +2069,7 @@ public ModelClient TestClientModel (ModelClient modelClient) /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient) + public ApiResponse TestClientModelWithHttpInfo (ModelClient modelClient) { // verify the required parameter 'modelClient' is set if (modelClient == null) @@ -1950,7 +2219,7 @@ public async System.Threading.Tasks.Task> TestClientMod /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -1974,7 +2243,7 @@ public void TestEndpointParameters (decimal? number, double? _double, string pat /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2069,7 +2338,7 @@ public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, /// None (optional) /// None (optional) /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); @@ -2094,7 +2363,7 @@ public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? n /// None (optional) /// None (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2183,7 +2452,7 @@ public async System.Threading.Tasks.Task> TestEndpointParame /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -2201,7 +2470,7 @@ public void TestEnumParameters (List enumHeaderStringArray = null, strin /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -2231,7 +2500,7 @@ public ApiResponse TestEnumParametersWithHttpInfo (List enumHead if (enumQueryDouble != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_double", enumQueryDouble)); // query parameter if (enumHeaderStringArray != null) localVarHeaderParams.Add("enum_header_string_array", this.Configuration.ApiClient.ParameterToString(enumHeaderStringArray)); // header parameter if (enumHeaderString != null) localVarHeaderParams.Add("enum_header_string", this.Configuration.ApiClient.ParameterToString(enumHeaderString)); // header parameter - if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", this.Configuration.ApiClient.ParameterToString(enumFormStringArray)); // form parameter + if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", this.Configuration.ApiClient.Serialize(enumFormStringArray)); // form parameter if (enumFormString != null) localVarFormParams.Add("enum_form_string", this.Configuration.ApiClient.ParameterToString(enumFormString)); // form parameter @@ -2266,7 +2535,7 @@ public ApiResponse TestEnumParametersWithHttpInfo (List enumHead /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) { await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); @@ -2285,7 +2554,7 @@ public async System.Threading.Tasks.Task TestEnumParametersAsync (List e /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -2315,7 +2584,7 @@ public async System.Threading.Tasks.Task> TestEnumParameters if (enumQueryDouble != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_double", enumQueryDouble)); // query parameter if (enumHeaderStringArray != null) localVarHeaderParams.Add("enum_header_string_array", this.Configuration.ApiClient.ParameterToString(enumHeaderStringArray)); // header parameter if (enumHeaderString != null) localVarHeaderParams.Add("enum_header_string", this.Configuration.ApiClient.ParameterToString(enumHeaderString)); // header parameter - if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", this.Configuration.ApiClient.ParameterToString(enumFormStringArray)); // form parameter + if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", this.Configuration.ApiClient.Serialize(enumFormStringArray)); // form parameter if (enumFormString != null) localVarFormParams.Add("enum_form_string", this.Configuration.ApiClient.ParameterToString(enumFormString)); // form parameter @@ -2348,7 +2617,7 @@ public async System.Threading.Tasks.Task> TestEnumParameters /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -2364,7 +2633,7 @@ public void TestGroupParameters (int? requiredStringGroup, bool? requiredBoolean /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) @@ -2404,10 +2673,10 @@ public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringG if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter // authentication (bearer_test) required - // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + // http beerer authentication required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { - localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; } // make the HTTP request @@ -2439,7 +2708,7 @@ public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringG /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); @@ -2456,7 +2725,7 @@ public async System.Threading.Tasks.Task TestGroupParametersAsync (int? required /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) @@ -2496,10 +2765,10 @@ public async System.Threading.Tasks.Task> TestGroupParameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter // authentication (bearer_test) required - // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + // http bearer authentication required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { - localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; } // make the HTTP request @@ -2808,5 +3077,182 @@ public async System.Threading.Tasks.Task> TestJsonFormDataAs null); } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + { + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'http' is set + if (http == null) + throw new ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'url' is set + if (url == null) + throw new ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'context' is set + if (context == null) + throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + var localVarPath = "/fake/test-query-paramters"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "pipe", pipe)); // query parameter + if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter + if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + { + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'http' is set + if (http == null) + throw new ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'url' is set + if (url == null) + throw new ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'context' is set + if (context == null) + throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + var localVarPath = "/fake/test-query-paramters"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "pipe", pipe)); // query parameter + if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter + if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + } } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 9ff2cf1d8611..3e40d789b421 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -197,7 +197,7 @@ public ModelClient TestClassname (ModelClient modelClient) /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient) + public ApiResponse TestClassnameWithHttpInfo (ModelClient modelClient) { // verify the required parameter 'modelClient' is set if (modelClient == null) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 2385be9dc63f..06279f072038 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -55,7 +55,7 @@ public interface IPetApi : IApiAccessor /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -67,7 +67,7 @@ public interface IPetApi : IApiAccessor /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -163,7 +163,7 @@ public interface IPetApi : IApiAccessor /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ public interface IPetApi : IApiAccessor /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -188,7 +188,7 @@ public interface IPetApi : IApiAccessor /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -201,7 +201,7 @@ public interface IPetApi : IApiAccessor /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -213,7 +213,7 @@ public interface IPetApi : IApiAccessor /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -226,7 +226,7 @@ public interface IPetApi : IApiAccessor /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -260,7 +260,7 @@ public interface IPetApi : IApiAccessor /// Pet id to delete /// (optional) /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -272,7 +272,7 @@ public interface IPetApi : IApiAccessor /// Pet id to delete /// (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -324,7 +324,7 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId); /// /// Find pet by ID @@ -335,7 +335,7 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -368,7 +368,7 @@ public interface IPetApi : IApiAccessor /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -381,7 +381,7 @@ public interface IPetApi : IApiAccessor /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -393,7 +393,7 @@ public interface IPetApi : IApiAccessor /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -406,7 +406,7 @@ public interface IPetApi : IApiAccessor /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -418,7 +418,7 @@ public interface IPetApi : IApiAccessor /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -431,7 +431,7 @@ public interface IPetApi : IApiAccessor /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Asynchronous Operations } @@ -709,7 +709,7 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = default(string)) { DeletePetWithHttpInfo(petId, apiKey); } @@ -721,7 +721,7 @@ public void DeletePet (long? petId, string apiKey = null) /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -782,7 +782,7 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n /// Pet id to delete /// (optional) /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) { await DeletePetAsyncWithHttpInfo(petId, apiKey); @@ -795,7 +795,7 @@ public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string api /// Pet id to delete /// (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -867,7 +867,7 @@ public List FindPetsByStatus (List status) /// Thrown when fails to make API call /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + public ApiResponse> FindPetsByStatusWithHttpInfo (List status) { // verify the required parameter 'status' is set if (status == null) @@ -1014,7 +1014,7 @@ public List FindPetsByTags (List tags) /// Thrown when fails to make API call /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + public ApiResponse> FindPetsByTagsWithHttpInfo (List tags) { // verify the required parameter 'tags' is set if (tags == null) @@ -1149,7 +1149,7 @@ public async System.Threading.Tasks.Task>> FindPetsByTagsA /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -1161,7 +1161,7 @@ public Pet GetPetById (long? petId) /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1221,7 +1221,7 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) { ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); return localVarResponse.Data; @@ -1234,7 +1234,7 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1455,7 +1455,7 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -1468,7 +1468,7 @@ public void UpdatePetWithForm (long? petId, string name = null, string status = /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1532,7 +1532,7 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string na /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) { await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); @@ -1546,7 +1546,7 @@ public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, st /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1610,7 +1610,7 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1624,7 +1624,7 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Sy /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1704,7 +1704,7 @@ public async System.Threading.Tasks.Task UploadFileAsync (long? pet /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1769,7 +1769,7 @@ public async System.Threading.Tasks.Task> UploadFileAsy /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1783,7 +1783,7 @@ public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream req /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1851,7 +1851,7 @@ public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1866,7 +1866,7 @@ public async System.Threading.Tasks.Task UploadFileWithRequiredFile /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index e84290e5a6b9..5929ce68a649 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -52,8 +52,8 @@ public interface IStoreApi : IApiAccessor /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ public interface IStoreApi : IApiAccessor /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ public interface IStoreApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ public interface IStoreApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -136,8 +136,8 @@ public interface IStoreApi : IApiAccessor /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - System.Threading.Tasks.Task> GetInventoryAsync (); + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync (); /// /// Returns pet inventories by status @@ -146,8 +146,8 @@ public interface IStoreApi : IApiAccessor /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// /// Find purchase order by ID /// @@ -157,7 +157,7 @@ public interface IStoreApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); /// /// Find purchase order by ID @@ -168,7 +168,7 @@ public interface IStoreApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -434,10 +434,10 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -445,8 +445,8 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse> GetInventoryWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -490,19 +490,19 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - public async System.Threading.Tasks.Task> GetInventoryAsync () + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync () { - ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); return localVarResponse.Data; } @@ -511,8 +511,8 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -556,9 +556,9 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -567,7 +567,7 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -579,7 +579,7 @@ public Order GetOrderById (long? orderId) /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -634,7 +634,7 @@ public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) { ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); return localVarResponse.Data; @@ -647,7 +647,7 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -714,7 +714,7 @@ public Order PlaceOrder (Order order) /// Thrown when fails to make API call /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) + public ApiResponse PlaceOrderWithHttpInfo (Order order) { // verify the required parameter 'order' is set if (order == null) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index b2d8fe094c8f..2584bed7b2dd 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -1059,7 +1059,7 @@ public User GetUserByName (string username) /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. /// ApiResponse of User - public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + public ApiResponse GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set if (username == null) @@ -1196,7 +1196,7 @@ public string LoginUser (string username, string password) /// The user name for login /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + public ApiResponse LoginUserWithHttpInfo (string username, string password) { // verify the required parameter 'username' is set if (username == null) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 030d56543c4b..9ccb39dfeedd 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -202,6 +202,7 @@ public async System.Threading.Tasks.Task CallApiAsync( var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, contentType); + RestClient.UserAgent = Configuration.UserAgent; InterceptRequest(request); var response = await RestClient.ExecuteTaskAsync(request); InterceptResponse(request, response); @@ -253,6 +254,8 @@ public string ParameterToString(object obj) // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); @@ -497,6 +500,7 @@ public static string SanitizeFilename(string filename) /// Convert params to key/value pairs. /// Use collectionFormat to properly format lists and collections. /// + /// Collection format. /// Key name. /// Value object. /// A list of KeyValuePairs diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs index 875026e65f41..e7ac15569b93 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs index 3e395de9dfbb..4b462cf5424d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index b530746cb5a1..926007e22caf 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs index 66c4aa3a1408..d855d96821f2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 309e385f25a7..a79bea966bd5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs index 3b4834c409df..cd03e8c1f975 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 76a5f5124fdf..23e1a0c2e197 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs index 4f5c219d5c6e..a1bd6b08f3b1 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index adafe21ea167..fa5137751772 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -100,11 +100,13 @@ public bool Equals(AdditionalPropertiesClass input) ( this.MapProperty == input.MapProperty || this.MapProperty != null && + input.MapProperty != null && this.MapProperty.SequenceEqual(input.MapProperty) ) && ( this.MapOfMapProperty == input.MapOfMapProperty || this.MapOfMapProperty != null && + input.MapOfMapProperty != null && this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 16c89207e31d..fe04c33922f4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -29,7 +29,7 @@ namespace Org.OpenAPITools.Model /// Animal /// [DataContract] - [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonConverter(typeof(JsonSubtypes), "className")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] public partial class Animal : IEquatable, IValidatableObject @@ -55,6 +55,7 @@ protected Animal() { } { this.ClassName = className; } + // use default value if no "color" provided if (color == null) { @@ -69,7 +70,7 @@ protected Animal() { } /// /// Gets or Sets ClassName /// - [DataMember(Name="className", EmitDefaultValue=false)] + [DataMember(Name="className", EmitDefaultValue=true)] public string ClassName { get; set; } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs index da35fa03b6dc..8f5a5a0e5a90 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -36,7 +36,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -47,7 +47,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index eb23cf99943f..0342fb2ce660 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatable class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -43,7 +43,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatable [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object @@ -91,6 +91,7 @@ public bool Equals(ArrayOfArrayOfNumberOnly input) ( this.ArrayArrayNumber == input.ArrayArrayNumber || this.ArrayArrayNumber != null && + input.ArrayArrayNumber != null && this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index a1aac93fc2fa..1b87d630d20f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValida /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -43,7 +43,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValida /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object @@ -91,6 +91,7 @@ public bool Equals(ArrayOfNumberOnly input) ( this.ArrayNumber == input.ArrayNumber || this.ArrayNumber != null && + input.ArrayNumber != null && this.ArrayNumber.SequenceEqual(input.ArrayNumber) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs index c99d9289344a..10886bb6af62 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -36,7 +36,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -53,7 +53,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel @@ -109,16 +109,19 @@ public bool Equals(ArrayTest input) ( this.ArrayOfString == input.ArrayOfString || this.ArrayOfString != null && + input.ArrayOfString != null && this.ArrayOfString.SequenceEqual(input.ArrayOfString) ) && ( this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || this.ArrayArrayOfInteger != null && + input.ArrayArrayOfInteger != null && this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) ) && ( this.ArrayArrayOfModel == input.ArrayArrayOfModel || this.ArrayArrayOfModel != null && + input.ArrayArrayOfModel != null && this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs index eba3bc685996..058ce89df0d7 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 1504638f6f26..e4cfa3fbef4d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -39,7 +39,7 @@ protected Cat() { } /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -48,7 +48,7 @@ protected Cat() { } /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..3d452f64b382 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract] + public partial class CatAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public 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 CatAllOf); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.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/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index a795fc58c582..2901d8bf67c4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -40,7 +40,7 @@ protected Category() { } /// /// id. /// name (required) (default to "default-name"). - public Category(long? id = default(long?), string name = "default-name") + public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) if (name == null) @@ -51,6 +51,7 @@ protected Category() { } { this.Name = name; } + this.Id = id; } @@ -58,12 +59,12 @@ protected Category() { } /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name /// - [DataMember(Name="name", EmitDefaultValue=false)] + [DataMember(Name="name", EmitDefaultValue=true)] public string Name { get; set; } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs index 30753a34e643..4a7d5372a1a8 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index ecd67f40b6e2..b925fb99c324 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -39,7 +39,7 @@ protected Dog() { } /// Initializes a new instance of the class. /// /// breed. - public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) { this.Breed = breed; } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..24d4b43de854 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract] + public partial class DogAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public 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 DogAllOf); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + if (input == null) + return false; + + return + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs index 567a207068c2..6887c901d117 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -146,6 +146,7 @@ public bool Equals(EnumArrays input) ( this.ArrayEnum == input.ArrayEnum || this.ArrayEnum != null && + input.ArrayEnum != null && this.ArrayEnum.SequenceEqual(input.ArrayEnum) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs index 33643e475f51..96e427f9b327 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index 381572d5dfe3..31a584440558 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -90,7 +90,7 @@ public enum EnumStringRequiredEnum /// /// Gets or Sets EnumStringRequired /// - [DataMember(Name="enum_string_required", EmitDefaultValue=false)] + [DataMember(Name="enum_string_required", EmitDefaultValue=true)] public EnumStringRequiredEnum EnumStringRequired { get; set; } /// /// Defines EnumInteger @@ -140,6 +140,26 @@ public enum EnumNumberEnum [DataMember(Name="enum_number", EmitDefaultValue=false)] public EnumNumberEnum? EnumNumber { get; set; } /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name="outerEnum", EmitDefaultValue=true)] + public OuterEnum? OuterEnum { get; set; } + /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name="outerEnumInteger", EmitDefaultValue=false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name="outerEnumDefaultValue", EmitDefaultValue=false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name="outerEnumIntegerDefaultValue", EmitDefaultValue=false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] @@ -155,7 +175,7 @@ protected EnumTest() { } /// outerEnumInteger. /// outerEnumDefaultValue. /// outerEnumIntegerDefaultValue. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum), OuterEnumInteger outerEnumInteger = default(OuterEnumInteger), OuterEnumDefaultValue outerEnumDefaultValue = default(OuterEnumDefaultValue), OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue)) + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) { // to ensure "enumStringRequired" is required (not null) if (enumStringRequired == null) @@ -166,6 +186,8 @@ protected EnumTest() { } { this.EnumStringRequired = enumStringRequired; } + + this.OuterEnum = outerEnum; this.EnumString = enumString; this.EnumInteger = enumInteger; this.EnumNumber = enumNumber; @@ -179,29 +201,9 @@ protected EnumTest() { } - /// - /// Gets or Sets OuterEnum - /// - [DataMember(Name="outerEnum", EmitDefaultValue=false)] - public OuterEnum OuterEnum { get; set; } - /// - /// Gets or Sets OuterEnumInteger - /// - [DataMember(Name="outerEnumInteger", EmitDefaultValue=false)] - public OuterEnumInteger OuterEnumInteger { get; set; } - /// - /// Gets or Sets OuterEnumDefaultValue - /// - [DataMember(Name="outerEnumDefaultValue", EmitDefaultValue=false)] - public OuterEnumDefaultValue OuterEnumDefaultValue { get; set; } - /// - /// Gets or Sets OuterEnumIntegerDefaultValue - /// - [DataMember(Name="outerEnumIntegerDefaultValue", EmitDefaultValue=false)] - public OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs index 68d564d17e72..3cf268524f93 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 7853ca2a0de3..73a8b61aa754 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -105,6 +105,7 @@ public bool Equals(FileSchemaTestClass input) ( this.Files == input.Files || this.Files != null && + input.Files != null && this.Files.SequenceEqual(input.Files) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs index 394f5adc052a..5f3b3bcd9d52 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index 195270a84710..202bd2d47177 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -53,7 +53,7 @@ protected FormatTest() { } /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - 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[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = 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[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -64,6 +64,7 @@ protected FormatTest() { } { this.Number = number; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -73,6 +74,7 @@ protected FormatTest() { } { this.Byte = _byte; } + // to ensure "date" is required (not null) if (date == null) { @@ -82,6 +84,7 @@ protected FormatTest() { } { this.Date = date; } + // to ensure "password" is required (not null) if (password == null) { @@ -91,6 +94,7 @@ protected FormatTest() { } { this.Password = password; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; @@ -108,37 +112,37 @@ protected FormatTest() { } /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// - [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + [DataMember(Name="number", EmitDefaultValue=true)] + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -149,7 +153,7 @@ protected FormatTest() { } /// /// Gets or Sets Byte /// - [DataMember(Name="byte", EmitDefaultValue=false)] + [DataMember(Name="byte", EmitDefaultValue=true)] public byte[] Byte { get; set; } /// @@ -161,26 +165,26 @@ protected FormatTest() { } /// /// Gets or Sets Date /// - [DataMember(Name="date", EmitDefaultValue=false)] + [DataMember(Name="date", EmitDefaultValue=true)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password /// - [DataMember(Name="password", EmitDefaultValue=false)] + [DataMember(Name="password", EmitDefaultValue=true)] public string Password { get; set; } /// @@ -381,66 +385,78 @@ public override int GetHashCode() /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // Integer (int?) maximum - if(this.Integer > (int?)100) + + + // Integer (int) maximum + if(this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } - // Integer (int?) minimum - if(this.Integer < (int?)10) + // Integer (int) minimum + if(this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } - // Int32 (int?) maximum - if(this.Int32 > (int?)200) + + + // Int32 (int) maximum + if(this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } - // Int32 (int?) minimum - if(this.Int32 < (int?)20) + // Int32 (int) minimum + if(this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal?) maximum - if(this.Number > (decimal?)543.2) + + + // Number (decimal) maximum + if(this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } - // Number (decimal?) minimum - if(this.Number < (decimal?)32.1) + // Number (decimal) minimum + if(this.Number < (decimal)32.1) { 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" }); } - // 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" }); } - // 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" }); } - // 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" }); } + + // String (string) pattern Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) @@ -459,7 +475,9 @@ public override int GetHashCode() { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } + + // PatternWithDigits (string) pattern Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) @@ -467,6 +485,8 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } + + // PatternWithDigitsAndDelimiter (string) pattern Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 520640366921..10b9939f5ad3 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 08dd777f5b79..dffd3ccfa611 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -37,12 +37,13 @@ public partial class HealthCheckResult : IEquatable, IValida public HealthCheckResult(string nullableMessage = default(string)) { this.NullableMessage = nullableMessage; + this.NullableMessage = nullableMessage; } /// /// Gets or Sets NullableMessage /// - [DataMember(Name="NullableMessage", EmitDefaultValue=false)] + [DataMember(Name="NullableMessage", EmitDefaultValue=true)] public string NullableMessage { get; set; } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs index 95ea944a8c61..7a3a6114012c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs index 473147e67492..f08aeb4eb375 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs index c354d941f270..5e512e7d3b94 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -158,6 +158,7 @@ public bool Equals(InlineObject2 input) ( this.EnumFormStringArray == input.EnumFormStringArray || this.EnumFormStringArray != null && + input.EnumFormStringArray != null && this.EnumFormStringArray.SequenceEqual(input.EnumFormStringArray) ) && ( diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs index cb7c53f698de..65d38e748173 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -52,7 +52,7 @@ protected InlineObject3() { } /// None. /// None. /// None. - public InlineObject3(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), string patternWithoutDelimiter = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public InlineObject3(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), string patternWithoutDelimiter = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -63,6 +63,7 @@ protected InlineObject3() { } { this.Number = number; } + // to ensure "_double" is required (not null) if (_double == null) { @@ -72,6 +73,7 @@ protected InlineObject3() { } { this.Double = _double; } + // to ensure "patternWithoutDelimiter" is required (not null) if (patternWithoutDelimiter == null) { @@ -81,6 +83,7 @@ protected InlineObject3() { } { this.PatternWithoutDelimiter = patternWithoutDelimiter; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -90,6 +93,7 @@ protected InlineObject3() { } { this.Byte = _byte; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; @@ -107,42 +111,42 @@ protected InlineObject3() { } /// /// None [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// None /// /// None [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// None /// /// None [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// None /// /// None - [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + [DataMember(Name="number", EmitDefaultValue=true)] + public decimal Number { get; set; } /// /// None /// /// None [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// None /// /// None - [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + [DataMember(Name="double", EmitDefaultValue=true)] + public double Double { get; set; } /// /// None @@ -155,14 +159,14 @@ protected InlineObject3() { } /// None /// /// None - [DataMember(Name="pattern_without_delimiter", EmitDefaultValue=false)] + [DataMember(Name="pattern_without_delimiter", EmitDefaultValue=true)] public string PatternWithoutDelimiter { get; set; } /// /// None /// /// None - [DataMember(Name="byte", EmitDefaultValue=false)] + [DataMember(Name="byte", EmitDefaultValue=true)] public byte[] Byte { get; set; } /// @@ -178,14 +182,14 @@ protected InlineObject3() { } /// None [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// None /// /// None [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// None @@ -377,60 +381,72 @@ public override int GetHashCode() /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // Integer (int?) maximum - if(this.Integer > (int?)100) + + + // Integer (int) maximum + if(this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } - // Integer (int?) minimum - if(this.Integer < (int?)10) + // Integer (int) minimum + if(this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } - // Int32 (int?) maximum - if(this.Int32 > (int?)200) + + + // Int32 (int) maximum + if(this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } - // Int32 (int?) minimum - if(this.Int32 < (int?)20) + // Int32 (int) minimum + if(this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal?) maximum - if(this.Number > (decimal?)543.2) + + + // Number (decimal) maximum + if(this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } - // Number (decimal?) minimum - if(this.Number < (decimal?)32.1) + // Number (decimal) minimum + if(this.Number < (decimal)32.1) { 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" }); } - // 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" }); } - // 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" }); } + + // String (string) pattern Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) @@ -438,6 +454,8 @@ public override int GetHashCode() yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } + + // PatternWithoutDelimiter (string) pattern Regex regexPatternWithoutDelimiter = new Regex(@"^[A-Z].*", RegexOptions.CultureInvariant); if (false == regexPatternWithoutDelimiter.Match(this.PatternWithoutDelimiter).Success) @@ -456,7 +474,7 @@ public override int GetHashCode() { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } - + yield break; } } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs index 70326154bfce..8d3147b9ff1b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -51,6 +51,7 @@ protected InlineObject4() { } { this.Param = param; } + // to ensure "param2" is required (not null) if (param2 == null) { @@ -60,20 +61,21 @@ protected InlineObject4() { } { this.Param2 = param2; } + } /// /// field1 /// /// field1 - [DataMember(Name="param", EmitDefaultValue=false)] + [DataMember(Name="param", EmitDefaultValue=true)] public string Param { get; set; } /// /// field2 /// /// field2 - [DataMember(Name="param2", EmitDefaultValue=false)] + [DataMember(Name="param2", EmitDefaultValue=true)] public string Param2 { get; set; } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs index 8821e41a8ac7..ef1951597cc1 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -51,6 +51,7 @@ protected InlineObject5() { } { this.RequiredFile = requiredFile; } + this.AdditionalMetadata = additionalMetadata; } @@ -65,7 +66,7 @@ protected InlineObject5() { } /// file to upload /// /// file to upload - [DataMember(Name="requiredFile", EmitDefaultValue=false)] + [DataMember(Name="requiredFile", EmitDefaultValue=true)] public System.IO.Stream RequiredFile { get; set; } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index a264f2e0b2fb..a553a49ec799 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs index 14c7ed746a0e..6b3ace11cf4e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index 3f44bcf22eaa..71368b4b44d6 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -63,7 +63,7 @@ public enum InnerEnum /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -82,13 +82,13 @@ public enum InnerEnum /// Gets or Sets DirectMap /// [DataMember(Name="direct_map", EmitDefaultValue=false)] - public Dictionary DirectMap { get; set; } + public Dictionary DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public Dictionary IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } /// /// Returns the string presentation of the object @@ -139,21 +139,25 @@ public bool Equals(MapTest input) ( this.MapMapOfString == input.MapMapOfString || this.MapMapOfString != null && + input.MapMapOfString != null && this.MapMapOfString.SequenceEqual(input.MapMapOfString) ) && ( this.MapOfEnumString == input.MapOfEnumString || this.MapOfEnumString != null && + input.MapOfEnumString != null && this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) ) && ( this.DirectMap == input.DirectMap || this.DirectMap != null && + input.DirectMap != null && this.DirectMap.SequenceEqual(input.DirectMap) ) && ( this.IndirectMap == input.IndirectMap || this.IndirectMap != null && + input.IndirectMap != null && this.IndirectMap.SequenceEqual(input.IndirectMap) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 19df6fd34891..627a4d358b76 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -36,7 +36,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableuuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -47,13 +47,13 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map @@ -119,6 +119,7 @@ public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) ( this.Map == input.Map || this.Map != null && + input.Map != null && this.Map.SequenceEqual(input.Map) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs index 69767330c053..58853af412d9 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -35,7 +35,7 @@ public partial class Model200Response : IEquatable, IValidata /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -45,7 +45,7 @@ public partial class Model200Response : IEquatable, IValidata /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs index 2e9d79ef1419..2d93513c7681 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index 68f848ca0915..c22d454e1ea4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -40,7 +40,7 @@ protected Name() { } /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -51,20 +51,21 @@ protected Name() { } { this._Name = name; } + this.Property = property; } /// /// Gets or Sets _Name /// - [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + [DataMember(Name="name", EmitDefaultValue=true)] + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -76,7 +77,7 @@ protected Name() { } /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs index 2feb2eb9aead..c7aefda57568 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -47,6 +47,16 @@ public partial class NullableClass : Dictionary, IEquatableobjectItemsNullable. public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; this.IntegerProp = integerProp; this.NumberProp = numberProp; this.BooleanProp = booleanProp; @@ -64,50 +74,50 @@ public partial class NullableClass : Dictionary, IEquatable /// Gets or Sets IntegerProp /// - [DataMember(Name="integer_prop", EmitDefaultValue=false)] + [DataMember(Name="integer_prop", EmitDefaultValue=true)] public int? IntegerProp { get; set; } /// /// Gets or Sets NumberProp /// - [DataMember(Name="number_prop", EmitDefaultValue=false)] + [DataMember(Name="number_prop", EmitDefaultValue=true)] public decimal? NumberProp { get; set; } /// /// Gets or Sets BooleanProp /// - [DataMember(Name="boolean_prop", EmitDefaultValue=false)] + [DataMember(Name="boolean_prop", EmitDefaultValue=true)] public bool? BooleanProp { get; set; } /// /// Gets or Sets StringProp /// - [DataMember(Name="string_prop", EmitDefaultValue=false)] + [DataMember(Name="string_prop", EmitDefaultValue=true)] public string StringProp { get; set; } /// /// Gets or Sets DateProp /// - [DataMember(Name="date_prop", EmitDefaultValue=false)] + [DataMember(Name="date_prop", EmitDefaultValue=true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime? DateProp { get; set; } /// /// Gets or Sets DatetimeProp /// - [DataMember(Name="datetime_prop", EmitDefaultValue=false)] + [DataMember(Name="datetime_prop", EmitDefaultValue=true)] public DateTime? DatetimeProp { get; set; } /// /// Gets or Sets ArrayNullableProp /// - [DataMember(Name="array_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="array_nullable_prop", EmitDefaultValue=true)] public List ArrayNullableProp { get; set; } /// /// Gets or Sets ArrayAndItemsNullableProp /// - [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=true)] public List ArrayAndItemsNullableProp { get; set; } /// @@ -119,13 +129,13 @@ public partial class NullableClass : Dictionary, IEquatable /// Gets or Sets ObjectNullableProp /// - [DataMember(Name="object_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="object_nullable_prop", EmitDefaultValue=true)] public Dictionary ObjectNullableProp { get; set; } /// /// Gets or Sets ObjectAndItemsNullableProp /// - [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=true)] public Dictionary ObjectAndItemsNullableProp { get; set; } /// @@ -222,31 +232,37 @@ public bool Equals(NullableClass input) ( this.ArrayNullableProp == input.ArrayNullableProp || this.ArrayNullableProp != null && + input.ArrayNullableProp != null && this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) ) && base.Equals(input) && ( this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) ) && base.Equals(input) && ( this.ArrayItemsNullable == input.ArrayItemsNullable || this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) ) && base.Equals(input) && ( this.ObjectNullableProp == input.ObjectNullableProp || this.ObjectNullableProp != null && + input.ObjectNullableProp != null && this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) ) && base.Equals(input) && ( this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) ) && base.Equals(input) && ( this.ObjectItemsNullable == input.ObjectItemsNullable || this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs index 0d3c613d18bc..62f401d8785f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -43,7 +43,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index f895f035192b..c46c951fd30f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -72,7 +72,7 @@ public enum StatusEnum /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -94,32 +94,32 @@ public enum StatusEnum /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs index 3bb725402152..eef811e72998 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -36,7 +36,7 @@ public partial class OuterComposite : IEquatable, IValidatableO /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,7 +47,7 @@ public partial class OuterComposite : IEquatable, IValidatableO /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -59,7 +59,7 @@ public partial class OuterComposite : IEquatable, IValidatableO /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs index be116aff60ab..e902802e0d60 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs index a49b7640982d..196d097f9584 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs index ea69ed635c87..55aec73401f7 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs index c1262d92aa4c..e265103c92a5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index 1e213e5006ad..681dccedc28d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -77,7 +77,7 @@ protected Pet() { } /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -88,6 +88,7 @@ protected Pet() { } { this.Name = name; } + // to ensure "photoUrls" is required (not null) if (photoUrls == null) { @@ -97,6 +98,7 @@ protected Pet() { } { this.PhotoUrls = photoUrls; } + this.Id = id; this.Category = category; this.Tags = tags; @@ -107,7 +109,7 @@ protected Pet() { } /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category @@ -118,13 +120,13 @@ protected Pet() { } /// /// Gets or Sets Name /// - [DataMember(Name="name", EmitDefaultValue=false)] + [DataMember(Name="name", EmitDefaultValue=true)] public string Name { get; set; } /// /// Gets or Sets PhotoUrls /// - [DataMember(Name="photoUrls", EmitDefaultValue=false)] + [DataMember(Name="photoUrls", EmitDefaultValue=true)] public List PhotoUrls { get; set; } /// @@ -200,11 +202,13 @@ public bool Equals(Pet input) ( this.PhotoUrls == input.PhotoUrls || this.PhotoUrls != null && + input.PhotoUrls != null && this.PhotoUrls.SequenceEqual(input.PhotoUrls) ) && ( this.Tags == input.Tags || this.Tags != null && + input.Tags != null && this.Tags.SequenceEqual(input.Tags) ) && ( diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 6e82eb5819e2..bb1c7edde085 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs index 401b8e2c70d4..c12d15c0a65e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ public partial class Return : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -43,7 +43,7 @@ public partial class Return : IEquatable, IValidatableObject /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 54ea66dd81b2..0cd2939c9e1b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ public partial class SpecialModelName : IEquatable, IValidata /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -43,7 +43,7 @@ public partial class SpecialModelName : IEquatable, IValidata /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs index f95860219eeb..4ed40c915d2a 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -35,7 +35,7 @@ public partial class Tag : IEquatable, IValidatableObject /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -45,7 +45,7 @@ public partial class Tag : IEquatable, IValidatableObject /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs index cf491294ec95..d59b7b04132f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs @@ -3,7 +3,7 @@ * * 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 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -41,7 +41,7 @@ public partial class User : IEquatable, IValidatableObject /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -57,7 +57,7 @@ public partial class User : IEquatable, IValidatableObject /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -100,7 +100,7 @@ public partial class User : IEquatable, IValidatableObject /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index af2274727547..6c69e3745f60 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -4,7 +4,7 @@ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 --> @@ -28,6 +28,7 @@ OpenAPI spec version: 1.0.0 DEBUG;TRACE prompt 4 + bin\Debug\Org.OpenAPITools.xml pdbonly @@ -36,6 +37,7 @@ OpenAPI spec version: 1.0.0 TRACE prompt 4 + bin\Release\Org.OpenAPITools.xml @@ -48,21 +50,21 @@ OpenAPI spec version: 1.0.0 - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + $(SolutionDir)\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll - $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec index 40ee0ddda055..c9ccbe1a8242 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -25,8 +25,8 @@ - - + + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config index 3caf34e0d765..a3a1bab35101 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config @@ -1,6 +1,7 @@ + - - + + diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator/FILES b/samples/server/petstore/nancyfx-async/.openapi-generator/FILES new file mode 100644 index 000000000000..e60e5215dcc4 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/.openapi-generator/FILES @@ -0,0 +1,15 @@ +Org.OpenAPITools.sln +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/Modules/PetModule.cs +src/Org.OpenAPITools/Modules/StoreModule.cs +src/Org.OpenAPITools/Modules/UserModule.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec +src/Org.OpenAPITools/Utils/LocalDateConverter.cs +src/Org.OpenAPITools/Utils/Parameters.cs +src/Org.OpenAPITools/packages.config diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION index f9f7450d1359..d99e7162d01f 100644 --- a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln b/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln new file mode 100644 index 000000000000..757078a1383c --- /dev/null +++ b/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +EndProject +Global +GlobalSection(SolutionConfigurationPlatforms) = preSolution +Debug|Any CPU = Debug|Any CPU +Release|Any CPU = Release|Any CPU +EndGlobalSection +GlobalSection(ProjectConfigurationPlatforms) = postSolution +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +EndGlobalSection +GlobalSection(SolutionProperties) = preSolution +HideSolutionNode = FALSE +EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 000000000000..b10ee5765733 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// Describes the result of uploading an image resource + /// + public sealed class ApiResponse: IEquatable + { + /// + /// Code + /// + public int? Code { get; private set; } + + /// + /// Type + /// + public string Type { get; private set; } + + /// + /// Message + /// + public string Message { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ApiResponse.Builder() for instance creation instead. + /// + [Obsolete] + public ApiResponse() + { + } + + private ApiResponse(int? Code, string Type, string Message) + { + + this.Code = Code; + + this.Type = Type; + + this.Message = Message; + + } + + /// + /// Returns builder of ApiResponse. + /// + /// ApiResponseBuilder + public static ApiResponseBuilder Builder() + { + return new ApiResponseBuilder(); + } + + /// + /// Returns ApiResponseBuilder with properties set. + /// Use it to change properties. + /// + /// ApiResponseBuilder + public ApiResponseBuilder With() + { + return Builder() + .Code(Code) + .Type(Type) + .Message(Message); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ApiResponse other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ApiResponse. + /// + /// Compared (ApiResponse + /// Compared (ApiResponse + /// true if compared items are equals, false otherwise + public static bool operator == (ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ApiResponse. + /// + /// Compared (ApiResponse + /// Compared (ApiResponse + /// true if compared items are not equals, false otherwise + public static bool operator != (ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + /// + /// Builder of ApiResponse. + /// + public sealed class ApiResponseBuilder + { + private int? _Code; + private string _Type; + private string _Message; + + internal ApiResponseBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ApiResponse.Code property. + /// + /// Code + public ApiResponseBuilder Code(int? value) + { + _Code = value; + return this; + } + + /// + /// Sets value for ApiResponse.Type property. + /// + /// Type + public ApiResponseBuilder Type(string value) + { + _Type = value; + return this; + } + + /// + /// Sets value for ApiResponse.Message property. + /// + /// Message + public ApiResponseBuilder Message(string value) + { + _Message = value; + return this; + } + + + /// + /// Builds instance of ApiResponse. + /// + /// ApiResponse + public ApiResponse Build() + { + Validate(); + return new ApiResponse( + Code: _Code, + Type: _Type, + Message: _Message + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 000000000000..23f20131922d --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A category for a pet + /// + public sealed class Category: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Name + /// + public string Name { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Category.Builder() for instance creation instead. + /// + [Obsolete] + public Category() + { + } + + private Category(long? Id, string Name) + { + + this.Id = Id; + + this.Name = Name; + + } + + /// + /// Returns builder of Category. + /// + /// CategoryBuilder + public static CategoryBuilder Builder() + { + return new CategoryBuilder(); + } + + /// + /// Returns CategoryBuilder with properties set. + /// Use it to change properties. + /// + /// CategoryBuilder + public CategoryBuilder With() + { + return Builder() + .Id(Id) + .Name(Name); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Category other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Category. + /// + /// Compared (Category + /// Compared (Category + /// true if compared items are equals, false otherwise + public static bool operator == (Category left, Category right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Category. + /// + /// Compared (Category + /// Compared (Category + /// true if compared items are not equals, false otherwise + public static bool operator != (Category left, Category right) + { + return !Equals(left, right); + } + + /// + /// Builder of Category. + /// + public sealed class CategoryBuilder + { + private long? _Id; + private string _Name; + + internal CategoryBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Category.Id property. + /// + /// Id + public CategoryBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Category.Name property. + /// + /// Name + public CategoryBuilder Name(string value) + { + _Name = value; + return this; + } + + + /// + /// Builds instance of Category. + /// + /// Category + public Category Build() + { + Validate(); + return new Category( + Id: _Id, + Name: _Name + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 000000000000..cc5625e044a7 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,247 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// An order for a pets from the pet store + /// + public sealed class Order: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// PetId + /// + public long? PetId { get; private set; } + + /// + /// Quantity + /// + public int? Quantity { get; private set; } + + /// + /// ShipDate + /// + public DateTime? ShipDate { get; private set; } + + /// + /// Order Status + /// + public StatusEnum? Status { get; private set; } + + /// + /// Complete + /// + public bool? Complete { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Order.Builder() for instance creation instead. + /// + [Obsolete] + public Order() + { + } + + private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) + { + + this.Id = Id; + + this.PetId = PetId; + + this.Quantity = Quantity; + + this.ShipDate = ShipDate; + + this.Status = Status; + + this.Complete = Complete; + + } + + /// + /// Returns builder of Order. + /// + /// OrderBuilder + public static OrderBuilder Builder() + { + return new OrderBuilder(); + } + + /// + /// Returns OrderBuilder with properties set. + /// Use it to change properties. + /// + /// OrderBuilder + public OrderBuilder With() + { + return Builder() + .Id(Id) + .PetId(PetId) + .Quantity(Quantity) + .ShipDate(ShipDate) + .Status(Status) + .Complete(Complete); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Order other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Order. + /// + /// Compared (Order + /// Compared (Order + /// true if compared items are equals, false otherwise + public static bool operator == (Order left, Order right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Order. + /// + /// Compared (Order + /// Compared (Order + /// true if compared items are not equals, false otherwise + public static bool operator != (Order left, Order right) + { + return !Equals(left, right); + } + + /// + /// Builder of Order. + /// + public sealed class OrderBuilder + { + private long? _Id; + private long? _PetId; + private int? _Quantity; + private DateTime? _ShipDate; + private StatusEnum? _Status; + private bool? _Complete; + + internal OrderBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + _Complete = false; + } + + /// + /// Sets value for Order.Id property. + /// + /// Id + public OrderBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Order.PetId property. + /// + /// PetId + public OrderBuilder PetId(long? value) + { + _PetId = value; + return this; + } + + /// + /// Sets value for Order.Quantity property. + /// + /// Quantity + public OrderBuilder Quantity(int? value) + { + _Quantity = value; + return this; + } + + /// + /// Sets value for Order.ShipDate property. + /// + /// ShipDate + public OrderBuilder ShipDate(DateTime? value) + { + _ShipDate = value; + return this; + } + + /// + /// Sets value for Order.Status property. + /// + /// Order Status + public OrderBuilder Status(StatusEnum? value) + { + _Status = value; + return this; + } + + /// + /// Sets value for Order.Complete property. + /// + /// Complete + public OrderBuilder Complete(bool? value) + { + _Complete = value; + return this; + } + + + /// + /// Builds instance of Order. + /// + /// Order + public Order Build() + { + Validate(); + return new Order( + Id: _Id, + PetId: _PetId, + Quantity: _Quantity, + ShipDate: _ShipDate, + Status: _Status, + Complete: _Complete + ); + } + + private void Validate() + { + } + } + + + public enum StatusEnum { Placed, Approved, Delivered }; + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 000000000000..7f33c53c9081 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,254 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A pet for sale in the pet store + /// + public sealed class Pet: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Category + /// + public Category Category { get; private set; } + + /// + /// Name + /// + public string Name { get; private set; } + + /// + /// PhotoUrls + /// + public List PhotoUrls { get; private set; } + + /// + /// Tags + /// + public List Tags { get; private set; } + + /// + /// pet status in the store + /// + public StatusEnum? Status { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Pet.Builder() for instance creation instead. + /// + [Obsolete] + public Pet() + { + } + + private Pet(long? Id, Category Category, string Name, List PhotoUrls, List Tags, StatusEnum? Status) + { + + this.Id = Id; + + this.Category = Category; + + this.Name = Name; + + this.PhotoUrls = PhotoUrls; + + this.Tags = Tags; + + this.Status = Status; + + } + + /// + /// Returns builder of Pet. + /// + /// PetBuilder + public static PetBuilder Builder() + { + return new PetBuilder(); + } + + /// + /// Returns PetBuilder with properties set. + /// Use it to change properties. + /// + /// PetBuilder + public PetBuilder With() + { + return Builder() + .Id(Id) + .Category(Category) + .Name(Name) + .PhotoUrls(PhotoUrls) + .Tags(Tags) + .Status(Status); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Pet other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Pet. + /// + /// Compared (Pet + /// Compared (Pet + /// true if compared items are equals, false otherwise + public static bool operator == (Pet left, Pet right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Pet. + /// + /// Compared (Pet + /// Compared (Pet + /// true if compared items are not equals, false otherwise + public static bool operator != (Pet left, Pet right) + { + return !Equals(left, right); + } + + /// + /// Builder of Pet. + /// + public sealed class PetBuilder + { + private long? _Id; + private Category _Category; + private string _Name; + private List _PhotoUrls; + private List _Tags; + private StatusEnum? _Status; + + internal PetBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Pet.Id property. + /// + /// Id + public PetBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Pet.Category property. + /// + /// Category + public PetBuilder Category(Category value) + { + _Category = value; + return this; + } + + /// + /// Sets value for Pet.Name property. + /// + /// Name + public PetBuilder Name(string value) + { + _Name = value; + return this; + } + + /// + /// Sets value for Pet.PhotoUrls property. + /// + /// PhotoUrls + public PetBuilder PhotoUrls(List value) + { + _PhotoUrls = value; + return this; + } + + /// + /// Sets value for Pet.Tags property. + /// + /// Tags + public PetBuilder Tags(List value) + { + _Tags = value; + return this; + } + + /// + /// Sets value for Pet.Status property. + /// + /// pet status in the store + public PetBuilder Status(StatusEnum? value) + { + _Status = value; + return this; + } + + + /// + /// Builds instance of Pet. + /// + /// Pet + public Pet Build() + { + Validate(); + return new Pet( + Id: _Id, + Category: _Category, + Name: _Name, + PhotoUrls: _PhotoUrls, + Tags: _Tags, + Status: _Status + ); + } + + private void Validate() + { + if (_Name == null) + { + throw new ArgumentException("Name is a required property for Pet and cannot be null"); + } + if (_PhotoUrls == null) + { + throw new ArgumentException("PhotoUrls is a required property for Pet and cannot be null"); + } + } + } + + + public enum StatusEnum { Available, Pending, Sold }; + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 000000000000..4fb84eef765a --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A tag for a pet + /// + public sealed class Tag: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Name + /// + public string Name { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Tag.Builder() for instance creation instead. + /// + [Obsolete] + public Tag() + { + } + + private Tag(long? Id, string Name) + { + + this.Id = Id; + + this.Name = Name; + + } + + /// + /// Returns builder of Tag. + /// + /// TagBuilder + public static TagBuilder Builder() + { + return new TagBuilder(); + } + + /// + /// Returns TagBuilder with properties set. + /// Use it to change properties. + /// + /// TagBuilder + public TagBuilder With() + { + return Builder() + .Id(Id) + .Name(Name); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Tag other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Tag. + /// + /// Compared (Tag + /// Compared (Tag + /// true if compared items are equals, false otherwise + public static bool operator == (Tag left, Tag right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Tag. + /// + /// Compared (Tag + /// Compared (Tag + /// true if compared items are not equals, false otherwise + public static bool operator != (Tag left, Tag right) + { + return !Equals(left, right); + } + + /// + /// Builder of Tag. + /// + public sealed class TagBuilder + { + private long? _Id; + private string _Name; + + internal TagBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Tag.Id property. + /// + /// Id + public TagBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Tag.Name property. + /// + /// Name + public TagBuilder Name(string value) + { + _Name = value; + return this; + } + + + /// + /// Builds instance of Tag. + /// + /// Tag + public Tag Build() + { + Validate(); + return new Tag( + Id: _Id, + Name: _Name + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 000000000000..f4307685294c --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,285 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A User who is purchasing from the pet store + /// + public sealed class User: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Username + /// + public string Username { get; private set; } + + /// + /// FirstName + /// + public string FirstName { get; private set; } + + /// + /// LastName + /// + public string LastName { get; private set; } + + /// + /// Email + /// + public string Email { get; private set; } + + /// + /// Password + /// + public string Password { get; private set; } + + /// + /// Phone + /// + public string Phone { get; private set; } + + /// + /// User Status + /// + public int? UserStatus { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use User.Builder() for instance creation instead. + /// + [Obsolete] + public User() + { + } + + private User(long? Id, string Username, string FirstName, string LastName, string Email, string Password, string Phone, int? UserStatus) + { + + this.Id = Id; + + this.Username = Username; + + this.FirstName = FirstName; + + this.LastName = LastName; + + this.Email = Email; + + this.Password = Password; + + this.Phone = Phone; + + this.UserStatus = UserStatus; + + } + + /// + /// Returns builder of User. + /// + /// UserBuilder + public static UserBuilder Builder() + { + return new UserBuilder(); + } + + /// + /// Returns UserBuilder with properties set. + /// Use it to change properties. + /// + /// UserBuilder + public UserBuilder With() + { + return Builder() + .Id(Id) + .Username(Username) + .FirstName(FirstName) + .LastName(LastName) + .Email(Email) + .Password(Password) + .Phone(Phone) + .UserStatus(UserStatus); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(User other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (User. + /// + /// Compared (User + /// Compared (User + /// true if compared items are equals, false otherwise + public static bool operator == (User left, User right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (User. + /// + /// Compared (User + /// Compared (User + /// true if compared items are not equals, false otherwise + public static bool operator != (User left, User right) + { + return !Equals(left, right); + } + + /// + /// Builder of User. + /// + public sealed class UserBuilder + { + private long? _Id; + private string _Username; + private string _FirstName; + private string _LastName; + private string _Email; + private string _Password; + private string _Phone; + private int? _UserStatus; + + internal UserBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for User.Id property. + /// + /// Id + public UserBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for User.Username property. + /// + /// Username + public UserBuilder Username(string value) + { + _Username = value; + return this; + } + + /// + /// Sets value for User.FirstName property. + /// + /// FirstName + public UserBuilder FirstName(string value) + { + _FirstName = value; + return this; + } + + /// + /// Sets value for User.LastName property. + /// + /// LastName + public UserBuilder LastName(string value) + { + _LastName = value; + return this; + } + + /// + /// Sets value for User.Email property. + /// + /// Email + public UserBuilder Email(string value) + { + _Email = value; + return this; + } + + /// + /// Sets value for User.Password property. + /// + /// Password + public UserBuilder Password(string value) + { + _Password = value; + return this; + } + + /// + /// Sets value for User.Phone property. + /// + /// Phone + public UserBuilder Phone(string value) + { + _Phone = value; + return this; + } + + /// + /// Sets value for User.UserStatus property. + /// + /// User Status + public UserBuilder UserStatus(int? value) + { + _UserStatus = value; + return this; + } + + + /// + /// Builds instance of User. + /// + /// User + public User Build() + { + Validate(); + return new User( + Id: _Id, + Username: _Username, + FirstName: _FirstName, + LastName: _LastName, + Email: _Email, + Password: _Password, + Phone: _Phone, + UserStatus: _UserStatus + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs new file mode 100644 index 000000000000..28e385ce104d --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs @@ -0,0 +1,247 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; +using NodaTime; +using System.Threading.Tasks; + +namespace Org.OpenAPITools._v2.Modules +{ + /// + /// Status values that need to be considered for filter + /// + public enum FindPetsByStatusStatusEnum + { + available = 1, + pending = 2, + sold = 3 + }; + + + /// + /// Module processing requests of Pet domain. + /// + public sealed class PetModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public PetModule(PetService service) : base("/v2") + { + Post["/pet", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); + + await service.AddPet(Context, body); + return new Response { ContentType = ""}; + }; + + Delete["/pet/{petId}", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + var apiKey = Parameters.ValueOf(parameters, Context.Request, "apiKey", ParameterType.Header); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'DeletePet'"); + + await service.DeletePet(Context, petId, apiKey); + return new Response { ContentType = ""}; + }; + + Get["/pet/findByStatus", true] = async (parameters, ct) => + { + var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Query); + Preconditions.IsNotNull(status, "Required parameter: 'status' is missing at 'FindPetsByStatus'"); + + return await service.FindPetsByStatus(Context, status).ToArray(); + }; + + Get["/pet/findByTags", true] = async (parameters, ct) => + { + var tags = Parameters.ValueOf>(parameters, Context.Request, "tags", ParameterType.Query); + Preconditions.IsNotNull(tags, "Required parameter: 'tags' is missing at 'FindPetsByTags'"); + + return await service.FindPetsByTags(Context, tags).ToArray(); + }; + + Get["/pet/{petId}", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'GetPetById'"); + + return await service.GetPetById(Context, petId); + }; + + Put["/pet", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); + + await service.UpdatePet(Context, body); + return new Response { ContentType = ""}; + }; + + Post["/pet/{petId}", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + var name = Parameters.ValueOf(parameters, Context.Request, "name", ParameterType.Undefined); + var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Undefined); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UpdatePetWithForm'"); + + await service.UpdatePetWithForm(Context, petId, name, status); + return new Response { ContentType = ""}; + }; + + Post["/pet/{petId}/uploadImage", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + var additionalMetadata = Parameters.ValueOf(parameters, Context.Request, "additionalMetadata", ParameterType.Undefined); + var file = Parameters.ValueOf(parameters, Context.Request, "file", ParameterType.Undefined); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UploadFile'"); + + return await service.UploadFile(Context, petId, additionalMetadata, file); + }; + } + } + + /// + /// Service handling Pet requests. + /// + public interface PetService + { + /// + /// + /// + /// Context of request + /// Pet object that needs to be added to the store + /// + Task AddPet(NancyContext context, Pet body); + + /// + /// + /// + /// Context of request + /// Pet id to delete + /// (optional) + /// + Task DeletePet(NancyContext context, long? petId, string apiKey); + + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Context of request + /// Status values that need to be considered for filter + /// List<Pet> + Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status); + + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Context of request + /// Tags to filter by + /// List<Pet> + Task> FindPetsByTags(NancyContext context, List tags); + + /// + /// Returns a single pet + /// + /// Context of request + /// ID of pet to return + /// Pet + Task GetPetById(NancyContext context, long? petId); + + /// + /// + /// + /// Context of request + /// Pet object that needs to be added to the store + /// + Task UpdatePet(NancyContext context, Pet body); + + /// + /// + /// + /// Context of request + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status); + + /// + /// + /// + /// Context of request + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file); + } + + /// + /// Abstraction of PetService. + /// + public abstract class AbstractPetService: PetService + { + public virtual Task AddPet(NancyContext context, Pet body) + { + return AddPet(body); + } + + public virtual Task DeletePet(NancyContext context, long? petId, string apiKey) + { + return DeletePet(petId, apiKey); + } + + public virtual Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status) + { + return FindPetsByStatus(status); + } + + public virtual Task> FindPetsByTags(NancyContext context, List tags) + { + return FindPetsByTags(tags); + } + + public virtual Task GetPetById(NancyContext context, long? petId) + { + return GetPetById(petId); + } + + public virtual Task UpdatePet(NancyContext context, Pet body) + { + return UpdatePet(body); + } + + public virtual Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status) + { + return UpdatePetWithForm(petId, name, status); + } + + public virtual Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file) + { + return UploadFile(petId, additionalMetadata, file); + } + + protected abstract Task AddPet(Pet body); + + protected abstract Task DeletePet(long? petId, string apiKey); + + protected abstract Task> FindPetsByStatus(FindPetsByStatusStatusEnum? status); + + protected abstract Task> FindPetsByTags(List tags); + + protected abstract Task GetPetById(long? petId); + + protected abstract Task UpdatePet(Pet body); + + protected abstract Task UpdatePetWithForm(long? petId, string name, string status); + + protected abstract Task UploadFile(long? petId, string additionalMetadata, System.IO.Stream file); + } + +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs new file mode 100644 index 000000000000..eed0645da35b --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -0,0 +1,129 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; +using NodaTime; +using System.Threading.Tasks; + +namespace Org.OpenAPITools._v2.Modules +{ + + /// + /// Module processing requests of Store domain. + /// + public sealed class StoreModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public StoreModule(StoreService service) : base("/v2") + { + Delete["/store/order/{orderId}", true] = async (parameters, ct) => + { + var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); + Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'DeleteOrder'"); + + await service.DeleteOrder(Context, orderId); + return new Response { ContentType = ""}; + }; + + Get["/store/inventory", true] = async (parameters, ct) => + { + + return await service.GetInventory(Context); + }; + + Get["/store/order/{orderId}", true] = async (parameters, ct) => + { + var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); + Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'GetOrderById'"); + + return await service.GetOrderById(Context, orderId); + }; + + Post["/store/order", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); + + return await service.PlaceOrder(Context, body); + }; + } + } + + /// + /// Service handling Store requests. + /// + public interface StoreService + { + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Context of request + /// ID of the order that needs to be deleted + /// + Task DeleteOrder(NancyContext context, string orderId); + + /// + /// Returns a map of status codes to quantities + /// + /// Context of request + /// Dictionary<string, int?> + Task> GetInventory(NancyContext context); + + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Context of request + /// ID of pet that needs to be fetched + /// Order + Task GetOrderById(NancyContext context, long? orderId); + + /// + /// + /// + /// Context of request + /// order placed for purchasing the pet + /// Order + Task PlaceOrder(NancyContext context, Order body); + } + + /// + /// Abstraction of StoreService. + /// + public abstract class AbstractStoreService: StoreService + { + public virtual Task DeleteOrder(NancyContext context, string orderId) + { + return DeleteOrder(orderId); + } + + public virtual Task> GetInventory(NancyContext context) + { + return GetInventory(); + } + + public virtual Task GetOrderById(NancyContext context, long? orderId) + { + return GetOrderById(orderId); + } + + public virtual Task PlaceOrder(NancyContext context, Order body) + { + return PlaceOrder(body); + } + + protected abstract Task DeleteOrder(string orderId); + + protected abstract Task> GetInventory(); + + protected abstract Task GetOrderById(long? orderId); + + protected abstract Task PlaceOrder(Order body); + } + +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs new file mode 100644 index 000000000000..23d99c214e4c --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs @@ -0,0 +1,234 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; +using NodaTime; +using System.Threading.Tasks; + +namespace Org.OpenAPITools._v2.Modules +{ + + /// + /// Module processing requests of User domain. + /// + public sealed class UserModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public UserModule(UserService service) : base("/v2") + { + Post["/user", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); + + await service.CreateUser(Context, body); + return new Response { ContentType = ""}; + }; + + Post["/user/createWithArray", true] = async (parameters, ct) => + { + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); + + await service.CreateUsersWithArrayInput(Context, body); + return new Response { ContentType = ""}; + }; + + Post["/user/createWithList", true] = async (parameters, ct) => + { + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); + + await service.CreateUsersWithListInput(Context, body); + return new Response { ContentType = ""}; + }; + + Delete["/user/{username}", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'DeleteUser'"); + + await service.DeleteUser(Context, username); + return new Response { ContentType = ""}; + }; + + Get["/user/{username}", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'GetUserByName'"); + + return await service.GetUserByName(Context, username); + }; + + Get["/user/login", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Query); + var password = Parameters.ValueOf(parameters, Context.Request, "password", ParameterType.Query); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'LoginUser'"); + + Preconditions.IsNotNull(password, "Required parameter: 'password' is missing at 'LoginUser'"); + + return await service.LoginUser(Context, username, password); + }; + + Get["/user/logout", true] = async (parameters, ct) => + { + + await service.LogoutUser(Context); + return new Response { ContentType = ""}; + }; + + Put["/user/{username}", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); + var body = this.Bind(); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); + + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); + + await service.UpdateUser(Context, username, body); + return new Response { ContentType = ""}; + }; + } + } + + /// + /// Service handling User requests. + /// + public interface UserService + { + /// + /// This can only be done by the logged in user. + /// + /// Context of request + /// Created user object + /// + Task CreateUser(NancyContext context, User body); + + /// + /// + /// + /// Context of request + /// List of user object + /// + Task CreateUsersWithArrayInput(NancyContext context, List body); + + /// + /// + /// + /// Context of request + /// List of user object + /// + Task CreateUsersWithListInput(NancyContext context, List body); + + /// + /// This can only be done by the logged in user. + /// + /// Context of request + /// The name that needs to be deleted + /// + Task DeleteUser(NancyContext context, string username); + + /// + /// + /// + /// Context of request + /// The name that needs to be fetched. Use user1 for testing. + /// User + Task GetUserByName(NancyContext context, string username); + + /// + /// + /// + /// Context of request + /// The user name for login + /// The password for login in clear text + /// string + Task LoginUser(NancyContext context, string username, string password); + + /// + /// + /// + /// Context of request + /// + Task LogoutUser(NancyContext context); + + /// + /// This can only be done by the logged in user. + /// + /// Context of request + /// name that need to be deleted + /// Updated user object + /// + Task UpdateUser(NancyContext context, string username, User body); + } + + /// + /// Abstraction of UserService. + /// + public abstract class AbstractUserService: UserService + { + public virtual Task CreateUser(NancyContext context, User body) + { + return CreateUser(body); + } + + public virtual Task CreateUsersWithArrayInput(NancyContext context, List body) + { + return CreateUsersWithArrayInput(body); + } + + public virtual Task CreateUsersWithListInput(NancyContext context, List body) + { + return CreateUsersWithListInput(body); + } + + public virtual Task DeleteUser(NancyContext context, string username) + { + return DeleteUser(username); + } + + public virtual Task GetUserByName(NancyContext context, string username) + { + return GetUserByName(username); + } + + public virtual Task LoginUser(NancyContext context, string username, string password) + { + return LoginUser(username, password); + } + + public virtual Task LogoutUser(NancyContext context) + { + return LogoutUser(); + } + + public virtual Task UpdateUser(NancyContext context, string username, User body) + { + return UpdateUser(username, body); + } + + protected abstract Task CreateUser(User body); + + protected abstract Task CreateUsersWithArrayInput(List body); + + protected abstract Task CreateUsersWithListInput(List body); + + protected abstract Task DeleteUser(string username); + + protected abstract Task GetUserByName(string username); + + protected abstract Task LoginUser(string username, string password); + + protected abstract Task LogoutUser(); + + protected abstract Task UpdateUser(string username, User body); + } + +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..b26666605cd3 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,66 @@ + + + + Debug + AnyCPU + {768B8DC6-54EE-4D40-9B20-7857E1D742A4} + Library + Properties + Org.OpenAPITools._v2 + Org.OpenAPITools + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\Org.OpenAPITools.XML + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + bin\Release\Org.OpenAPITools.XML + + + + ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll + True + + + ..\..\packages\NodaTime.1.3.1\lib\net35-Client\NodaTime.dll + True + + + ..\..\packages\Sharpility.1.2.2\lib\net45\Sharpility.dll + True + + + ..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + True + + + + + + + + + + + + + + + + + + diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec new file mode 100644 index 000000000000..d4ee2fc102a4 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -0,0 +1,13 @@ + + + + Org.OpenAPITools + Org.OpenAPITools + 1.0.0 + openapi-generator + openapi-generator + false + NancyFx Org.OpenAPITools API + https://www.apache.org/licenses/LICENSE-2.0.html + + \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs new file mode 100644 index 000000000000..dd90cbf5133d --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -0,0 +1,55 @@ +using Nancy.Bootstrapper; +using Nancy.Json; +using NodaTime; +using NodaTime.Text; +using System; +using System.Collections.Generic; + +namespace Org.OpenAPITools._v2.Utils +{ + /// + /// (De)serializes a to a string using + /// the RFC3339 + /// full-date format. + /// + public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup + { + public override IEnumerable SupportedTypes + { + get + { + yield return typeof(LocalDate); + yield return typeof(LocalDate?); + } + } + + public void Initialize(IPipelines pipelines) + { + JsonSettings.PrimitiveConverters.Add(new LocalDateConverter()); + } + + + public override object Serialize(object obj, JavaScriptSerializer serializer) + { + if (obj is LocalDate) + { + LocalDate localDate = (LocalDate)obj; + return LocalDatePattern.IsoPattern.Format(localDate); + } + return null; + } + + public override object Deserialize(object primitiveValue, Type type, JavaScriptSerializer serializer) + { + if ((type == typeof(LocalDate) || type == typeof(LocalDate?)) && primitiveValue is string) + { + try + { + return LocalDatePattern.IsoPattern.Parse(primitiveValue as string).GetValueOrThrow(); + } + catch { } + } + return null; + } + } +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs new file mode 100644 index 000000000000..847527a2dbb7 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs @@ -0,0 +1,450 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using Nancy; +using NodaTime; +using NodaTime.Text; +using Sharpility.Base; +using Sharpility.Extensions; +using Sharpility.Util; + +namespace Org.OpenAPITools._v2.Utils +{ + internal static class Parameters + { + private static readonly IDictionary> Parsers = CreateParsers(); + + internal static TValue ValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) + { + var valueType = typeof(TValue); + var valueUnderlyingType = Nullable.GetUnderlyingType(valueType); + var isNullable = default(TValue) == null; + string value = RawValueOf(parameters, request, name, parameterType); + Preconditions.Evaluate(!string.IsNullOrEmpty(value) || isNullable, string.Format("Required parameter: '{0}' is missing", name)); + if (value == null && isNullable) + { + return default(TValue); + } + if (valueType.IsEnum || (valueUnderlyingType != null && valueUnderlyingType.IsEnum)) + { + return EnumValueOf(name, value); + } + return ValueOf(parameters, name, value, valueType, request, parameterType); + } + + private static string RawValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) + { + try + { + switch (parameterType) + { + case ParameterType.Query: + string querValue = request.Query[name]; + return querValue; + case ParameterType.Path: + string pathValue = parameters[name]; + return pathValue; + case ParameterType.Header: + var headerValue = request.Headers[name]; + return headerValue != null ? string.Join(",", headerValue) : null; + } + } + catch (Exception e) + { + throw new InvalidOperationException(string.Format("Could not obtain value of '{0}' parameter", name), e); + } + throw new InvalidOperationException(string.Format("Parameter with type: {0} is not supported", parameterType)); + } + + private static TValue EnumValueOf(string name, string value) + { + var valueType = typeof(TValue); + var enumType = valueType.IsEnum ? valueType : Nullable.GetUnderlyingType(valueType); + Preconditions.IsNotNull(enumType, () => new InvalidOperationException( + string.Format("Could not parse parameter: '{0}' to enum. Type {1} is not enum", name, valueType))); + var values = Enum.GetValues(enumType); + foreach (var entry in values) + { + if (entry.ToString().EqualsIgnoreCases(value) + || ((int)entry).ToString().EqualsIgnoreCases(value)) + { + return (TValue)entry; + } + } + throw new ArgumentException(string.Format("Parameter: '{0}' value: '{1}' is not supported. Expected one of: {2}", + name, value, Strings.ToString(values))); + } + + private static TValue ValueOf(dynamic parameters, string name, string value, Type valueType, Request request, ParameterType parameterType) + { + var parser = Parsers.GetIfPresent(valueType); + if (parser != null) + { + return ParseValueUsing(name, value, valueType, parser); + } + if (parameterType == ParameterType.Path) + { + return DynamicValueOf(parameters, name); + } + if (parameterType == ParameterType.Query) + { + return DynamicValueOf(request.Query, name); + } + throw new InvalidOperationException(string.Format("Could not get value for {0} with type {1}", name, valueType)); + } + + private static TValue ParseValueUsing(string name, string value, Type valueType, Func parser) + { + var result = parser(Parameter.Of(name, value)); + try + { + return (TValue)result; + } + catch (InvalidCastException) + { + throw new InvalidOperationException( + string.Format("Could not parse parameter: '{0}' with value: '{1}'. " + + "Received: '{2}', expected: '{3}'.", + name, value, result.GetType(), valueType)); + } + } + + private static TValue DynamicValueOf(dynamic parameters, string name) + { + string value = parameters[name]; + try + { + TValue result = parameters[name]; + return result; + } + catch (InvalidCastException) + { + throw new InvalidOperationException(Strings.Format("Parameter: '{0}' value: '{1}' could not be parsed. " + + "Expected type: '{2}' is not supported", + name, value, typeof(TValue))); + } + catch (Exception e) + { + throw new InvalidOperationException(string.Format("Could not get '{0}' value of '{1}' type dynamicly", + name, typeof(TValue)), e); + } + } + + private static IDictionary> CreateParsers() + { + var parsers = ImmutableDictionary.CreateBuilder>(); + parsers.Put(typeof(string), value => value.Value); + parsers.Put(typeof(bool), SafeParse(bool.Parse)); + parsers.Put(typeof(bool?), SafeParse(bool.Parse)); + parsers.Put(typeof(byte), SafeParse(byte.Parse)); + parsers.Put(typeof(sbyte?), SafeParse(sbyte.Parse)); + parsers.Put(typeof(short), SafeParse(short.Parse)); + parsers.Put(typeof(short?), SafeParse(short.Parse)); + parsers.Put(typeof(ushort), SafeParse(ushort.Parse)); + parsers.Put(typeof(ushort?), SafeParse(ushort.Parse)); + parsers.Put(typeof(int), SafeParse(int.Parse)); + parsers.Put(typeof(int?), SafeParse(int.Parse)); + parsers.Put(typeof(uint), SafeParse(uint.Parse)); + parsers.Put(typeof(uint?), SafeParse(uint.Parse)); + parsers.Put(typeof(long), SafeParse(long.Parse)); + parsers.Put(typeof(long?), SafeParse(long.Parse)); + parsers.Put(typeof(ulong), SafeParse(ulong.Parse)); + parsers.Put(typeof(ulong?), SafeParse(ulong.Parse)); + parsers.Put(typeof(float), SafeParse(float.Parse)); + parsers.Put(typeof(float?), SafeParse(float.Parse)); + parsers.Put(typeof(double), SafeParse(double.Parse)); + parsers.Put(typeof(double?), SafeParse(double.Parse)); + parsers.Put(typeof(decimal), SafeParse(decimal.Parse)); + parsers.Put(typeof(decimal?), SafeParse(decimal.Parse)); + parsers.Put(typeof(DateTime), SafeParse(DateTime.Parse)); + parsers.Put(typeof(DateTime?), SafeParse(DateTime.Parse)); + parsers.Put(typeof(TimeSpan), SafeParse(TimeSpan.Parse)); + parsers.Put(typeof(TimeSpan?), SafeParse(TimeSpan.Parse)); + parsers.Put(typeof(ZonedDateTime), SafeParse(ParseZonedDateTime)); + parsers.Put(typeof(ZonedDateTime?), SafeParse(ParseZonedDateTime)); + parsers.Put(typeof(LocalDate), SafeParse(ParseLocalDate)); + parsers.Put(typeof(LocalDate?), SafeParse(ParseLocalDate)); + parsers.Put(typeof(LocalTime), SafeParse(ParseLocalTime)); + parsers.Put(typeof(LocalTime?), SafeParse(ParseLocalTime)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(value => value)); + parsers.Put(typeof(ICollection), ImmutableListParse(value => value)); + parsers.Put(typeof(IList), ImmutableListParse(value => value)); + parsers.Put(typeof(List), ListParse(value => value)); + parsers.Put(typeof(ISet), ImmutableListParse(value => value)); + parsers.Put(typeof(HashSet), SetParse(value => value)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(bool.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(bool.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(bool.Parse)); + parsers.Put(typeof(List), NullableListParse(bool.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(bool.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(bool.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(byte.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(byte.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(byte.Parse)); + parsers.Put(typeof(List), ListParse(byte.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(byte.Parse)); + parsers.Put(typeof(HashSet), SetParse(byte.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(sbyte.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(sbyte.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(sbyte.Parse)); + parsers.Put(typeof(List), ListParse(sbyte.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(sbyte.Parse)); + parsers.Put(typeof(HashSet), SetParse(sbyte.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(short.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(short.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(short.Parse)); + parsers.Put(typeof(List), ListParse(short.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(short.Parse)); + parsers.Put(typeof(HashSet), SetParse(short.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(ushort.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(ushort.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(ushort.Parse)); + parsers.Put(typeof(List), ListParse(ushort.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(ushort.Parse)); + parsers.Put(typeof(HashSet), SetParse(ushort.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(int.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(int.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(int.Parse)); + parsers.Put(typeof(List), NullableListParse(int.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(int.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(int.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(uint.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(uint.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(uint.Parse)); + parsers.Put(typeof(List), ListParse(uint.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(uint.Parse)); + parsers.Put(typeof(HashSet), SetParse(uint.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(long.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(long.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(long.Parse)); + parsers.Put(typeof(List), NullableListParse(long.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(long.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(long.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(ulong.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(ulong.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(ulong.Parse)); + parsers.Put(typeof(List), ListParse(ulong.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(ulong.Parse)); + parsers.Put(typeof(HashSet), SetParse(ulong.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(float.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(float.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(float.Parse)); + parsers.Put(typeof(List), NullableListParse(float.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(float.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(float.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(double.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(double.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(double.Parse)); + parsers.Put(typeof(List), NullableListParse(double.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(double.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(double.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(decimal.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(decimal.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(decimal.Parse)); + parsers.Put(typeof(List), NullableListParse(decimal.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(decimal.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(decimal.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(DateTime.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(DateTime.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(DateTime.Parse)); + parsers.Put(typeof(List), NullableListParse(DateTime.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(DateTime.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(DateTime.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(TimeSpan.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(TimeSpan.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(TimeSpan.Parse)); + parsers.Put(typeof(List), ListParse(TimeSpan.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(TimeSpan.Parse)); + parsers.Put(typeof(HashSet), SetParse(TimeSpan.Parse)); + + return parsers.ToImmutableDictionary(); + } + + private static Func SafeParse(Func parse) + { + return parameter => + { + try + { + return parse(parameter.Value); + } + catch (OverflowException) + { + throw ParameterOutOfRange(parameter, typeof(T)); + } + catch (FormatException) + { + throw InvalidParameterFormat(parameter, typeof(T)); + } + catch (Exception e) + { + throw new InvalidOperationException(Strings.Format("Unable to parse parameter: '{0}' with value: '{1}' to {2}", + parameter.Name, parameter.Value, typeof(T)), e); + } + }; + } + + private static Func NullableListParse(Func itemParser) where T: struct + { + return ListParse(it => it.ToNullable(itemParser)); + } + + private static Func ListParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return new List(); + } + return ParseCollection(parameter.Value, itemParser).ToList(); + }; + } + + private static Func NullableImmutableListParse(Func itemParser) where T: struct + { + return ImmutableListParse(it => it.ToNullable(itemParser)); + } + + private static Func ImmutableListParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return Lists.EmptyList(); + } + return ParseCollection(parameter.Value, itemParser).ToImmutableList(); + }; + } + + private static Func NullableSetParse(Func itemParser) where T: struct + { + return SetParse(it => it.ToNullable(itemParser)); + } + + private static Func SetParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return new HashSet(); + } + return ParseCollection(parameter.Value, itemParser).ToSet(); + }; + } + + private static Func NullableImmutableSetParse(Func itemParser) where T: struct + { + return ImmutableSetParse(it => it.ToNullable(itemParser)); + } + + private static Func ImmutableSetParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return Sets.EmptySet(); + } + return ParseCollection(parameter.Value, itemParser).ToImmutableHashSet(); + }; + } + + private static ZonedDateTime ParseZonedDateTime(string value) + { + var dateTime = DateTime.Parse(value); + return new ZonedDateTime(Instant.FromDateTimeUtc(dateTime.ToUniversalTime()), DateTimeZone.Utc); + } + + private static LocalDate ParseLocalDate(string value) + { + return LocalDatePattern.IsoPattern.Parse(value).Value; + } + + private static LocalTime ParseLocalTime(string value) + { + return LocalTimePattern.ExtendedIsoPattern.Parse(value).Value; + } + + private static ArgumentException ParameterOutOfRange(Parameter parameter, Type type) + { + return new ArgumentException(Strings.Format("Query: '{0}' value: '{1}' is out of range for: '{2}'", + parameter.Name, parameter.Value, type)); + } + + private static ArgumentException InvalidParameterFormat(Parameter parameter, Type type) + { + return new ArgumentException(Strings.Format("Query '{0}' value: '{1}' format is invalid for: '{2}'", + parameter.Name, parameter.Value, type)); + } + + private static IEnumerable ParseCollection(string value, Func itemParser) + { + var results = value.Split(new[] { ',' }, StringSplitOptions.None) + .Where(it => it != null) + .Select(it => it.Trim()) + .Select(itemParser); + return results; + } + + public static T? ToNullable(this string s, Func itemParser) where T : struct + { + T? result = new T?(); + try + { + if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) + { + result = itemParser(s); + } + } + catch (Exception e) + { + throw new InvalidOperationException(Strings.Format("Unable to parse value: '{0}' to nullable: '{1}'", s, typeof(T).ToString()), e); + } + return result; + } + + private class Parameter + { + internal string Name { get; private set; } + internal string Value { get; private set; } + + private Parameter(string name, string value) + { + Name = name; + Value = value; + } + + internal static Parameter Of(string name, string value) + { + return new Parameter(name, value); + } + } + } + + internal enum ParameterType + { + Undefined, + Query, + Path, + Header + } +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config new file mode 100644 index 000000000000..e3401566e5d2 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/.openapi-generator/FILES b/samples/server/petstore/nancyfx/.openapi-generator/FILES new file mode 100644 index 000000000000..e60e5215dcc4 --- /dev/null +++ b/samples/server/petstore/nancyfx/.openapi-generator/FILES @@ -0,0 +1,15 @@ +Org.OpenAPITools.sln +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/Modules/PetModule.cs +src/Org.OpenAPITools/Modules/StoreModule.cs +src/Org.OpenAPITools/Modules/UserModule.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec +src/Org.OpenAPITools/Utils/LocalDateConverter.cs +src/Org.OpenAPITools/Utils/Parameters.cs +src/Org.OpenAPITools/packages.config diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION index f9f7450d1359..d99e7162d01f 100644 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/Org.OpenAPITools.sln b/samples/server/petstore/nancyfx/Org.OpenAPITools.sln new file mode 100644 index 000000000000..757078a1383c --- /dev/null +++ b/samples/server/petstore/nancyfx/Org.OpenAPITools.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +EndProject +Global +GlobalSection(SolutionConfigurationPlatforms) = preSolution +Debug|Any CPU = Debug|Any CPU +Release|Any CPU = Release|Any CPU +EndGlobalSection +GlobalSection(ProjectConfigurationPlatforms) = postSolution +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +EndGlobalSection +GlobalSection(SolutionProperties) = preSolution +HideSolutionNode = FALSE +EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs index db083b73bdc7..b10ee5765733 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// Describes the result of uploading an image resource diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs index 1bfb30abb752..23f20131922d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A category for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs index 7bdec1016958..cc5625e044a7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// An order for a pets from the pet store @@ -30,7 +30,7 @@ public sealed class Order: IEquatable /// /// ShipDate /// - public ZonedDateTime? ShipDate { get; private set; } + public DateTime? ShipDate { get; private set; } /// /// Order Status @@ -52,7 +52,7 @@ public Order() { } - private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) + private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) { this.Id = Id; @@ -144,7 +144,7 @@ public sealed class OrderBuilder private long? _Id; private long? _PetId; private int? _Quantity; - private ZonedDateTime? _ShipDate; + private DateTime? _ShipDate; private StatusEnum? _Status; private bool? _Complete; @@ -192,7 +192,7 @@ public OrderBuilder Quantity(int? value) /// Sets value for Order.ShipDate property. /// /// ShipDate - public OrderBuilder ShipDate(ZonedDateTime? value) + public OrderBuilder ShipDate(DateTime? value) { _ShipDate = value; return this; diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs index a3f02e090883..7f33c53c9081 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A pet for sale in the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs index 7ce321d25114..4fb84eef765a 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A tag for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs index 04d33ca07f77..f4307685294c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A User who is purchasing from the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs index 9cdfe6b814e6..12233957857c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// /// Status values that need to be considered for filter @@ -33,10 +33,10 @@ public PetModule(PetService service) : base("/v2") { Post["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'AddPet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - service.AddPet(Context, pet); + service.AddPet(Context, body); return new Response { ContentType = ""}; }; @@ -76,10 +76,10 @@ public PetModule(PetService service) : base("/v2") Put["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'UpdatePet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - service.UpdatePet(Context, pet); + service.UpdatePet(Context, body); return new Response { ContentType = ""}; }; @@ -115,9 +115,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet(NancyContext context, Pet pet); + void AddPet(NancyContext context, Pet body); /// /// @@ -156,9 +156,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet(NancyContext context, Pet pet); + void UpdatePet(NancyContext context, Pet body); /// /// @@ -186,9 +186,9 @@ public interface PetService /// public abstract class AbstractPetService: PetService { - public virtual void AddPet(NancyContext context, Pet pet) + public virtual void AddPet(NancyContext context, Pet body) { - AddPet(pet); + AddPet(body); } public virtual void DeletePet(NancyContext context, long? petId, string apiKey) @@ -211,9 +211,9 @@ public virtual Pet GetPetById(NancyContext context, long? petId) return GetPetById(petId); } - public virtual void UpdatePet(NancyContext context, Pet pet) + public virtual void UpdatePet(NancyContext context, Pet body) { - UpdatePet(pet); + UpdatePet(body); } public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) @@ -226,7 +226,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string return UploadFile(petId, additionalMetadata, file); } - protected abstract void AddPet(Pet pet); + protected abstract void AddPet(Pet body); protected abstract void DeletePet(long? petId, string apiKey); @@ -236,7 +236,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string protected abstract Pet GetPetById(long? petId); - protected abstract void UpdatePet(Pet pet); + protected abstract void UpdatePet(Pet body); protected abstract void UpdatePetWithForm(long? petId, string name, string status); diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs index be42a7b8b520..0c75b02fd9ae 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -46,10 +46,10 @@ public StoreModule(StoreService service) : base("/v2") Post["/store/order"] = parameters => { - var order = this.Bind(); - Preconditions.IsNotNull(order, "Required parameter: 'order' is missing at 'PlaceOrder'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - return service.PlaceOrder(Context, order); + return service.PlaceOrder(Context, body); }; } } @@ -86,9 +86,9 @@ public interface StoreService /// /// /// Context of request - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder(NancyContext context, Order order); + Order PlaceOrder(NancyContext context, Order body); } /// @@ -111,9 +111,9 @@ public virtual Order GetOrderById(NancyContext context, long? orderId) return GetOrderById(orderId); } - public virtual Order PlaceOrder(NancyContext context, Order order) + public virtual Order PlaceOrder(NancyContext context, Order body) { - return PlaceOrder(order); + return PlaceOrder(body); } protected abstract void DeleteOrder(string orderId); @@ -122,7 +122,7 @@ public virtual Order PlaceOrder(NancyContext context, Order order) protected abstract Order GetOrderById(long? orderId); - protected abstract Order PlaceOrder(Order order); + protected abstract Order PlaceOrder(Order body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs index c35bc62dae10..cc268b9a2c54 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -23,28 +23,28 @@ public UserModule(UserService service) : base("/v2") { Post["/user"] = parameters => { - var user = this.Bind(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUser'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - service.CreateUser(Context, user); + service.CreateUser(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithArray"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithArrayInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - service.CreateUsersWithArrayInput(Context, user); + service.CreateUsersWithArrayInput(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithList"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithListInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - service.CreateUsersWithListInput(Context, user); + service.CreateUsersWithListInput(Context, body); return new Response { ContentType = ""}; }; @@ -86,12 +86,12 @@ public UserModule(UserService service) : base("/v2") Put["/user/{username}"] = parameters => { var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var user = this.Bind(); + var body = this.Bind(); Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'UpdateUser'"); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - service.UpdateUser(Context, username, user); + service.UpdateUser(Context, username, body); return new Response { ContentType = ""}; }; } @@ -106,25 +106,25 @@ public interface UserService /// This can only be done by the logged in user. /// /// Context of request - /// Created user object + /// Created user object /// - void CreateUser(NancyContext context, User user); + void CreateUser(NancyContext context, User body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput(NancyContext context, List user); + void CreateUsersWithArrayInput(NancyContext context, List body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithListInput(NancyContext context, List user); + void CreateUsersWithListInput(NancyContext context, List body); /// /// This can only be done by the logged in user. @@ -163,9 +163,9 @@ public interface UserService /// /// Context of request /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser(NancyContext context, string username, User user); + void UpdateUser(NancyContext context, string username, User body); } /// @@ -173,19 +173,19 @@ public interface UserService /// public abstract class AbstractUserService: UserService { - public virtual void CreateUser(NancyContext context, User user) + public virtual void CreateUser(NancyContext context, User body) { - CreateUser(user); + CreateUser(body); } - public virtual void CreateUsersWithArrayInput(NancyContext context, List user) + public virtual void CreateUsersWithArrayInput(NancyContext context, List body) { - CreateUsersWithArrayInput(user); + CreateUsersWithArrayInput(body); } - public virtual void CreateUsersWithListInput(NancyContext context, List user) + public virtual void CreateUsersWithListInput(NancyContext context, List body) { - CreateUsersWithListInput(user); + CreateUsersWithListInput(body); } public virtual void DeleteUser(NancyContext context, string username) @@ -208,16 +208,16 @@ public virtual void LogoutUser(NancyContext context) LogoutUser(); } - public virtual void UpdateUser(NancyContext context, string username, User user) + public virtual void UpdateUser(NancyContext context, string username, User body) { - UpdateUser(username, user); + UpdateUser(username, body); } - protected abstract void CreateUser(User user); + protected abstract void CreateUser(User body); - protected abstract void CreateUsersWithArrayInput(List user); + protected abstract void CreateUsersWithArrayInput(List body); - protected abstract void CreateUsersWithListInput(List user); + protected abstract void CreateUsersWithListInput(List body); protected abstract void DeleteUser(string username); @@ -227,7 +227,7 @@ public virtual void UpdateUser(NancyContext context, string username, User user) protected abstract void LogoutUser(); - protected abstract void UpdateUser(string username, User user); + protected abstract void UpdateUser(string username, User body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 04b710b25cbd..b26666605cd3 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -6,7 +6,7 @@ {768B8DC6-54EE-4D40-9B20-7857E1D742A4} Library Properties - Org.OpenAPITools.v2 + Org.OpenAPITools._v2 Org.OpenAPITools v4.5 512 diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs index 9e7cfd8a8570..dd90cbf5133d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { /// /// (De)serializes a to a string using diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs index 9bc5408abfea..847527a2dbb7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs @@ -9,7 +9,7 @@ using Sharpility.Extensions; using Sharpility.Util; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { internal static class Parameters {