From 4482f71e05dcb338a25ebfd30851b50f48d5bf0a Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 3 Dec 2015 16:47:14 +0800 Subject: [PATCH] add apiresponse.mustache --- .../resources/csharp/ApiResponse.mustache | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache new file mode 100644 index 00000000000..32816110a1b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiResponse.mustache @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// API Response + /// + public class ApiResponse + { + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public int StatusCode { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public IDictionary Headers { get; private set; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Data (parsed HTTP body) + public ApiResponse(int statusCode, IDictionary headers, T data) + { + this.StatusCode= statusCode; + this.Headers = headers; + this.Data = data; + } + + } + +}