diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java index f0d3591ba3f..83330477b65 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java @@ -77,6 +77,9 @@ public class CodegenConstants { public static final String MODEL_PROPERTY_NAMING = "modelPropertyNaming"; public static final String MODEL_PROPERTY_NAMING_DESC = "Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name"; + public static final String DOTNET_FRAMEWORK = "targetFramework"; + public static final String DOTNET_FRAMEWORK_DESC = "The target .NET framework version."; + public static enum MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original} } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 0da5b72f57f..3ef8e35e93e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -1,5 +1,7 @@ package io.swagger.codegen.languages; +import com.google.common.collect.ImmutableBiMap; +import com.google.common.collect.ImmutableMap; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenType; @@ -25,6 +27,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { @SuppressWarnings({"unused", "hiding"}) private static final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); + private static final String NET45 = "v4.5"; + private static final String NET35 = "v3.5"; protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase() + "}"; protected String packageTitle = "Swagger Library"; @@ -34,6 +38,13 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { protected String packageCopyright = "No Copyright"; protected String clientPackage = "IO.Swagger.Client"; + protected String targetFramework = NET45; + protected String targetFrameworkNuget = "net45"; + protected boolean supportsAsync = Boolean.TRUE; + + + protected final Map frameworks; + public CSharpClientCodegen() { super(); modelTemplateFiles.put("model.mustache", ".cs"); @@ -64,6 +75,18 @@ public CSharpClientCodegen() { CodegenConstants.OPTIONAL_PROJECT_GUID_DESC, null); + CliOption framework = new CliOption( + CodegenConstants.DOTNET_FRAMEWORK, + CodegenConstants.DOTNET_FRAMEWORK_DESC + ); + frameworks = new ImmutableMap.Builder() + .put(NET35, ".NET Framework 3.5 compatible") + .put(NET45, ".NET Framework 4.5+ compatible") + .build(); + framework.defaultValue(this.targetFramework); + framework.setEnum(frameworks); + cliOptions.add(framework); + // CLI Switches addSwitch(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC, @@ -111,6 +134,24 @@ public void processOpts() { additionalProperties.put("packageCompany", packageCompany); additionalProperties.put("packageCopyright", packageCopyright); + if (additionalProperties.containsKey(CodegenConstants.DOTNET_FRAMEWORK)) { + setTargetFramework((String) additionalProperties.get(CodegenConstants.DOTNET_FRAMEWORK)); + } + + if (NET35.equals(this.targetFramework)) { + setTargetFrameworkNuget("net35"); + setSupportsAsync(Boolean.FALSE); + if(additionalProperties.containsKey("supportsAsync")){ + additionalProperties.remove("supportsAsync"); + } + } else { + setTargetFrameworkNuget("net45"); + setSupportsAsync(Boolean.TRUE); + additionalProperties.put("supportsAsync", this.supportsAsync); + } + + additionalProperties.put("targetFrameworkNuget", this.targetFrameworkNuget); + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_FILE)) { setOptionalProjectFileFlag(Boolean.valueOf( additionalProperties.get(CodegenConstants.OPTIONAL_PROJECT_FILE).toString())); @@ -141,7 +182,7 @@ public void processOpts() { String binRelativePath = "..\\"; for (int i = 0; i < packageDepth; i = i + 1) binRelativePath += "..\\"; - binRelativePath += "bin\\"; + binRelativePath += "vendor\\"; additionalProperties.put("binRelativePath", binRelativePath); supportingFiles.add(new SupportingFile("Configuration.mustache", @@ -153,8 +194,6 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ApiResponse.mustache", clientPackageDir, "ApiResponse.cs")); - supportingFiles.add(new SupportingFile("Newtonsoft.Json.dll", "bin", "Newtonsoft.Json.dll")); - supportingFiles.add(new SupportingFile("RestSharp.dll", "bin", "RestSharp.dll")); supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat")); supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh")); supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config")); @@ -222,4 +261,20 @@ public void setPackageGuid(String packageGuid) { this.packageGuid = packageGuid; } + public void setTargetFramework(String dotnetFramework) { + if(!frameworks.containsKey(dotnetFramework)){ + LOGGER.warn("Invalid .NET framework version, defaulting to " + this.targetFramework); + } else { + this.targetFramework = dotnetFramework; + } + LOGGER.info("Generating code for .NET Framework " + this.targetFramework); + } + + public void setTargetFrameworkNuget(String targetFrameworkNuget) { + this.targetFrameworkNuget = targetFrameworkNuget; + } + + public void setSupportsAsync(Boolean supportsAsync){ + this.supportsAsync = supportsAsync; + } } diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index 4fabfa4667b..60b573e1a6c 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -146,7 +146,7 @@ namespace {{packageName}}.Client var response = RestClient.Execute(request); return (Object) response; } - + {{#supportsAsync}} /// /// Makes the asynchronous HTTP request. /// @@ -171,7 +171,7 @@ namespace {{packageName}}.Client pathParams, contentType); var response = await RestClient.ExecuteTaskAsync(request); return (Object)response; - } + }{{/supportsAsync}} /// /// Escape string (url-encoded). @@ -367,7 +367,7 @@ namespace {{packageName}}.Client /// Object to be casted /// Target type /// Casted object - public static dynamic ConvertType(dynamic source, Type dest) + {{#supportsAsync}}public static dynamic ConvertType(dynamic source, Type dest){{/supportsAsync}}{{^supportsAsync}}public static object ConvertType(T source, Type dest) where T : class{{/supportsAsync}} { return Convert.ChangeType(source, dest); } diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache index 09dbd0dce50..8e56fb31f43 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiException.mustache @@ -17,7 +17,7 @@ namespace {{packageName}}.Client /// Gets or sets the error content (body json object) /// /// The error content (Http response body). - public dynamic ErrorContent { get; private set; } + public {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} ErrorContent { get; private set; } /// /// Initializes a new instance of the class. @@ -40,7 +40,7 @@ namespace {{packageName}}.Client /// HTTP status code. /// Error message. /// Error content. - public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) + public ApiException(int errorCode, string message, {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} errorContent = null) : base(message) { this.ErrorCode = errorCode; this.ErrorContent = errorContent; diff --git a/modules/swagger-codegen/src/main/resources/csharp/AssemblyInfo.mustache b/modules/swagger-codegen/src/main/resources/csharp/AssemblyInfo.mustache index 8a19fd01393..bf80d7d4568 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/AssemblyInfo.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/AssemblyInfo.mustache @@ -1,6 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; -using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll b/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll deleted file mode 100644 index ae725c4b598..00000000000 Binary files a/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll and /dev/null differ diff --git a/modules/swagger-codegen/src/main/resources/csharp/Project.mustache b/modules/swagger-codegen/src/main/resources/csharp/Project.mustache index 333cb5088ff..d418dc74f8b 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Project.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Project.mustache @@ -8,7 +8,7 @@ Properties {{packageTitle}} {{packageTitle}} - v4.5 + {{targetFramework}} 512 @@ -41,10 +41,10 @@ False - {{binRelativePath}}Newtonsoft.Json.dll + {{binRelativePath}}/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll - {{binRelativePath}}RestSharp.dll + {{binRelativePath}}/RestSharp.105.2.3/lib/{{targetFrameworkNuget}}/RestSharp.dll diff --git a/modules/swagger-codegen/src/main/resources/csharp/README.md b/modules/swagger-codegen/src/main/resources/csharp/README.md index 3ce83da957b..794a7c49b1b 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/README.md +++ b/modules/swagger-codegen/src/main/resources/csharp/README.md @@ -6,12 +6,14 @@ - [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 -NOTE: The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json ``` +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] compile-mono.sh diff --git a/modules/swagger-codegen/src/main/resources/csharp/RestSharp.dll b/modules/swagger-codegen/src/main/resources/csharp/RestSharp.dll deleted file mode 100644 index a7331ed6e23..00000000000 Binary files a/modules/swagger-codegen/src/main/resources/csharp/RestSharp.dll and /dev/null differ diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index b1a6a321c56..47139b52865 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -16,6 +16,7 @@ namespace {{packageName}}.Api /// public interface I{{classname}} { + #region Synchronous Operations {{#operation}} /// /// {{summary}} @@ -36,7 +37,11 @@ namespace {{packageName}}.Api {{#allParams}}/// {{description}} {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - + {{/operation}} + #endregion Synchronous Operations + {{#supportsAsync}} + #region Asynchronous Operations + {{#operation}} /// /// {{summary}} /// @@ -57,6 +62,8 @@ namespace {{packageName}}.Api {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} + #endregion Asynchronous Operations + {{/supportsAsync}} } /// @@ -245,7 +252,8 @@ namespace {{packageName}}.Api response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null);{{/returnType}} } - + + {{#supportsAsync}} /// /// {{summary}} {{notes}} /// @@ -349,7 +357,7 @@ namespace {{packageName}}.Api {{^returnType}}return new ApiResponse(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null);{{/returnType}} - } + }{{/supportsAsync}} {{/operation}} } {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache index b84363cae39..b1b0c4f0c73 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache @@ -1,10 +1,17 @@ #!/usr/bin/env bash +frameworkVersion={{targetFrameworkNuget}} +netfx=${frameworkVersion#net} + wget -nc https://nuget.org/nuget.exe; mozroots --import --sync mono nuget.exe install vendor/packages.config -o vendor; mkdir -p bin; -mcs -sdk:45 -r:vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll,\ -vendor/RestSharp.105.2.3/lib/net45/RestSharp.dll,\ + +cp vendor/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp vendor/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll; + +mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\ +bin/RestSharp.dll,\ System.Runtime.Serialization.dll \ -target:library \ -out:bin/{{packageName}}.dll \ diff --git a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache index e35879e0efa..6014320b2f7 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/compile.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache @@ -1,3 +1,12 @@ -SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319 -%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/{{packageName}}.dll /recurse:src\*.cs /doc:bin/{{packageName}}.xml +@echo off + +{{#supportsAsync}}SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319{{/supportsAsync}} +{{^supportsAsync}}SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v3.5{{/supportsAsync}} + +if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')" +.\nuget.exe install vendor/packages.config -o vendor +cp vendor/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll +cp vendor/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll + +%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/{{packageName}}.dll /recurse:src\*.cs /doc:bin/{{packageName}}.xml diff --git a/modules/swagger-codegen/src/main/resources/csharp/packages.config.mustache b/modules/swagger-codegen/src/main/resources/csharp/packages.config.mustache index c87bbb79fa6..bd4428e687e 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/packages.config.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/packages.config.mustache @@ -1,5 +1,5 @@ - - + + diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java index f7abe83f8f4..ce810faea8b 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java @@ -31,6 +31,7 @@ public Map createOptions() { .put(CodegenConstants.RETURN_ICOLLECTION, "false") .put(CodegenConstants.OPTIONAL_PROJECT_FILE, "true") .put(CodegenConstants.OPTIONAL_PROJECT_GUID, PACKAGE_GUID_VALUE) + .put(CodegenConstants.DOTNET_FRAMEWORK, "4.x") .build(); } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/.gitignore b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/.gitignore new file mode 100644 index 00000000000..08d9d469ba8 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/.gitignore @@ -0,0 +1,2 @@ +vendor/Newtonsoft.Json.8.0.2/ +vendor/RestSharp.105.2.3/ \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/Newtonsoft.Json.dll b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/Newtonsoft.Json.dll index ae725c4b598..4d42dd9c5fe 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/Newtonsoft.Json.dll and b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/Newtonsoft.Json.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/RestSharp.dll b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/RestSharp.dll index a7331ed6e23..59d82f94198 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/RestSharp.dll and b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/bin/RestSharp.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh index 67bc67e57a8..d768c892f31 100755 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh @@ -1,10 +1,17 @@ #!/usr/bin/env bash +frameworkVersion=net45 +netfx=${frameworkVersion#net} + wget -nc https://nuget.org/nuget.exe; mozroots --import --sync mono nuget.exe install vendor/packages.config -o vendor; mkdir -p bin; -mcs -sdk:45 -r:vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll,\ -vendor/RestSharp.105.2.3/lib/net45/RestSharp.dll,\ + +cp vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll; + +mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\ +bin/RestSharp.dll,\ System.Runtime.Serialization.dll \ -target:library \ -out:bin/IO.Swagger.dll \ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile.bat b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile.bat index 90963356690..27681fc968d 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile.bat +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile.bat @@ -1,3 +1,12 @@ +@echo off + SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319 -%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/IO.Swagger.dll /recurse:src\*.cs /doc:bin/IO.Swagger.xml + +if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')" +.\nuget.exe install vendor/packages.config -o vendor + +cp vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll +cp vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll + +%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/IO.Swagger.dll /recurse:src\*.cs /doc:bin/IO.Swagger.xml diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs index 96f6b3a4d0f..27c73638479 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs @@ -15,6 +15,7 @@ namespace IO.Swagger.Api /// public interface IPetApi { + #region Synchronous Operations /// /// Update an existing pet @@ -35,87 +36,241 @@ public interface IPetApi /// Pet object that needs to be added to the store /// ApiResponse of Object(void) ApiResponse UpdatePetWithHttpInfo (Pet body = null); - + /// - /// Update an existing pet + /// Add a new pet to the store /// /// /// /// /// Pet object that needs to be added to the store - /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body = null); - + /// + void AddPet (Pet body = null); + /// - /// Update an existing pet + /// Add a new pet to the store /// /// /// /// /// Pet object that needs to be added to the store - /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body = null); + /// ApiResponse of Object(void) + ApiResponse AddPetWithHttpInfo (Pet body = null); /// - /// Add a new pet to the store + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma seperated strings + /// + /// Status values that need to be considered for filter + /// List<Pet> + List FindPetsByStatus (List status = null); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma seperated strings + /// + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByStatusWithHttpInfo (List status = null); + + /// + /// Finds Pets by tags + /// + /// + /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// List<Pet> + List FindPetsByTags (List tags = null); + + /// + /// Finds Pets by tags + /// + /// + /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByTagsWithHttpInfo (List tags = null); + + /// + /// Find pet by ID + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Pet + Pet GetPetById (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// ApiResponse of Pet + ApiResponse GetPetByIdWithHttpInfo (long? petId); + + /// + /// Updates a pet in the store with form data /// /// /// /// - /// Pet object that needs to be added to the store + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet /// - void AddPet (Pet body = null); + void UpdatePetWithForm (string petId, string name = null, string status = null); /// - /// Add a new pet to the store + /// Updates a pet in the store with form data /// /// /// /// - /// Pet object that needs to be added to the store + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet body = null); - + ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null); + /// - /// Add a new pet to the store + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// + /// + void DeletePet (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// + /// ApiResponse of Object(void) + ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// + void UploadFile (long? petId, string additionalMetadata = null, Stream file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// ApiResponse of Object(void) + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null); + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// byte[] + byte[] GetPetByIdWithByteArray (long? petId); + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// ApiResponse of byte[] + ApiResponse GetPetByIdWithByteArrayWithHttpInfo (long? petId); + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// + /// + /// + /// Pet object in the form of byte array + /// + void AddPetUsingByteArray (byte[] body = null); + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// + /// + /// + /// Pet object in the form of byte array + /// ApiResponse of Object(void) + ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null); + + #endregion Synchronous Operations + + #region Asynchronous Operations + + /// + /// Update an existing pet /// /// /// /// /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body = null); + System.Threading.Tasks.Task UpdatePetAsync (Pet body = null); /// - /// Add a new pet to the store + /// Update an existing pet /// /// /// /// /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body = null); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body = null); /// - /// Finds Pets by status + /// Add a new pet to the store /// /// - /// Multiple status values can be provided with comma seperated strings + /// /// - /// Status values that need to be considered for filter - /// List<Pet> - List FindPetsByStatus (List status = null); - + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task AddPetAsync (Pet body = null); + /// - /// Finds Pets by status + /// Add a new pet to the store /// /// - /// Multiple status values can be provided with comma seperated strings + /// /// - /// Status values that need to be considered for filter - /// ApiResponse of List<Pet> - ApiResponse> FindPetsByStatusWithHttpInfo (List status = null); - + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body = null); + /// /// Finds Pets by status /// @@ -136,26 +291,6 @@ public interface IPetApi /// Task of ApiResponse (List<Pet>) System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status = null); - /// - /// Finds Pets by tags - /// - /// - /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - List FindPetsByTags (List tags = null); - - /// - /// Finds Pets by tags - /// - /// - /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// ApiResponse of List<Pet> - ApiResponse> FindPetsByTagsWithHttpInfo (List tags = null); - /// /// Finds Pets by tags /// @@ -176,26 +311,6 @@ public interface IPetApi /// Task of ApiResponse (List<Pet>) System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags = null); - /// - /// Find pet by ID - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// Pet - Pet GetPetById (long? petId); - - /// - /// Find pet by ID - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); - /// /// Find pet by ID /// @@ -216,30 +331,6 @@ public interface IPetApi /// Task of ApiResponse (Pet) System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); - /// - /// Updates a pet in the store with form data - /// - /// - /// - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - void UpdatePetWithForm (string petId, string name = null, string status = null); - - /// - /// Updates a pet in the store with form data - /// - /// - /// - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null); - /// /// Updates a pet in the store with form data /// @@ -264,28 +355,6 @@ public interface IPetApi /// Task of ApiResponse System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (string petId, string name = null, string status = null); - /// - /// Deletes a pet - /// - /// - /// - /// - /// Pet id to delete - /// - /// - void DeletePet (long? petId, string apiKey = null); - - /// - /// Deletes a pet - /// - /// - /// - /// - /// Pet id to delete - /// - /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); - /// /// Deletes a pet /// @@ -308,30 +377,6 @@ public interface IPetApi /// Task of ApiResponse System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); - /// - /// uploads an image - /// - /// - /// - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// - void UploadFile (long? petId, string additionalMetadata = null, Stream file = null); - - /// - /// uploads an image - /// - /// - /// - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse of Object(void) - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null); - /// /// uploads an image /// @@ -356,26 +401,6 @@ public interface IPetApi /// Task of ApiResponse System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null); - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// byte[] - byte[] GetPetByIdWithByteArray (long? petId); - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// ApiResponse of byte[] - ApiResponse GetPetByIdWithByteArrayWithHttpInfo (long? petId); - /// /// Fake endpoint to test byte array return by 'Find pet by ID' /// @@ -396,26 +421,6 @@ public interface IPetApi /// Task of ApiResponse (byte[]) System.Threading.Tasks.Task> GetPetByIdWithByteArrayAsyncWithHttpInfo (long? petId); - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// - /// - /// - /// Pet object in the form of byte array - /// - void AddPetUsingByteArray (byte[] body = null); - - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// - /// - /// - /// Pet object in the form of byte array - /// ApiResponse of Object(void) - ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null); - /// /// Fake endpoint to test byte array in body parameter for adding a new pet to the store /// @@ -436,6 +441,8 @@ public interface IPetApi /// Task of ApiResponse System.Threading.Tasks.Task> AddPetUsingByteArrayAsyncWithHttpInfo (byte[] body = null); + #endregion Asynchronous Operations + } /// @@ -598,7 +605,8 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body = null) response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Update an existing pet /// @@ -764,7 +772,8 @@ public ApiResponse AddPetWithHttpInfo (Pet body = null) response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Add a new pet to the store /// @@ -925,7 +934,8 @@ public ApiResponse< List > FindPetsByStatusWithHttpInfo (List statu (List) Configuration.ApiClient.Deserialize(response, typeof(List))); } - + + /// /// Finds Pets by status Multiple status values can be provided with comma seperated strings /// @@ -1087,7 +1097,8 @@ public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags = (List) Configuration.ApiClient.Deserialize(response, typeof(List))); } - + + /// /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. /// @@ -1253,7 +1264,8 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) (Pet) Configuration.ApiClient.Deserialize(response, typeof(Pet))); } - + + /// /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// @@ -1426,7 +1438,8 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string n response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Updates a pet in the store with form data /// @@ -1601,7 +1614,8 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Deletes a pet /// @@ -1776,7 +1790,8 @@ public ApiResponse UploadFileWithHttpInfo (long? petId, string additiona response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// uploads an image /// @@ -1949,7 +1964,8 @@ public ApiResponse< byte[] > GetPetByIdWithByteArrayWithHttpInfo (long? petId) (byte[]) Configuration.ApiClient.Deserialize(response, typeof(byte[]))); } - + + /// /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions /// @@ -2118,7 +2134,8 @@ public ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null) response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Fake endpoint to test byte array in body parameter for adding a new pet to the store /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs index ca876a043db..2646ef0619a 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs @@ -15,6 +15,7 @@ namespace IO.Swagger.Api /// public interface IStoreApi { + #region Synchronous Operations /// /// Returns pet inventories by status @@ -33,24 +34,6 @@ public interface IStoreApi /// /// ApiResponse of Dictionary<string, int?> ApiResponse> GetInventoryWithHttpInfo (); - - /// - /// Returns pet inventories by status - /// - /// - /// Returns a map of status codes to quantities - /// - /// Task of Dictionary<string, int?> - System.Threading.Tasks.Task> GetInventoryAsync (); - - /// - /// Returns pet inventories by status - /// - /// - /// Returns a map of status codes to quantities - /// - /// Task of ApiResponse (Dictionary<string, int?>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// /// Place an order for a pet @@ -71,26 +54,6 @@ public interface IStoreApi /// order placed for purchasing the pet /// ApiResponse of Order ApiResponse PlaceOrderWithHttpInfo (Order body = null); - - /// - /// Place an order for a pet - /// - /// - /// - /// - /// order placed for purchasing the pet - /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body = null); - - /// - /// Place an order for a pet - /// - /// - /// - /// - /// order placed for purchasing the pet - /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body = null); /// /// Find purchase order by ID @@ -111,26 +74,6 @@ public interface IStoreApi /// ID of pet that needs to be fetched /// ApiResponse of Order ApiResponse GetOrderByIdWithHttpInfo (string orderId); - - /// - /// Find purchase order by ID - /// - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (string orderId); - - /// - /// Find purchase order by ID - /// - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (string orderId); /// /// Delete purchase order by ID @@ -151,7 +94,69 @@ public interface IStoreApi /// ID of the order that needs to be deleted /// ApiResponse of Object(void) ApiResponse DeleteOrderWithHttpInfo (string orderId); + + #endregion Synchronous Operations + + #region Asynchronous Operations + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Task of Dictionary<string, int?> + System.Threading.Tasks.Task> GetInventoryAsync (); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Task of ApiResponse (Dictionary<string, int?>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync (Order body = null); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body = null); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Task of Order + System.Threading.Tasks.Task GetOrderByIdAsync (string orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (string orderId); + /// /// Delete purchase order by ID /// @@ -172,6 +177,8 @@ public interface IStoreApi /// Task of ApiResponse System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + #endregion Asynchronous Operations + } /// @@ -326,7 +333,8 @@ public void AddDefaultHeader(string key, string value) (Dictionary) Configuration.ApiClient.Deserialize(response, typeof(Dictionary))); } - + + /// /// Returns pet inventories by status Returns a map of status codes to quantities /// @@ -484,7 +492,8 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null) (Order) Configuration.ApiClient.Deserialize(response, typeof(Order))); } - + + /// /// Place an order for a pet /// @@ -635,7 +644,8 @@ public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId) (Order) Configuration.ApiClient.Deserialize(response, typeof(Order))); } - + + /// /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// @@ -787,7 +797,8 @@ public ApiResponse DeleteOrderWithHttpInfo (string orderId) response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs index 168ce373ef9..b97bb313873 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs @@ -15,6 +15,7 @@ namespace IO.Swagger.Api /// public interface IUserApi { + #region Synchronous Operations /// /// Create user @@ -35,26 +36,26 @@ public interface IUserApi /// Created user object /// ApiResponse of Object(void) ApiResponse CreateUserWithHttpInfo (User body = null); - + /// - /// Create user + /// Creates list of users with given input array /// /// - /// This can only be done by the logged in user. + /// /// - /// Created user object - /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body = null); - + /// List of user object + /// + void CreateUsersWithArrayInput (List body = null); + /// - /// Create user + /// Creates list of users with given input array /// /// - /// This can only be done by the logged in user. + /// /// - /// Created user object - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body = null); + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body = null); /// /// Creates list of users with given input array @@ -64,7 +65,7 @@ public interface IUserApi /// /// List of user object /// - void CreateUsersWithArrayInput (List body = null); + void CreateUsersWithListInput (List body = null); /// /// Creates list of users with given input array @@ -74,48 +75,134 @@ public interface IUserApi /// /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body = null); - + ApiResponse CreateUsersWithListInputWithHttpInfo (List body = null); + /// - /// Creates list of users with given input array + /// Logs user into the system /// /// /// /// - /// List of user object - /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body = null); - + /// The user name for login + /// The password for login in clear text + /// string + string LoginUser (string username = null, string password = null); + /// - /// Creates list of users with given input array + /// Logs user into the system /// /// /// /// - /// List of user object - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body = null); + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + ApiResponse LoginUserWithHttpInfo (string username = null, string password = null); /// - /// Creates list of users with given input array + /// Logs out current logged in user session /// /// /// /// - /// List of user object /// - void CreateUsersWithListInput (List body = null); + void LogoutUser (); /// - /// Creates list of users with given input array + /// Logs out current logged in user session /// /// /// /// - /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List body = null); + ApiResponse LogoutUserWithHttpInfo (); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// User + User GetUserByName (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + ApiResponse GetUserByNameWithHttpInfo (string username); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + /// + void UpdateUser (string username, User body = null); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + ApiResponse UpdateUserWithHttpInfo (string username, User body = null); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// + void DeleteUser (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteUserWithHttpInfo (string username); + + #endregion Synchronous Operations + + #region Asynchronous Operations + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Task of void + System.Threading.Tasks.Task CreateUserAsync (User body = null); + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body = null); + /// /// Creates list of users with given input array /// @@ -124,7 +211,7 @@ public interface IUserApi /// /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body = null); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body = null); /// /// Creates list of users with given input array @@ -134,30 +221,28 @@ public interface IUserApi /// /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body = null); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body = null); /// - /// Logs user into the system + /// Creates list of users with given input array /// /// /// /// - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser (string username = null, string password = null); - + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body = null); + /// - /// Logs user into the system + /// Creates list of users with given input array /// /// /// /// - /// The user name for login - /// The password for login in clear text - /// ApiResponse of string - ApiResponse LoginUserWithHttpInfo (string username = null, string password = null); - + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body = null); + /// /// Logs user into the system /// @@ -180,24 +265,6 @@ public interface IUserApi /// Task of ApiResponse (string) System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username = null, string password = null); - /// - /// Logs out current logged in user session - /// - /// - /// - /// - /// - void LogoutUser (); - - /// - /// Logs out current logged in user session - /// - /// - /// - /// - /// ApiResponse of Object(void) - ApiResponse LogoutUserWithHttpInfo (); - /// /// Logs out current logged in user session /// @@ -216,26 +283,6 @@ public interface IUserApi /// Task of ApiResponse System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); - /// - /// Get user by user name - /// - /// - /// - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName (string username); - - /// - /// Get user by user name - /// - /// - /// - /// - /// The name that needs to be fetched. Use user1 for testing. - /// ApiResponse of User - ApiResponse GetUserByNameWithHttpInfo (string username); - /// /// Get user by user name /// @@ -256,28 +303,6 @@ public interface IUserApi /// Task of ApiResponse (User) System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); - /// - /// Updated user - /// - /// - /// This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - void UpdateUser (string username, User body = null); - - /// - /// Updated user - /// - /// - /// This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User body = null); - /// /// Updated user /// @@ -300,26 +325,6 @@ public interface IUserApi /// Task of ApiResponse System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body = null); - /// - /// Delete user - /// - /// - /// This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - void DeleteUser (string username); - - /// - /// Delete user - /// - /// - /// This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// ApiResponse of Object(void) - ApiResponse DeleteUserWithHttpInfo (string username); - /// /// Delete user /// @@ -340,6 +345,8 @@ public interface IUserApi /// Task of ApiResponse System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + #endregion Asynchronous Operations + } /// @@ -495,7 +502,8 @@ public ApiResponse CreateUserWithHttpInfo (User body = null) response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Create user This can only be done by the logged in user. /// @@ -646,7 +654,8 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Creates list of users with given input array /// @@ -797,7 +806,8 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Creates list of users with given input array /// @@ -946,7 +956,8 @@ public ApiResponse< string > LoginUserWithHttpInfo (string username = null, stri (string) Configuration.ApiClient.Deserialize(response, typeof(string))); } - + + /// /// Logs user into the system /// @@ -1092,7 +1103,8 @@ public ApiResponse LogoutUserWithHttpInfo () response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Logs out current logged in user session /// @@ -1239,7 +1251,8 @@ public ApiResponse< User > GetUserByNameWithHttpInfo (string username) (User) Configuration.ApiClient.Deserialize(response, typeof(User))); } - + + /// /// Get user by user name /// @@ -1400,7 +1413,8 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Updated user This can only be done by the logged in user. /// @@ -1554,7 +1568,8 @@ public ApiResponse DeleteUserWithHttpInfo (string username) response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } - + + /// /// Delete user This can only be done by the logged in user. /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs index 9ff8b481e14..104911520a6 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs @@ -146,7 +146,7 @@ public Object CallApi( var response = RestClient.Execute(request); return (Object) response; } - + /// /// Makes the asynchronous HTTP request. /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Properties/AssemblyInfo.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Properties/AssemblyInfo.cs index 1de9edb2a81..f3b9f7d1d14 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Properties/AssemblyInfo.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Properties/AssemblyInfo.cs @@ -1,6 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; -using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config index c87bbb79fa6..91f17cd0819 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config @@ -1,5 +1,5 @@ - +