From a7e42ee2b673be6f199b67a27fb97fadb7c0891c Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 3 May 2017 21:32:25 +0800 Subject: [PATCH] add validatable flag for .net 3.5 (#5544) --- .../languages/CSharpClientCodegen.java | 9 +- .../src/main/resources/csharp/api.mustache | 28 +- .../resources/csharp/modelGeneric.mustache | 4 +- .../src/IO.Swagger/Api/FakeApi.cs | 10 +- .../src/IO.Swagger/Api/PetApi.cs | 44 +- .../src/IO.Swagger/Api/StoreApi.cs | 20 +- .../src/IO.Swagger/Api/UserApi.cs | 48 +- .../SwaggerClientNetStandard/IO.Swagger.sln | 10 +- .../csharp/SwaggerClientNetStandard/README.md | 6 +- .../SwaggerClientNetStandard/docs/FakeApi.md | 2 +- .../SwaggerClientNetStandard/docs/PetApi.md | 2 +- .../SwaggerClientNetStandard/docs/StoreApi.md | 6 +- .../SwaggerClientNetStandard/docs/UserApi.md | 2 +- .../src/IO.Swagger/Api/FakeApi.cs | 402 ++++++++- .../src/IO.Swagger/Api/PetApi.cs | 847 +++++++++++++++++- .../src/IO.Swagger/Api/StoreApi.cs | 390 +++++++- .../src/IO.Swagger/Api/UserApi.cs | 792 +++++++++++++++- .../src/IO.Swagger/Client/ApiClient.cs | 40 +- .../src/IO.Swagger/Client/ApiException.cs | 4 +- .../src/IO.Swagger/IO.Swagger.csproj | 2 +- .../src/IO.Swagger/Api/FakeApi.cs | 10 +- .../src/IO.Swagger/Api/PetApi.cs | 44 +- .../src/IO.Swagger/Api/StoreApi.cs | 20 +- .../src/IO.Swagger/Api/UserApi.cs | 48 +- 24 files changed, 2469 insertions(+), 321 deletions(-) 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 eeaad4853c..ff0ae876a9 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 @@ -188,13 +188,15 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { } additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); - additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); - additionalProperties.put("clientPackage", clientPackage); - additionalProperties.put("emitDefaultValue", optionalEmitDefaultValue); + if (!additionalProperties.containsKey("validatable")) { + // default validatable to true if not set + additionalProperties.put("validatable", true); + } + if (additionalProperties.containsKey(CodegenConstants.DOTNET_FRAMEWORK)) { setTargetFramework((String) additionalProperties.get(CodegenConstants.DOTNET_FRAMEWORK)); } else { @@ -209,6 +211,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { if(additionalProperties.containsKey("supportsAsync")){ additionalProperties.remove("supportsAsync"); } + additionalProperties.put("validatable", false); } else if (NETSTANDARD.equals(this.targetFramework)){ setTargetFrameworkNuget("netstandard1.3"); setSupportsAsync(Boolean.TRUE); diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index fa7eec9155..a16b99c9f6 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -232,7 +232,7 @@ namespace {{packageName}}.{{apiPackage}} // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { {{#produces}} - "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}} + "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} {{/produces}} }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -306,12 +306,16 @@ namespace {{packageName}}.{{apiPackage}} if (exception != null) throw exception; } - {{#returnType}}return new ApiResponse<{{{returnType}}}>(localVarStatusCode, + {{#returnType}} + return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), - ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}})));{{/returnType}} - {{^returnType}}return new ApiResponse(localVarStatusCode, + ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + {{/returnType}} + {{^returnType}} + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), - null);{{/returnType}} + null); + {{/returnType}} } {{#supportsAsync}} @@ -363,7 +367,7 @@ namespace {{packageName}}.{{apiPackage}} // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { {{#produces}} - "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}} + "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} {{/produces}} }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -438,12 +442,16 @@ namespace {{packageName}}.{{apiPackage}} if (exception != null) throw exception; } - {{#returnType}}return new ApiResponse<{{{returnType}}}>(localVarStatusCode, + {{#returnType}} + return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), - ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}})));{{/returnType}} - {{^returnType}}return new ApiResponse(localVarStatusCode, + ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + {{/returnType}} + {{^returnType}} + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), - null);{{/returnType}} + null); + {{/returnType}} } {{/supportsAsync}} diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache index 6465dccdb8..2f86f53b4f 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache @@ -5,7 +5,7 @@ {{#generatePropertyChanged}} [ImplementPropertyChanged] {{/generatePropertyChanged}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}, IValidatableObject{{/netStandard}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}} { {{#vars}} {{#isEnum}} @@ -196,6 +196,7 @@ this.{{name}} = {{name}}; } {{/generatePropertyChanged}} +{{#validatable}} /// /// To validate all properties of the instance /// @@ -236,5 +237,6 @@ this.{{name}} = {{name}}; {{/pattern}}{{/hasValidation}}{{/vars}} yield break; } +{{/validatable}} {{/netStandard}} } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index 127c5e582b..8ef1efbdf1 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -416,7 +416,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - } /// @@ -492,7 +491,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - } /// @@ -570,7 +568,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -613,7 +611,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -695,7 +692,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -737,7 +734,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -822,7 +818,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -908,7 +903,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs index 2ac2703b70..947001b7a5 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs @@ -534,7 +534,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -570,7 +570,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -617,7 +616,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -653,7 +652,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -699,7 +697,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -729,7 +727,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -776,7 +773,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -806,7 +803,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -851,7 +847,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -883,7 +879,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -926,7 +921,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -958,7 +953,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1000,7 +994,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1032,7 +1026,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1075,7 +1068,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1107,7 +1100,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1149,7 +1141,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1181,7 +1173,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - } /// @@ -1224,7 +1215,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1255,7 +1246,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - } /// @@ -1298,7 +1288,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1334,7 +1324,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1381,7 +1370,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1417,7 +1406,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1466,7 +1454,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1497,7 +1485,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1547,7 +1534,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1578,7 +1565,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1661,7 +1647,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - } /// @@ -1742,7 +1727,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs index 32d01eded1..5e77044a6f 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs @@ -340,7 +340,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -363,7 +363,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -408,7 +407,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -431,7 +430,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -501,7 +499,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); - } /// @@ -568,7 +565,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); - } /// @@ -610,7 +606,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -636,7 +632,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -679,7 +674,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -705,7 +700,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -747,7 +741,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -780,7 +774,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -823,7 +816,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -856,7 +849,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs index 281f116981..40c039964e 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/UserApi.cs @@ -516,7 +516,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -546,7 +546,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -591,7 +590,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -621,7 +620,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -665,7 +663,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -695,7 +693,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -740,7 +737,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -770,7 +767,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -814,7 +810,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -844,7 +840,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -889,7 +884,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -919,7 +914,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -963,7 +957,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -986,7 +980,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1031,7 +1024,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1054,7 +1047,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1099,7 +1091,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1125,7 +1117,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - } /// @@ -1168,7 +1159,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1194,7 +1185,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - } /// @@ -1241,7 +1231,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1268,7 +1258,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - } /// @@ -1316,7 +1305,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1343,7 +1332,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - } /// @@ -1379,7 +1367,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1401,7 +1389,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1441,7 +1428,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1463,7 +1450,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1512,7 +1498,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1543,7 +1529,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1593,7 +1578,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1624,7 +1609,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClientNetStandard/IO.Swagger.sln index 961033b799..32ab6d53fd 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{3AB1F259-1769-484B-9411-84505FCCBD55}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{3AB1F259-1769-484B-9411-84505FCCBD55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{3AB1F259-1769-484B-9411-84505FCCBD55}.Debug|Any CPU.Build.0 = Debug|Any CPU -{3AB1F259-1769-484B-9411-84505FCCBD55}.Release|Any CPU.ActiveCfg = Release|Any CPU -{3AB1F259-1769-484B-9411-84505FCCBD55}.Release|Any CPU.Build.0 = Release|Any CPU +{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU +{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU +{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md index 0435616c39..d56551bfcb 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md @@ -69,7 +69,7 @@ namespace Example ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -84,9 +84,9 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FakeApi.md index 44699db1dc..82a3463dac 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FakeApi.md @@ -1,6 +1,6 @@ # IO.Swagger.Api.FakeApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/PetApi.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/PetApi.md index da77647d5d..f3f49f5ed5 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/PetApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/PetApi.md @@ -1,6 +1,6 @@ # IO.Swagger.Api.PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/StoreApi.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/StoreApi.md index 24d03a779c..bf2fdb1ed6 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/StoreApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/StoreApi.md @@ -1,12 +1,12 @@ # IO.Swagger.Api.StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/UserApi.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/UserApi.md index b7fc0343d2..78553f5b38 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/UserApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/UserApi.md @@ -1,6 +1,6 @@ # IO.Swagger.Api.UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs index a53a7d9ed0..9c73f22c36 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs @@ -128,6 +128,111 @@ namespace IO.Swagger.Api /// ApiResponse of Object(void) ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// 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, byte[] 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 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// 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, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + #endregion Asynchronous Operations } /// @@ -285,9 +390,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -314,7 +416,81 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } /// @@ -392,16 +568,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter @@ -438,7 +611,129 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// 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, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// 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, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter + if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter + if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter + if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter + if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter + if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter + if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter + if (patternWithoutDelimiter != null) localVarFormParams.Add("pattern_without_delimiter", Configuration.ApiClient.ParameterToString(patternWithoutDelimiter)); // form parameter + if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter + if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter + if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter + if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter + if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter + if (callback != null) localVarFormParams.Add("callback", Configuration.ApiClient.ParameterToString(callback)); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -500,9 +795,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter @@ -526,7 +818,91 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + await TestEnumParametersAsyncWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (enumQueryStringArray != null) localVarQueryParams.Add("enum_query_string_array", Configuration.ApiClient.ParameterToString(enumQueryStringArray)); // query parameter + if (enumQueryString != null) localVarQueryParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // query parameter + if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter + if (enumHeaderStringArray != null) localVarHeaderParams.Add("enum_header_string_array", Configuration.ApiClient.ParameterToString(enumHeaderStringArray)); // header parameter + if (enumHeaderString != null) localVarHeaderParams.Add("enum_header_string", Configuration.ApiClient.ParameterToString(enumHeaderString)); // header parameter + if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", Configuration.ApiClient.ParameterToString(enumFormStringArray)); // form parameter + if (enumFormString != null) localVarFormParams.Add("enum_form_string", Configuration.ApiClient.ParameterToString(enumFormString)); // form parameter + if (enumQueryDouble != null) localVarFormParams.Add("enum_query_double", Configuration.ApiClient.ParameterToString(enumQueryDouble)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs index 2567787f2f..aee02b4ceb 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs @@ -203,6 +203,186 @@ namespace IO.Swagger.Api /// ApiResponse of ApiResponse ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task AddPetAsync (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task UpdatePetAsync (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + #endregion Asynchronous Operations } /// @@ -354,16 +534,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -393,7 +570,88 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task AddPetAsync (Pet body) + { + await AddPetAsyncWithHttpInfo(body); + + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "./pet"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -439,16 +697,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter @@ -472,7 +727,82 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + { + await DeletePetAsyncWithHttpInfo(petId, apiKey); + + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -517,16 +847,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter // authentication (petstore_auth) required @@ -552,7 +879,80 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + { + ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "./pet/findByStatus"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// @@ -594,16 +994,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter // authentication (petstore_auth) required @@ -629,7 +1026,80 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + { + ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "./pet/findByTags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (tags != null) localVarQueryParams.Add("tags", Configuration.ApiClient.ParameterToString(tags)); // query parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// @@ -671,16 +1141,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter // authentication (api_key) required @@ -706,7 +1173,79 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + { + ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + return localVarResponse.Data; + + } + + /// + /// Find pet by ID Returns a single pet + /// + /// 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) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter + + // authentication (api_key) required + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); } /// @@ -749,16 +1288,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -788,7 +1324,88 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + { + await UpdatePetAsyncWithHttpInfo(body); + + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "./pet"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -837,16 +1454,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter @@ -871,7 +1485,86 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + { + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter + if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -927,9 +1620,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); @@ -957,7 +1647,86 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + { + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + return localVarResponse.Data; + + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "./pet/{petId}/uploadImage"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs index 4ef6cc4653..a7d3bd9de5 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs @@ -107,6 +107,90 @@ namespace IO.Swagger.Api /// ApiResponse of Order ApiResponse PlaceOrderWithHttpInfo (Order body); #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + /// + /// 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?> + System.Threading.Tasks.Task> GetInventoryAsync (); + + /// + /// 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?>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// 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); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// 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); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + #endregion Asynchronous Operations } /// @@ -241,7 +325,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); - var localVarPath = "./store/order/{orderId}"; + var localVarPath = "./store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -256,17 +340,14 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -282,7 +363,73 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, 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 + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + { + await DeleteOrderAsyncWithHttpInfo(orderId); + + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "./store/order/{order_id}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -328,9 +475,6 @@ namespace IO.Swagger.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) @@ -355,7 +499,72 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Dictionary) 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 () + { + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// 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 () + { + + var localVarPath = "./store/inventory"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + // authentication (api_key) required + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -382,7 +591,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - var localVarPath = "./store/order/{orderId}"; + var localVarPath = "./store/order/{order_id}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); @@ -397,17 +606,14 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -426,7 +632,74 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// 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) + { + ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + return localVarResponse.Data; + + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// 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) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "./store/order/{order_id}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } /// @@ -468,16 +741,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -504,7 +774,81 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + { + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "./store/order"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs index 5593b8ef64..1e3a6d7023 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs @@ -195,6 +195,178 @@ namespace IO.Swagger.Api /// ApiResponse of Object(void) ApiResponse UpdateUserWithHttpInfo (string username, User body); #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + System.Threading.Tasks.Task CreateUserAsync (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteUserAsync (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + System.Threading.Tasks.Task GetUserByNameAsync (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + System.Threading.Tasks.Task LoginUserAsync (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of void + System.Threading.Tasks.Task LogoutUserAsync (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + #endregion Asynchronous Operations } /// @@ -344,16 +516,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -377,7 +546,80 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + public async System.Threading.Tasks.Task CreateUserAsync (User body) + { + await CreateUserAsyncWithHttpInfo(body); + + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "./user"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -421,16 +663,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -454,7 +693,80 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + { + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "./user/createWithArray"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -498,16 +810,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter @@ -531,7 +840,80 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + { + await CreateUsersWithListInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "./user/createWithList"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -575,16 +957,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -601,7 +980,73 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteUserAsync (string username) + { + await DeleteUserAsyncWithHttpInfo(username); + + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -646,16 +1091,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter @@ -675,7 +1117,74 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + { + ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + return localVarResponse.Data; + + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); } /// @@ -722,16 +1231,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter @@ -752,7 +1258,80 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + { + ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + return localVarResponse.Data; + + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "./user/login"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarQueryParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // query parameter + if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// @@ -788,16 +1367,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); // make the HTTP request @@ -813,7 +1389,67 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of void + public async System.Threading.Tasks.Task LogoutUserAsync () + { + await LogoutUserAsyncWithHttpInfo(); + + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + { + + var localVarPath = "./user/logout"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -862,16 +1498,13 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter if (body != null && body.GetType() != typeof(byte[])) { @@ -896,7 +1529,86 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + { + await UpdateUserAsyncWithHttpInfo(username, body); + + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs index 2dbabaf324..94356fb227 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs @@ -48,18 +48,18 @@ namespace IO.Swagger.Client /// /// Initializes a new instance of the class - /// with default configuration and base path (http://petstore.swagger.io/v2). + /// with default configuration and base path (http://petstore.swagger.io:80/v2). /// public ApiClient() { Configuration = Configuration.Default; - RestClient = new RestClient("http://petstore.swagger.io/v2"); + RestClient = new RestClient("http://petstore.swagger.io:80/v2"); RestClient.IgnoreResponseStatusCode = true; } /// /// Initializes a new instance of the class - /// with default base path (http://petstore.swagger.io/v2). + /// with default base path (http://petstore.swagger.io:80/v2). /// /// An instance of Configuration. public ApiClient(Configuration config = null) @@ -69,7 +69,7 @@ namespace IO.Swagger.Client else Configuration = config; - RestClient = new RestClient("http://petstore.swagger.io/v2"); + RestClient = new RestClient("http://petstore.swagger.io:80/v2"); RestClient.IgnoreResponseStatusCode = true; } @@ -78,7 +78,7 @@ namespace IO.Swagger.Client /// with default configuration. /// /// The base path. - public ApiClient(String basePath = "http://petstore.swagger.io/v2") + public ApiClient(String basePath = "http://petstore.swagger.io:80/v2") { if (String.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); @@ -187,7 +187,33 @@ namespace IO.Swagger.Client return (Object) response; } - + /// + /// Makes the asynchronous HTTP request. + /// + /// URL path. + /// HTTP method. + /// Query parameters. + /// HTTP body (POST request). + /// Header parameters. + /// Form parameters. + /// File parameters. + /// Path parameters. + /// Content type. + /// The Task instance. + public async System.Threading.Tasks.Task CallApiAsync( + String path, Method method, Dictionary queryParams, Object postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, Dictionary pathParams, + String contentType) + { + var request = PrepareRequest( + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); + InterceptRequest(request); + var response = await RestClient.Execute(request); + InterceptResponse(request, response); + return (Object)response; + } /// /// Escape string (url-encoded). @@ -377,7 +403,7 @@ namespace IO.Swagger.Client /// Object to be casted /// Target type /// Casted object - public static object ConvertType(T source, Type dest) where T : class + public static dynamic ConvertType(dynamic source, Type dest) { return Convert.ChangeType(source, dest); } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs index 8f0fc5a05d..79c6432ffc 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs @@ -27,7 +27,7 @@ namespace IO.Swagger.Client /// Gets or sets the error content (body json object) /// /// The error content (Http response body). - public object ErrorContent { get; private set; } + public dynamic ErrorContent { get; private set; } /// /// Initializes a new instance of the class. @@ -50,7 +50,7 @@ namespace IO.Swagger.Client /// HTTP status code. /// Error message. /// Error content. - public ApiException(int errorCode, string message, object errorContent = null) : base(message) + public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) { this.ErrorCode = errorCode; this.ErrorContent = errorContent; diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj index 6e47e4c63e..2429b4217d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj @@ -12,7 +12,7 @@ Contact: apiteam@swagger.io 14.0 Debug AnyCPU - {3AB1F259-1769-484B-9411-84505FCCBD55} + {321C8C3F-0156-40C1-AE42-D59761FB9B6C} Library Properties IO.Swagger diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs index 127c5e582b..8ef1efbdf1 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs @@ -416,7 +416,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - } /// @@ -492,7 +491,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - } /// @@ -570,7 +568,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -613,7 +611,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -695,7 +692,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -737,7 +734,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -822,7 +818,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -908,7 +903,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs index 2ac2703b70..947001b7a5 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs @@ -534,7 +534,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -570,7 +570,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -617,7 +616,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -653,7 +652,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -699,7 +697,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -729,7 +727,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -776,7 +773,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -806,7 +803,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -851,7 +847,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -883,7 +879,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -926,7 +921,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -958,7 +953,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1000,7 +994,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1032,7 +1026,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1075,7 +1068,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1107,7 +1100,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1149,7 +1141,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1181,7 +1173,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - } /// @@ -1224,7 +1215,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1255,7 +1246,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - } /// @@ -1298,7 +1288,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1334,7 +1324,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1381,7 +1370,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1417,7 +1406,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1466,7 +1454,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1497,7 +1485,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1547,7 +1534,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1578,7 +1565,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1661,7 +1647,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - } /// @@ -1742,7 +1727,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs index 32d01eded1..5e77044a6f 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs @@ -340,7 +340,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -363,7 +363,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -408,7 +407,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -431,7 +430,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -501,7 +499,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); - } /// @@ -568,7 +565,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); - } /// @@ -610,7 +606,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -636,7 +632,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -679,7 +674,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -705,7 +700,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -747,7 +741,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -780,7 +774,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -823,7 +816,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -856,7 +849,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs index 281f116981..40c039964e 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs @@ -516,7 +516,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -546,7 +546,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -591,7 +590,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -621,7 +620,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -665,7 +663,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -695,7 +693,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -740,7 +737,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -770,7 +767,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -814,7 +810,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -844,7 +840,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -889,7 +884,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -919,7 +914,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -963,7 +957,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -986,7 +980,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1031,7 +1024,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1054,7 +1047,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1099,7 +1091,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1125,7 +1117,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - } /// @@ -1168,7 +1159,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1194,7 +1185,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - } /// @@ -1241,7 +1231,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1268,7 +1258,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - } /// @@ -1316,7 +1305,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1343,7 +1332,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - } /// @@ -1379,7 +1367,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1401,7 +1389,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1441,7 +1428,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1463,7 +1450,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1512,7 +1498,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1543,7 +1529,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); @@ -1593,7 +1578,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1624,7 +1609,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null);