From d7d6ba957ee962c0dc8bc897447d6ba9c5f44f56 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 3 Jul 2015 11:45:31 +0800 Subject: [PATCH] fix comment and use 4-space indentation --- ; | 289 +++ .../main/resources/csharp/ApiClient.mustache | 537 +++--- .../src/main/resources/csharp/api.mustache | 313 ++-- .../src/main/csharp/IO/Swagger/Api/PetApi.cs | 1605 ++++++++--------- .../main/csharp/IO/Swagger/Api/StoreApi.cs | 819 +++++---- .../src/main/csharp/IO/Swagger/Api/UserApi.cs | 1544 ++++++++-------- .../csharp/IO/Swagger/Client/ApiClient.cs | 547 +++--- .../bin/Debug/SwaggerClientTest.dll.mdb | Bin 16747 -> 16754 bytes .../obj/Debug/SwaggerClientTest.dll.mdb | Bin 16747 -> 16754 bytes 9 files changed, 2931 insertions(+), 2723 deletions(-) create mode 100644 ; diff --git a/; b/; new file mode 100644 index 00000000000..40162ff7505 --- /dev/null +++ b/; @@ -0,0 +1,289 @@ +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; +using RestSharp; + +namespace {{packageName}}.Client { + /// + /// API client is mainly responible for making the HTTP call to the API backend + /// + public class ApiClient { + + /// + /// Initializes a new instance of the class. + /// + /// The base path. + public ApiClient(String basePath="{{basePath}}") { + this.BasePath = basePath; + this.RestClient = new RestClient(this.BasePath); + } + + /// + /// Gets or sets the base path. + /// + /// The base path. + public string BasePath { get; set; } + + /// + /// Gets or sets the RestClient + /// + /// The RestClient. + public RestClient RestClient { get; set; } + + private Dictionary DefaultHeaderMap = new Dictionary(); + + public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, String[] authSettings) { + var response = Task.Run(async () => { + var resp = await CallApiAsync(path, method, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + return resp; + }); + return response.Result; + } + + public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { + + var request = new RestRequest(path, method); + + UpdateParamsForAuth(queryParams, headerParams, authSettings); + + // add default header, if any + foreach(KeyValuePair defaultHeader in this.DefaultHeaderMap) + request.AddHeader(defaultHeader.Key, defaultHeader.Value); + + // add header parameter, if any + foreach(KeyValuePair param in headerParams) + request.AddHeader(param.Key, param.Value); + + // add query parameter, if any + foreach(KeyValuePair param in queryParams) + request.AddQueryParameter(param.Key, param.Value); + + // add form parameter, if any + foreach(KeyValuePair param in formParams) + request.AddParameter(param.Key, param.Value); + + // add file parameter, if any + foreach(KeyValuePair param in fileParams) + request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); + + + if (postBody != null) { + request.AddParameter("application/json", postBody, ParameterType.RequestBody); // http body (model) parameter + } + + return (Object) await RestClient.ExecuteTaskAsync(request); + + } + + /// + /// Add default header + /// + /// Header field name + /// Header field value + /// + public void AddDefaultHeader(string key, string value) { + DefaultHeaderMap.Add(key, value); + } + + /// + /// Get default header + /// + /// Dictionary of default header + public Dictionary GetDefaultHeader() { + return DefaultHeaderMap; + } + + /// + /// escape string (url-encoded) + /// + /// String to be escaped + /// Escaped string + public string EscapeString(string str) { + return str; + } + + /// + /// Create FileParameter based on Stream + /// + /// parameter name + /// Stream + /// FileParameter + public FileParameter ParameterToFile(string name, Stream stream) + { + if (stream is FileStream) { + return FileParameter.Create(name, StreamToByteArray(stream), ((FileStream)stream).Name); + } else { + return FileParameter.Create(name, StreamToByteArray(stream), "temp_name_here"); + } + } + + /// + /// if parameter is DateTime, output in ISO8601 format + /// if parameter is a list of string, join the list with "," + /// otherwise just return the string + /// + /// The parameter (header, path, query, form) + /// Formatted string + public string ParameterToString(object obj) + { + if (obj is DateTime) { + return ((DateTime)obj).ToString ("u"); + } else if (obj is List) { + return String.Join(",", obj as List); + } else { + return Convert.ToString (obj); + } + } + + /// + /// Deserialize the JSON string into a proper object + /// + /// HTTP body (e.g. string, JSON) + /// Object type + /// Object representation of the JSON string + public object Deserialize(string content, Type type, IList headers=null) { + if (type.GetType() == typeof(Object)) { // return an object + return (Object)content; + } else if (type.Name == "Stream") { + String fileName, filePath; + if (String.IsNullOrEmpty (Configuration.TempFolderPath)) { + filePath = System.IO.Path.GetTempPath (); + } else { + filePath = Configuration.TempFolderPath; + } + + Regex regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); + Match match = regex.Match(headers.ToString()); + if (match.Success) { + // replace first and last " or ', if found + fileName = filePath + match.Value.Replace("\"", "").Replace("'",""); + } else { + fileName = filePath + Guid.NewGuid().ToString(); + } + File.WriteAllText (fileName, content); + return new FileStream(fileName, FileMode.Open); + } else if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) { // return a datetime object + return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } else if (type.Name == "String" || type.Name.StartsWith("System.Nullable")) { // return primitive + return ConvertType(content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(content, type); + } + catch (IOException e) { + throw new ApiException(500, e.Message); + } + } + + /// + /// Serialize an object into JSON string + /// + /// Object + /// JSON string + public string Serialize(object obj) { + try + { + return obj != null ? JsonConvert.SerializeObject(obj) : null; + } + catch (Exception e) { + throw new ApiException(500, e.Message); + } + } + + /// + /// Get the API key with prefix + /// + /// Object + /// API key with prefix + public string GetApiKeyWithPrefix (string apiKeyIdentifier) + { + var apiKeyValue = ""; + Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) { + return apiKeyPrefix + " " + apiKeyValue; + } else { + return apiKeyValue; + } + } + + /// + /// Update parameters based on authentication + /// + /// Query parameters + /// Header parameters + /// Authentication settings + public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) { + if (authSettings == null || authSettings.Length == 0) + return; + + foreach (string auth in authSettings) { + // determine which one to use + switch(auth) { + {{#authMethods}} + case "{{name}}": + {{#isApiKey}}{{#isKeyInHeader}}headerParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}}queryParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password);{{/isBasic}} + {{#isOAuth}}//TODO support oauth{{/isOAuth}} + break; + {{/authMethods}} + default: + //TODO show warning about security definition not found + break; + } + } + + } + + /// + /// convert a stream to byte array (byte[]) + /// Ref: http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream + /// + /// input stream + /// Array of Byte + public byte[] StreamToByteArray(Stream input) + { + byte[] buffer = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int read; + while ((read = input.Read(buffer, 0, buffer.Length)) > 0) + { + ms.Write(buffer, 0, read); + } + return ms.ToArray(); + } + } + + /// + /// Encode string in base64 format + /// + /// String to be encoded + public static string Base64Encode(string text) { + var textByte = System.Text.Encoding.UTF8.GetBytes(text); + return System.Convert.ToBase64String(textByte); + } + + /// + /// Dynamically cast the object into target type + /// Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast + /// + /// Object to be casted + /// Target type + public static dynamic ConvertType(dynamic source, Type dest) { + return Convert.ChangeType(source, dest); + } + + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index f4ffee145ed..fc3825491d2 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -10,279 +10,280 @@ using Newtonsoft.Json; using RestSharp; namespace {{packageName}}.Client { - /// - /// API client is mainly responible for making the HTTP call to the API backend - /// - public class ApiClient { - /// - /// Initializes a new instance of the class. + /// API client is mainly responible for making the HTTP call to the API backend /// - /// The base path. - public ApiClient(String basePath="{{basePath}}") { - this.BasePath = basePath; - this.RestClient = new RestClient(this.BasePath); - } - - /// - /// Gets or sets the base path. - /// - /// The base path. - public string BasePath { get; set; } - - /// - /// Gets or sets the RestClient - /// - /// The RestClient. - public RestClient RestClient { get; set; } - - private Dictionary DefaultHeaderMap = new Dictionary(); - - public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { - var response = Task.Run(async () => { - var resp = await CallApiAsync(path, method, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - return resp; - }); - return response.Result; - } - - public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { - - var request = new RestRequest(path, method); - - UpdateParamsForAuth(queryParams, headerParams, authSettings); - - // add default header, if any - foreach(KeyValuePair defaultHeader in this.DefaultHeaderMap) - request.AddHeader(defaultHeader.Key, defaultHeader.Value); - - // add header parameter, if any - foreach(KeyValuePair param in headerParams) - request.AddHeader(param.Key, param.Value); - - // add query parameter, if any - foreach(KeyValuePair param in queryParams) - request.AddQueryParameter(param.Key, param.Value); - - // add form parameter, if any - foreach(KeyValuePair param in formParams) - request.AddParameter(param.Key, param.Value); - - // add file parameter, if any - foreach(KeyValuePair param in fileParams) - request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - - - if (postBody != null) { - request.AddParameter("application/json", postBody, ParameterType.RequestBody); // http body (model) parameter - } - - return (Object) await RestClient.ExecuteTaskAsync(request); - - } - - /// - /// Add default header - /// - /// Header field name - /// Header field value - /// - public void AddDefaultHeader(string key, string value) { - DefaultHeaderMap.Add(key, value); - } - - /// - /// Get default header - /// - /// Dictionary of default header - public Dictionary GetDefaultHeader() { - return DefaultHeaderMap; - } - - /// - /// escape string (url-encoded) - /// - /// String to be escaped - /// Escaped string - public string EscapeString(string str) { - return str; - } - - /// - /// Create FileParameter based on Stream - /// - /// parameter name - /// Stream - /// FileParameter - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) { - return FileParameter.Create(name, StreamToByteArray(stream), ((FileStream)stream).Name); - } else { - return FileParameter.Create(name, StreamToByteArray(stream), "temp_name_here"); - } - } - - /// - /// if parameter is DateTime, output in ISO8601 format - /// if parameter is a list of string, join the list with "," - /// otherwise just return the string - /// - /// The parameter (header, path, query, form) - /// Formatted string - public string ParameterToString(object obj) - { - if (obj is DateTime) { - return ((DateTime)obj).ToString ("u"); - } else if (obj is List) { - return String.Join(",", obj as List); - } else { - return Convert.ToString (obj); - } - } - - /// - /// Deserialize the JSON string into a proper object - /// - /// HTTP body (e.g. string, JSON) - /// Object type - /// Object representation of the JSON string - public object Deserialize(string content, Type type, IList headers=null) { - if (type.GetType() == typeof(Object)) { // return an object - return (Object)content; - } else if (type.Name == "Stream") { - String fileName, filePath; - if (String.IsNullOrEmpty (Configuration.TempFolderPath)) { - filePath = System.IO.Path.GetTempPath (); - } else { - filePath = Configuration.TempFolderPath; - } - - Regex regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); - Match match = regex.Match(headers.ToString()); - if (match.Success) { - // replace first and last " or ', if found - fileName = filePath + match.Value.Replace("\"", "").Replace("'",""); - } else { - fileName = filePath + Guid.NewGuid().ToString(); - } - File.WriteAllText (fileName, content); - return new FileStream(fileName, FileMode.Open); - } else if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) { // return a datetime object - return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } else if (type.Name == "String" || type.Name.StartsWith("System.Nullable")) { // return primitive - return ConvertType(content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(content, type); - } - catch (IOException e) { - throw new ApiException(500, e.Message); - } - } - - /// - /// Serialize an object into JSON string - /// - /// Object - /// JSON string - public string Serialize(object obj) { - try - { - return obj != null ? JsonConvert.SerializeObject(obj) : null; - } - catch (Exception e) { - throw new ApiException(500, e.Message); - } - } - - /// - /// Get the API key with prefix - /// - /// Object - /// API key with prefix - public string GetApiKeyWithPrefix (string apiKeyIdentifier) - { - var apiKeyValue = ""; - Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) { - return apiKeyPrefix + " " + apiKeyValue; - } else { - return apiKeyValue; - } - } - - /// - /// Update parameters based on authentication - /// - /// Query parameters - /// Header parameters - /// Authentication settings - public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) { - if (authSettings == null || authSettings.Length == 0) - return; + public class ApiClient { - foreach (string auth in authSettings) { - // determine which one to use - switch(auth) { - {{#authMethods}} - case "{{name}}": - {{#isApiKey}}{{#isKeyInHeader}}headerParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}}queryParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password);{{/isBasic}} - {{#isOAuth}}//TODO support oauth{{/isOAuth}} - break; - {{/authMethods}} - default: - //TODO show warning about security definition not found - break; + /// + /// Initializes a new instance of the class. + /// + /// The base path. + public ApiClient(String basePath="{{basePath}}") { + this.BasePath = basePath; + this.RestClient = new RestClient(this.BasePath); } - } - - } - - /// - /// convert a stream to byte array (byte[]) - /// Ref: http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream - /// - /// input stream - /// Array of Byte - public byte[] StreamToByteArray(Stream input) - { - byte[] buffer = new byte[16*1024]; - using (MemoryStream ms = new MemoryStream()) - { - int read; - while ((read = input.Read(buffer, 0, buffer.Length)) > 0) - { - ms.Write(buffer, 0, read); + + /// + /// Gets or sets the base path. + /// + /// The base path. + public string BasePath { get; set; } + + /// + /// Gets or sets the RestClient + /// + /// The RestClient. + public RestClient RestClient { get; set; } + + private Dictionary DefaultHeaderMap = new Dictionary(); + + public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, String[] authSettings) { + var response = Task.Run(async () => { + var resp = await CallApiAsync(path, method, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + return resp; + }); + return response.Result; + } + + public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { + + var request = new RestRequest(path, method); + + UpdateParamsForAuth(queryParams, headerParams, authSettings); + + // add default header, if any + foreach(KeyValuePair defaultHeader in this.DefaultHeaderMap) + request.AddHeader(defaultHeader.Key, defaultHeader.Value); + + // add header parameter, if any + foreach(KeyValuePair param in headerParams) + request.AddHeader(param.Key, param.Value); + + // add query parameter, if any + foreach(KeyValuePair param in queryParams) + request.AddQueryParameter(param.Key, param.Value); + + // add form parameter, if any + foreach(KeyValuePair param in formParams) + request.AddParameter(param.Key, param.Value); + + // add file parameter, if any + foreach(KeyValuePair param in fileParams) + request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); + + + if (postBody != null) { + request.AddParameter("application/json", postBody, ParameterType.RequestBody); // http body (model) parameter } - return ms.ToArray(); + + return (Object) await RestClient.ExecuteTaskAsync(request); + } + + /// + /// Add default header + /// + /// Header field name + /// Header field value + /// + public void AddDefaultHeader(string key, string value) { + DefaultHeaderMap.Add(key, value); + } + + /// + /// Get default header + /// + /// Dictionary of default header + public Dictionary GetDefaultHeader() { + return DefaultHeaderMap; + } + + /// + /// escape string (url-encoded) + /// + /// String to be escaped + /// Escaped string + public string EscapeString(string str) { + return str; + } + + /// + /// Create FileParameter based on Stream + /// + /// parameter name + /// Input stream + /// FileParameter + public FileParameter ParameterToFile(string name, Stream stream) + { + if (stream is FileStream) { + return FileParameter.Create(name, StreamToByteArray(stream), ((FileStream)stream).Name); + } else { + return FileParameter.Create(name, StreamToByteArray(stream), "temp_name_here"); + } + } + + /// + /// if parameter is DateTime, output in ISO8601 format + /// if parameter is a list of string, join the list with "," + /// otherwise just return the string + /// + /// The parameter (header, path, query, form) + /// Formatted string + public string ParameterToString(object obj) + { + if (obj is DateTime) { + return ((DateTime)obj).ToString ("u"); + } else if (obj is List) { + return String.Join(",", obj as List); + } else { + return Convert.ToString (obj); + } + } + + /// + /// Deserialize the JSON string into a proper object + /// + /// HTTP body (e.g. string, JSON) + /// Object type + /// Object representation of the JSON string + public object Deserialize(string content, Type type, IList headers=null) { + if (type.GetType() == typeof(Object)) { // return an object + return (Object)content; + } else if (type.Name == "Stream") { + String fileName, filePath; + if (String.IsNullOrEmpty (Configuration.TempFolderPath)) { + filePath = System.IO.Path.GetTempPath (); + } else { + filePath = Configuration.TempFolderPath; + } + + Regex regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); + Match match = regex.Match(headers.ToString()); + if (match.Success) { + // replace first and last " or ', if found + fileName = filePath + match.Value.Replace("\"", "").Replace("'",""); + } else { + fileName = filePath + Guid.NewGuid().ToString(); + } + File.WriteAllText (fileName, content); + return new FileStream(fileName, FileMode.Open); + } else if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) { // return a datetime object + return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } else if (type.Name == "String" || type.Name.StartsWith("System.Nullable")) { // return primitive + return ConvertType(content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(content, type); + } + catch (IOException e) { + throw new ApiException(500, e.Message); + } + } + + /// + /// Serialize an object into JSON string + /// + /// Object + /// JSON string + public string Serialize(object obj) { + try + { + return obj != null ? JsonConvert.SerializeObject(obj) : null; + } + catch (Exception e) { + throw new ApiException(500, e.Message); + } + } + + /// + /// Get the API key with prefix + /// + /// Object + /// API key with prefix + public string GetApiKeyWithPrefix (string apiKeyIdentifier) + { + var apiKeyValue = ""; + Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) { + return apiKeyPrefix + " " + apiKeyValue; + } else { + return apiKeyValue; + } + } + + /// + /// Update parameters based on authentication + /// + /// Query parameters + /// Header parameters + /// Authentication settings + public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) { + if (authSettings == null || authSettings.Length == 0) + return; + + foreach (string auth in authSettings) { + // determine which one to use + switch(auth) { + {{#authMethods}} + case "{{name}}": + {{#isApiKey}}{{#isKeyInHeader}}headerParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}}queryParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password);{{/isBasic}} + {{#isOAuth}}//TODO support oauth{{/isOAuth}} + break; + {{/authMethods}} + default: + //TODO show warning about security definition not found + break; + } + } + + } + + /// + /// convert a stream to byte array (byte[]) + /// Ref: http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream + /// + /// input stream + /// Array of Byte + public byte[] StreamToByteArray(Stream input) + { + byte[] buffer = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int read; + while ((read = input.Read(buffer, 0, buffer.Length)) > 0) + { + ms.Write(buffer, 0, read); + } + return ms.ToArray(); + } + } + + /// + /// Encode string in base64 format + /// + /// String to be encoded + public static string Base64Encode(string text) { + var textByte = System.Text.Encoding.UTF8.GetBytes(text); + return System.Convert.ToBase64String(textByte); + } + + /// + /// Dynamically cast the object into target type + /// Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast + /// + /// Object to be casted + /// Target type + public static dynamic ConvertType(dynamic source, Type dest) { + return Convert.ChangeType(source, dest); + } + } - - /// - /// Encode string in base64 format - /// - /// String to be encoded - public static string Base64Encode(string text) { - var textByte = System.Text.Encoding.UTF8.GetBytes(text); - return System.Convert.ToBase64String(textByte); - } - - /// - /// Dynamically cast the object into target type - /// Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast - /// - /// Object to be casted - /// Target type - public static dynamic ConvertType(dynamic source, Type dest) { - return Convert.ChangeType(source, dest); - } - - } } diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index 47fcc1bef1d..2f6cca4c388 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -8,165 +8,162 @@ using {{packageName}}.Client; {{/hasImport}} namespace {{packageName}}.Api { - {{#operations}} - public interface I{{classname}} { - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - {{#allParams}}/// {{description}} - {{/allParams}}{{#returnType}}/// {{{returnType}}}{{/returnType}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - - /// - /// {{summary}} {{notes}} - /// - {{#allParams}}/// {{description}} - {{/allParams}}{{#returnType}}/// {{{returnType}}}{{/returnType}} - {{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - {{/operation}} - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class {{classname}} : I{{classname}} { - - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public {{classname}}(ApiClient apiClient = null) { - if (apiClient == null) { // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - } else { - this.ApiClient = apiClient; - } + {{#operations}} + public interface I{{classname}} { + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + {{#allParams}}/// {{description}} + {{/allParams}}{{#returnType}}/// {{{returnType}}} + {{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + /// + /// {{summary}} {{notes}} + /// + {{#allParams}}/// {{description}} + {{/allParams}}{{#returnType}}/// {{{returnType}}} + Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/operation}} } - + /// - /// Initializes a new instance of the class. + /// Represents a collection of functions to interact with the API endpoints /// - /// - public {{classname}}(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - public void SetBasePath(String basePath) { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath(String basePath) { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// The API client - public ApiClient ApiClient {get; set;} - - - {{#operation}} - /// - /// {{summary}} {{notes}} - /// - {{#allParams}}/// {{description}} - {{/allParams}}{{#returnType}}/// {{{returnType}}}{{/returnType}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}"); - {{/required}}{{/allParams}} - - var path = "{{path}}"; - path = path.Replace("{format}", "json"); - {{#pathParams}}path = path.Replace("{" + "{{baseName}}" + "}", ApiClient.ParameterToString({{{paramName}}})); - {{/pathParams}} - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - {{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter - {{/queryParams}} - {{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter - {{/headerParams}} - {{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} - {{/formParams}} - {{#bodyParam}}postBody = ApiClient.Serialize({{paramName}}); // http body (model) parameter - {{/bodyParam}} - - // authentication setting, if any - String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content); - } - - {{#returnType}}return ({{{returnType}}}) ApiClient.Deserialize(response.Content, typeof({{{returnType}}}), response.Headers);{{/returnType}}{{^returnType}}return;{{/returnType}} - } - - /// - /// {{summary}} {{notes}} - /// - {{#allParams}}/// {{description}} - {{/allParams}}{{#returnType}}/// {{{returnType}}}{{/returnType}} - public async {{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}"); - {{/required}}{{/allParams}} - - var path = "{{path}}"; - path = path.Replace("{format}", "json"); - {{#pathParams}}path = path.Replace("{" + "{{baseName}}" + "}", ApiClient.ParameterToString({{{paramName}}})); - {{/pathParams}} - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - {{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter - {{/queryParams}} - {{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter - {{/headerParams}} - {{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} - {{/formParams}} - {{#bodyParam}}postBody = ApiClient.Serialize({{paramName}}); // http body (model) parameter - {{/bodyParam}} - - // authentication setting, if any - String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content); - } - {{#returnType}}return ({{{returnType}}}) ApiClient.Deserialize(response.Content, typeof({{{returnType}}}), response.Headers);{{/returnType}}{{^returnType}} - return;{{/returnType}} - } - {{/operation}} - } - {{/operations}} + public class {{classname}} : I{{classname}} { + + /// + /// Initializes a new instance of the class. + /// + /// an instance of ApiClient (optional) + /// + public {{classname}}(ApiClient apiClient = null) { + if (apiClient == null) { // use the default one in Configuration + this.ApiClient = Configuration.DefaultApiClient; + } else { + this.ApiClient = apiClient; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(String basePath) + { + this.ApiClient = new ApiClient(basePath); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + public void SetBasePath(String basePath) { + this.ApiClient.BasePath = basePath; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath(String basePath) { + return this.ApiClient.BasePath; + } + + /// + /// Gets or sets the API client. + /// + /// The API client + public ApiClient ApiClient {get; set;} + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + {{#allParams}}/// {{description}} + {{/allParams}}{{#returnType}}/// {{{returnType}}} + public {{{returnType}}}{{/returnType}}{{^returnType}}public void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { + + {{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}"); + {{/required}}{{/allParams}} + + var path = "{{path}}"; + path = path.Replace("{format}", "json"); + {{#pathParams}}path = path.Replace("{" + "{{baseName}}" + "}", ApiClient.ParameterToString({{{paramName}}})); + {{/pathParams}} + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + {{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter + {{/queryParams}} + {{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter + {{/headerParams}} + {{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} + {{/formParams}} + {{#bodyParam}}postBody = ApiClient.Serialize({{paramName}}); // http body (model) parameter + {{/bodyParam}} + + // authentication setting, if any + String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content); + } + + {{#returnType}}return ({{{returnType}}}) ApiClient.Deserialize(response.Content, typeof({{{returnType}}}), response.Headers);{{/returnType}}{{^returnType}}return;{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + {{#allParams}}/// {{description}} + {{/allParams}}{{#returnType}}/// {{{returnType}}} + public async Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { + {{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}"); + {{/required}}{{/allParams}} + + var path = "{{path}}"; + path = path.Replace("{format}", "json"); + {{#pathParams}}path = path.Replace("{" + "{{baseName}}" + "}", ApiClient.ParameterToString({{{paramName}}})); + {{/pathParams}} + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + {{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter + {{/queryParams}} + {{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter + {{/headerParams}} + {{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} + {{/formParams}} + {{#bodyParam}}postBody = ApiClient.Serialize({{paramName}}); // http body (model) parameter + {{/bodyParam}} + + // authentication setting, if any + String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content); + } + {{#returnType}}return ({{{returnType}}}) ApiClient.Deserialize(response.Content, typeof({{{returnType}}}), response.Headers);{{/returnType}}{{^returnType}} + return;{{/returnType}} + } + {{/operation}} + } + {{/operations}} } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs index ab213f94f5a..82f7d1a8fa0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs @@ -7,825 +7,792 @@ using IO.Swagger.Client; using IO.Swagger.Model; namespace IO.Swagger.Api { + + public interface IPetApi { + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + void UpdatePet (Pet body); - public interface IPetApi { - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - - void UpdatePet (Pet body); - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - - Task UpdatePetAsync (Pet body); - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - - void AddPet (Pet body); - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - - Task AddPetAsync (Pet body); - - /// - /// Finds Pets by status Multiple status values can be provided with comma seperated strings - /// - /// Status values that need to be considered for filter - /// List - List FindPetsByStatus (List status); - - /// - /// Finds Pets by status Multiple status values can be provided with comma seperated strings - /// - /// Status values that need to be considered for filter - /// List - Task> FindPetsByStatusAsync (List status); - - /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List - List FindPetsByTags (List tags); - - /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List - Task> FindPetsByTagsAsync (List tags); - - /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// Pet - Pet GetPetById (long? petId); - - /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// Pet - Task GetPetByIdAsync (long? petId); - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - - void UpdatePetWithForm (string petId, string name, string status); - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - - Task UpdatePetWithFormAsync (string petId, string name, string status); - - /// - /// Deletes a pet - /// - /// - /// Pet id to delete - - void DeletePet (string apiKey, long? petId); - - /// - /// Deletes a pet - /// - /// - /// Pet id to delete - - Task DeletePetAsync (string apiKey, long? petId); - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - - void UploadFile (long? petId, string additionalMetadata, Stream file); - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - - Task UploadFileAsync (long? petId, string additionalMetadata, Stream file); - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class PetApi : IPetApi { - - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public PetApi(ApiClient apiClient = null) { - if (apiClient == null) { // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - } else { - this.ApiClient = apiClient; - } - } - - /// - /// Initializes a new instance of the class. - /// - /// - public PetApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - public void SetBasePath(String basePath) { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath(String basePath) { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// The API client - public ApiClient ApiClient {get; set;} - - - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - - public void UpdatePet (Pet body) { - - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); - } - - return; - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - - public async Task UpdatePetAsync (Pet body) { - - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); - } - - return; - } - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - - public void AddPet (Pet body) { - - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); - } - - return; - } - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - - public async Task AddPetAsync (Pet body) { - - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); - } - - return; - } - - /// - /// Finds Pets by status Multiple status values can be provided with comma seperated strings - /// - /// Status values that need to be considered for filter - /// List - public List FindPetsByStatus (List status) { - - - - var path = "/pet/findByStatus"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); - } - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by status Multiple status values can be provided with comma seperated strings - /// - /// Status values that need to be considered for filter - /// List - public async Task> FindPetsByStatusAsync (List status) { - - - - var path = "/pet/findByStatus"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); - } - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List - public List FindPetsByTags (List tags) { - - - - var path = "/pet/findByTags"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); - } - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List - public async Task> FindPetsByTagsAsync (List tags) { - - - - var path = "/pet/findByTags"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); - } - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// Pet - public Pet GetPetById (long? petId) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key", "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); - } - - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); - } - - /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// ID of pet that needs to be fetched - /// Pet - public async Task GetPetByIdAsync (long? petId) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key", "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); - } - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - - public void UpdatePetWithForm (string petId, string name, string status) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter - if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); - } - - return; - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - - public async Task UpdatePetWithFormAsync (string petId, string name, string status) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter - if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); - } - - return; - } - - /// - /// Deletes a pet - /// - /// - /// Pet id to delete - - public void DeletePet (string apiKey, long? petId) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter - - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); - } - - return; - } - - /// - /// Deletes a pet - /// - /// - /// Pet id to delete - - public async Task DeletePetAsync (string apiKey, long? petId) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter - - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); - } - - return; - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - - public void UploadFile (long? petId, string additionalMetadata, Stream file) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - - - var path = "/pet/{petId}/uploadImage"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); - } - - return; - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - - public async Task UploadFileAsync (long? petId, string additionalMetadata, Stream file) { - - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - - - var path = "/pet/{petId}/uploadImage"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); - - - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); - } - - return; - } - - } + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + Task UpdatePetAsync (Pet body); + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + void AddPet (Pet body); + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + Task AddPetAsync (Pet body); + + /// + /// Finds Pets by status Multiple status values can be provided with comma seperated strings + /// + /// Status values that need to be considered for filter + /// List + List FindPetsByStatus (List status); + + /// + /// Finds Pets by status Multiple status values can be provided with comma seperated strings + /// + /// Status values that need to be considered for filter + /// List + Task> FindPetsByStatusAsync (List status); + + /// + /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// List + List FindPetsByTags (List tags); + + /// + /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// List + Task> FindPetsByTagsAsync (List tags); + + /// + /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Pet + Pet GetPetById (long? petId); + + /// + /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Pet + Task GetPetByIdAsync (long? petId); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + void UpdatePetWithForm (string petId, string name, string status); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + Task UpdatePetWithFormAsync (string petId, string name, string status); + + /// + /// Deletes a pet + /// + /// + /// Pet id to delete + void DeletePet (string apiKey, long? petId); + + /// + /// Deletes a pet + /// + /// + /// Pet id to delete + Task DeletePetAsync (string apiKey, long? petId); + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + void UploadFile (long? petId, string additionalMetadata, Stream file); + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + Task UploadFileAsync (long? petId, string additionalMetadata, Stream file); + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class PetApi : IPetApi { + + /// + /// Initializes a new instance of the class. + /// + /// an instance of ApiClient (optional) + /// + public PetApi(ApiClient apiClient = null) { + if (apiClient == null) { // use the default one in Configuration + this.ApiClient = Configuration.DefaultApiClient; + } else { + this.ApiClient = apiClient; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(String basePath) + { + this.ApiClient = new ApiClient(basePath); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + public void SetBasePath(String basePath) { + this.ApiClient.BasePath = basePath; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath(String basePath) { + return this.ApiClient.BasePath; + } + + /// + /// Gets or sets the API client. + /// + /// The API client + public ApiClient ApiClient {get; set;} + + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + public void UpdatePet (Pet body) { + + + + var path = "/pet"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); + } + + return; + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + public async Task UpdatePetAsync (Pet body) { + + + var path = "/pet"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); + } + + return; + } + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + public void AddPet (Pet body) { + + + + var path = "/pet"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); + } + + return; + } + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + public async Task AddPetAsync (Pet body) { + + + var path = "/pet"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); + } + + return; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma seperated strings + /// + /// Status values that need to be considered for filter + /// List + public List FindPetsByStatus (List status) { + + + + var path = "/pet/findByStatus"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); + } + + return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma seperated strings + /// + /// Status values that need to be considered for filter + /// List + public async Task> FindPetsByStatusAsync (List status) { + + + var path = "/pet/findByStatus"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); + } + return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + } + + /// + /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// List + public List FindPetsByTags (List tags) { + + + + var path = "/pet/findByTags"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); + } + + return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + } + + /// + /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// List + public async Task> FindPetsByTagsAsync (List tags) { + + + var path = "/pet/findByTags"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); + } + return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + } + + /// + /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Pet + public Pet GetPetById (long? petId) { + + + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); + + + var path = "/pet/{petId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "api_key", "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); + } + + return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); + } + + /// + /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Pet + public async Task GetPetByIdAsync (long? petId) { + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); + + + var path = "/pet/{petId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "api_key", "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); + } + return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + public void UpdatePetWithForm (string petId, string name, string status) { + + + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); + + + var path = "/pet/{petId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter + if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); + } + + return; + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + public async Task UpdatePetWithFormAsync (string petId, string name, string status) { + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); + + + var path = "/pet/{petId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter + if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); + } + + return; + } + + /// + /// Deletes a pet + /// + /// + /// Pet id to delete + public void DeletePet (string apiKey, long? petId) { + + + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); + + + var path = "/pet/{petId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter + + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); + } + + return; + } + + /// + /// Deletes a pet + /// + /// + /// Pet id to delete + public async Task DeletePetAsync (string apiKey, long? petId) { + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); + + + var path = "/pet/{petId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter + + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); + } + + return; + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + public void UploadFile (long? petId, string additionalMetadata, Stream file) { + + + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); + + + var path = "/pet/{petId}/uploadImage"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); + } + + return; + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + public async Task UploadFileAsync (long? petId, string additionalMetadata, Stream file) { + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); + + + var path = "/pet/{petId}/uploadImage"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); + + + + // authentication setting, if any + String[] authSettings = new String[] { "petstore_auth" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); + } + + return; + } + + } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs index ad9e296721c..97dedb9a1dd 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs @@ -7,421 +7,410 @@ using IO.Swagger.Client; using IO.Swagger.Model; namespace IO.Swagger.Api { + + public interface IStoreApi { + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Dictionary + Dictionary GetInventory (); - public interface IStoreApi { - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary - Dictionary GetInventory (); - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary - Task> GetInventoryAsync (); - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - Order PlaceOrder (Order body); - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - Task PlaceOrderAsync (Order body); - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - /// Order - Order GetOrderById (string orderId); - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - /// Order - Task GetOrderByIdAsync (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 - /// - /// ID of the order that needs to be deleted - - void DeleteOrder (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 - /// - /// ID of the order that needs to be deleted - - Task DeleteOrderAsync (string orderId); - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class StoreApi : IStoreApi { - - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public StoreApi(ApiClient apiClient = null) { - if (apiClient == null) { // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - } else { - this.ApiClient = apiClient; - } - } - - /// - /// Initializes a new instance of the class. - /// - /// - public StoreApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - public void SetBasePath(String basePath) { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath(String basePath) { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// The API client - public ApiClient ApiClient {get; set;} - - - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary - public Dictionary GetInventory () { - - - - var path = "/store/inventory"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); - } - - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); - } - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary - public async Task> GetInventoryAsync () { - - - - var path = "/store/inventory"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); - } - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - public Order PlaceOrder (Order body) { - - - - var path = "/store/order"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); - } - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - public async Task PlaceOrderAsync (Order body) { - - - - var path = "/store/order"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); - } - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - /// Order - public Order GetOrderById (string orderId) { - - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); - } - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - /// Order - public async Task GetOrderByIdAsync (string orderId) { - - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); - } - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - - public void DeleteOrder (string orderId) { - - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); - } - - return; - } - - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - - public async Task DeleteOrderAsync (string orderId) { - - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); - } - - return; - } - - } + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Dictionary + Task> GetInventoryAsync (); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Order + Order PlaceOrder (Order body); + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Order + Task PlaceOrderAsync (Order body); + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Order + Order GetOrderById (string orderId); + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Order + Task GetOrderByIdAsync (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 + /// + /// ID of the order that needs to be deleted + void DeleteOrder (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 + /// + /// ID of the order that needs to be deleted + Task DeleteOrderAsync (string orderId); + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class StoreApi : IStoreApi { + + /// + /// Initializes a new instance of the class. + /// + /// an instance of ApiClient (optional) + /// + public StoreApi(ApiClient apiClient = null) { + if (apiClient == null) { // use the default one in Configuration + this.ApiClient = Configuration.DefaultApiClient; + } else { + this.ApiClient = apiClient; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(String basePath) + { + this.ApiClient = new ApiClient(basePath); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + public void SetBasePath(String basePath) { + this.ApiClient.BasePath = basePath; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath(String basePath) { + return this.ApiClient.BasePath; + } + + /// + /// Gets or sets the API client. + /// + /// The API client + public ApiClient ApiClient {get; set;} + + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Dictionary + public Dictionary GetInventory () { + + + + var path = "/store/inventory"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "api_key" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); + } + + return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Dictionary + public async Task> GetInventoryAsync () { + + + var path = "/store/inventory"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { "api_key" }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); + } + return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Order + public Order PlaceOrder (Order body) { + + + + var path = "/store/order"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); + } + + return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Order + public async Task PlaceOrderAsync (Order body) { + + + var path = "/store/order"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); + } + return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Order + public Order GetOrderById (string orderId) { + + + // verify the required parameter 'orderId' is set + if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); + + + var path = "/store/order/{orderId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); + } + + return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// ID of pet that needs to be fetched + /// Order + public async Task GetOrderByIdAsync (string orderId) { + // verify the required parameter 'orderId' is set + if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); + + + var path = "/store/order/{orderId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); + } + return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// ID of the order that needs to be deleted + public void DeleteOrder (string orderId) { + + + // verify the required parameter 'orderId' is set + if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); + + + var path = "/store/order/{orderId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); + } + + return; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// ID of the order that needs to be deleted + public async Task DeleteOrderAsync (string orderId) { + // verify the required parameter 'orderId' is set + if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); + + + var path = "/store/order/{orderId}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); + } + + return; + } + + } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs index 92b35a640e6..f497b9d35a2 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs @@ -7,796 +7,760 @@ using IO.Swagger.Client; using IO.Swagger.Model; namespace IO.Swagger.Api { + + public interface IUserApi { + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + void CreateUser (User body); - public interface IUserApi { - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - - void CreateUser (User body); - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - - Task CreateUserAsync (User body); - - /// - /// Creates list of users with given input array - /// - /// List of user object - - void CreateUsersWithArrayInput (List body); - - /// - /// Creates list of users with given input array - /// - /// List of user object - - Task CreateUsersWithArrayInputAsync (List body); - - /// - /// Creates list of users with given input array - /// - /// List of user object - - void CreateUsersWithListInput (List body); - - /// - /// Creates list of users with given input array - /// - /// List of user object - - Task CreateUsersWithListInputAsync (List body); - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser (string username, string password); - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - Task LoginUserAsync (string username, string password); - - /// - /// Logs out current logged in user session - /// - - void LogoutUser (); - - /// - /// Logs out current logged in user session - /// - - Task LogoutUserAsync (); - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName (string username); - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - Task GetUserByNameAsync (string username); - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - - void UpdateUser (string username, User body); - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - - Task UpdateUserAsync (string username, User body); - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - - void DeleteUser (string username); - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - - Task DeleteUserAsync (string username); - - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class UserApi : IUserApi { - - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public UserApi(ApiClient apiClient = null) { - if (apiClient == null) { // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - } else { - this.ApiClient = apiClient; - } - } - - /// - /// Initializes a new instance of the class. - /// - /// - public UserApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - public void SetBasePath(String basePath) { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath(String basePath) { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// The API client - public ApiClient ApiClient {get; set;} - - - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - - public void CreateUser (User body) { - - - - var path = "/user"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - - public async Task CreateUserAsync (User body) { - - - - var path = "/user"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - - public void CreateUsersWithArrayInput (List body) { - - - - var path = "/user/createWithArray"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); - } - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - - public async Task CreateUsersWithArrayInputAsync (List body) { - - - - var path = "/user/createWithArray"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); - } - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - - public void CreateUsersWithListInput (List body) { - - - - var path = "/user/createWithList"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); - } - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - - public async Task CreateUsersWithListInputAsync (List body) { - - - - var path = "/user/createWithList"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); - } - - return; - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - public string LoginUser (string username, string password) { - - - - var path = "/user/login"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter - if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); - } - - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - public async Task LoginUserAsync (string username, string password) { - - - - var path = "/user/login"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter - if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); - } - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); - } - - /// - /// Logs out current logged in user session - /// - - public void LogoutUser () { - - - - var path = "/user/logout"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Logs out current logged in user session - /// - - public async Task LogoutUserAsync () { - - - - var path = "/user/logout"; - path = path.Replace("{format}", "json"); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - public User GetUserByName (string username) { - - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); - } - - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - public async Task GetUserByNameAsync (string username) { - - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); - } - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); - } - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - - public void UpdateUser (string username, User body) { - - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - - public async Task UpdateUserAsync (string username, User body) { - - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - - public void DeleteUser (string username) { - - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); - } - - return; - } - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - - public async Task DeleteUserAsync (string username) { - - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - - - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - if (((int)response.StatusCode) >= 400) { - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); - } - - return; - } - - } + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + Task CreateUserAsync (User body); + + /// + /// Creates list of users with given input array + /// + /// List of user object + void CreateUsersWithArrayInput (List body); + /// + /// Creates list of users with given input array + /// + /// List of user object + Task CreateUsersWithArrayInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// List of user object + void CreateUsersWithListInput (List body); + + /// + /// Creates list of users with given input array + /// + /// List of user object + Task CreateUsersWithListInputAsync (List body); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// string + string LoginUser (string username, string password); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// string + Task LoginUserAsync (string username, string password); + + /// + /// Logs out current logged in user session + /// + void LogoutUser (); + + /// + /// Logs out current logged in user session + /// + Task LogoutUserAsync (); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// User + User GetUserByName (string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// User + Task GetUserByNameAsync (string username); + + /// + /// Updated user This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + void UpdateUser (string username, User body); + + /// + /// Updated user This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + Task UpdateUserAsync (string username, User body); + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + void DeleteUser (string username); + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + Task DeleteUserAsync (string username); + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class UserApi : IUserApi { + + /// + /// Initializes a new instance of the class. + /// + /// an instance of ApiClient (optional) + /// + public UserApi(ApiClient apiClient = null) { + if (apiClient == null) { // use the default one in Configuration + this.ApiClient = Configuration.DefaultApiClient; + } else { + this.ApiClient = apiClient; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(String basePath) + { + this.ApiClient = new ApiClient(basePath); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + public void SetBasePath(String basePath) { + this.ApiClient.BasePath = basePath; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath(String basePath) { + return this.ApiClient.BasePath; + } + + /// + /// Gets or sets the API client. + /// + /// The API client + public ApiClient ApiClient {get; set;} + + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + public void CreateUser (User body) { + + + + var path = "/user"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + public async Task CreateUserAsync (User body) { + + + var path = "/user"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + public void CreateUsersWithArrayInput (List body) { + + + + var path = "/user/createWithArray"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); + } + + return; + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + public async Task CreateUsersWithArrayInputAsync (List body) { + + + var path = "/user/createWithArray"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); + } + + return; + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + public void CreateUsersWithListInput (List body) { + + + + var path = "/user/createWithList"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); + } + + return; + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + public async Task CreateUsersWithListInputAsync (List body) { + + + var path = "/user/createWithList"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); + } + + return; + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// string + public string LoginUser (string username, string password) { + + + + var path = "/user/login"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter + if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); + } + + return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// string + public async Task LoginUserAsync (string username, string password) { + + + var path = "/user/login"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter + if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); + } + return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); + } + + /// + /// Logs out current logged in user session + /// + public void LogoutUser () { + + + + var path = "/user/logout"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Logs out current logged in user session + /// + public async Task LogoutUserAsync () { + + + var path = "/user/logout"; + path = path.Replace("{format}", "json"); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// User + public User GetUserByName (string username) { + + + // verify the required parameter 'username' is set + if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); + + + var path = "/user/{username}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); + } + + return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// User + public async Task GetUserByNameAsync (string username) { + // verify the required parameter 'username' is set + if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); + + + var path = "/user/{username}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); + } + return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + public void UpdateUser (string username, User body) { + + + // verify the required parameter 'username' is set + if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); + + + var path = "/user/{username}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + public async Task UpdateUserAsync (string username, User body) { + // verify the required parameter 'username' is set + if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); + + + var path = "/user/{username}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + postBody = ApiClient.Serialize(body); // http body (model) parameter + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + public void DeleteUser (string username) { + + + // verify the required parameter 'username' is set + if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); + + + var path = "/user/{username}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); + } + + return; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + public async Task DeleteUserAsync (string username) { + // verify the required parameter 'username' is set + if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); + + + var path = "/user/{username}"; + path = path.Replace("{format}", "json"); + path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); + + + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + String postBody = null; + + + + + + + // authentication setting, if any + String[] authSettings = new String[] { }; + + // make the HTTP request + IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + if (((int)response.StatusCode) >= 400) { + throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); + } + + return; + } + + } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs index 4940687de3d..1e259af15d4 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs @@ -10,284 +10,285 @@ using Newtonsoft.Json; using RestSharp; namespace IO.Swagger.Client { - /// - /// API client is mainly responible for making the HTTP call to the API backend - /// - public class ApiClient { - /// - /// Initializes a new instance of the class. + /// API client is mainly responible for making the HTTP call to the API backend /// - /// The base path. - public ApiClient(String basePath="http://petstore.swagger.io/v2") { - this.BasePath = basePath; - this.RestClient = new RestClient(this.BasePath); - } - - /// - /// Gets or sets the base path. - /// - /// The base path. - public string BasePath { get; set; } - - /// - /// Gets or sets the RestClient - /// - /// The RestClient. - public RestClient RestClient { get; set; } - - private Dictionary DefaultHeaderMap = new Dictionary(); - - public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { - var response = Task.Run(async () => { - var resp = await CallApiAsync(path, method, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - return resp; - }); - return response.Result; - } - - public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { - - var request = new RestRequest(path, method); - - UpdateParamsForAuth(queryParams, headerParams, authSettings); - - // add default header, if any - foreach(KeyValuePair defaultHeader in this.DefaultHeaderMap) - request.AddHeader(defaultHeader.Key, defaultHeader.Value); - - // add header parameter, if any - foreach(KeyValuePair param in headerParams) - request.AddHeader(param.Key, param.Value); - - // add query parameter, if any - foreach(KeyValuePair param in queryParams) - request.AddQueryParameter(param.Key, param.Value); - - // add form parameter, if any - foreach(KeyValuePair param in formParams) - request.AddParameter(param.Key, param.Value); - - // add file parameter, if any - foreach(KeyValuePair param in fileParams) - request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - - - if (postBody != null) { - request.AddParameter("application/json", postBody, ParameterType.RequestBody); // http body (model) parameter - } - - return (Object) await RestClient.ExecuteTaskAsync(request); - - } - - /// - /// Add default header - /// - /// Header field name - /// Header field value - /// - public void AddDefaultHeader(string key, string value) { - DefaultHeaderMap.Add(key, value); - } - - /// - /// Get default header - /// - /// Dictionary of default header - public Dictionary GetDefaultHeader() { - return DefaultHeaderMap; - } - - /// - /// escape string (url-encoded) - /// - /// String to be escaped - /// Escaped string - public string EscapeString(string str) { - return str; - } - - /// - /// Create FileParameter based on Stream - /// - /// parameter name - /// Stream - /// FileParameter - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) { - return FileParameter.Create(name, StreamToByteArray(stream), ((FileStream)stream).Name); - } else { - return FileParameter.Create(name, StreamToByteArray(stream), "temp_name_here"); - } - } - - /// - /// if parameter is DateTime, output in ISO8601 format - /// if parameter is a list of string, join the list with "," - /// otherwise just return the string - /// - /// The parameter (header, path, query, form) - /// Formatted string - public string ParameterToString(object obj) - { - if (obj is DateTime) { - return ((DateTime)obj).ToString ("u"); - } else if (obj is List) { - return String.Join(",", obj as List); - } else { - return Convert.ToString (obj); - } - } - - /// - /// Deserialize the JSON string into a proper object - /// - /// HTTP body (e.g. string, JSON) - /// Object type - /// Object representation of the JSON string - public object Deserialize(string content, Type type, IList headers=null) { - if (type.GetType() == typeof(Object)) { // return an object - return (Object)content; - } else if (type.Name == "Stream") { - String fileName, filePath; - if (String.IsNullOrEmpty (Configuration.TempFolderPath)) { - filePath = System.IO.Path.GetTempPath (); - } else { - filePath = Configuration.TempFolderPath; - } - - Regex regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); - Match match = regex.Match(headers.ToString()); - if (match.Success) { - // replace first and last " or ', if found - fileName = filePath + match.Value.Replace("\"", "").Replace("'",""); - } else { - fileName = filePath + Guid.NewGuid().ToString(); - } - File.WriteAllText (fileName, content); - return new FileStream(fileName, FileMode.Open); - } else if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) { // return a datetime object - return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } else if (type.Name == "String" || type.Name.StartsWith("System.Nullable")) { // return primitive - return ConvertType(content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(content, type); - } - catch (IOException e) { - throw new ApiException(500, e.Message); - } - } - - /// - /// Serialize an object into JSON string - /// - /// Object - /// JSON string - public string Serialize(object obj) { - try - { - return obj != null ? JsonConvert.SerializeObject(obj) : null; - } - catch (Exception e) { - throw new ApiException(500, e.Message); - } - } - - /// - /// Get the API key with prefix - /// - /// Object - /// API key with prefix - public string GetApiKeyWithPrefix (string apiKeyIdentifier) - { - var apiKeyValue = ""; - Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) { - return apiKeyPrefix + " " + apiKeyValue; - } else { - return apiKeyValue; - } - } - - /// - /// Update parameters based on authentication - /// - /// Query parameters - /// Header parameters - /// Authentication settings - public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) { - if (authSettings == null || authSettings.Length == 0) - return; + public class ApiClient { - foreach (string auth in authSettings) { - // determine which one to use - switch(auth) { - - case "api_key": - headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); - - break; - - case "petstore_auth": - - //TODO support oauth - break; - - default: - //TODO show warning about security definition not found - break; + /// + /// Initializes a new instance of the class. + /// + /// The base path. + public ApiClient(String basePath="http://petstore.swagger.io/v2") { + this.BasePath = basePath; + this.RestClient = new RestClient(this.BasePath); } - } - - } - - /// - /// convert a stream to byte array (byte[]) - /// Ref: http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream - /// - /// input stream - /// Array of Byte - public byte[] StreamToByteArray(Stream input) - { - byte[] buffer = new byte[16*1024]; - using (MemoryStream ms = new MemoryStream()) - { - int read; - while ((read = input.Read(buffer, 0, buffer.Length)) > 0) - { - ms.Write(buffer, 0, read); + + /// + /// Gets or sets the base path. + /// + /// The base path. + public string BasePath { get; set; } + + /// + /// Gets or sets the RestClient + /// + /// The RestClient. + public RestClient RestClient { get; set; } + + private Dictionary DefaultHeaderMap = new Dictionary(); + + public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, String[] authSettings) { + var response = Task.Run(async () => { + var resp = await CallApiAsync(path, method, queryParams, postBody, headerParams, formParams, fileParams, authSettings); + return resp; + }); + return response.Result; + } + + public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { + + var request = new RestRequest(path, method); + + UpdateParamsForAuth(queryParams, headerParams, authSettings); + + // add default header, if any + foreach(KeyValuePair defaultHeader in this.DefaultHeaderMap) + request.AddHeader(defaultHeader.Key, defaultHeader.Value); + + // add header parameter, if any + foreach(KeyValuePair param in headerParams) + request.AddHeader(param.Key, param.Value); + + // add query parameter, if any + foreach(KeyValuePair param in queryParams) + request.AddQueryParameter(param.Key, param.Value); + + // add form parameter, if any + foreach(KeyValuePair param in formParams) + request.AddParameter(param.Key, param.Value); + + // add file parameter, if any + foreach(KeyValuePair param in fileParams) + request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); + + + if (postBody != null) { + request.AddParameter("application/json", postBody, ParameterType.RequestBody); // http body (model) parameter } - return ms.ToArray(); + + return (Object) await RestClient.ExecuteTaskAsync(request); + } + + /// + /// Add default header + /// + /// Header field name + /// Header field value + /// + public void AddDefaultHeader(string key, string value) { + DefaultHeaderMap.Add(key, value); + } + + /// + /// Get default header + /// + /// Dictionary of default header + public Dictionary GetDefaultHeader() { + return DefaultHeaderMap; + } + + /// + /// escape string (url-encoded) + /// + /// String to be escaped + /// Escaped string + public string EscapeString(string str) { + return str; + } + + /// + /// Create FileParameter based on Stream + /// + /// parameter name + /// Input stream + /// FileParameter + public FileParameter ParameterToFile(string name, Stream stream) + { + if (stream is FileStream) { + return FileParameter.Create(name, StreamToByteArray(stream), ((FileStream)stream).Name); + } else { + return FileParameter.Create(name, StreamToByteArray(stream), "temp_name_here"); + } + } + + /// + /// if parameter is DateTime, output in ISO8601 format + /// if parameter is a list of string, join the list with "," + /// otherwise just return the string + /// + /// The parameter (header, path, query, form) + /// Formatted string + public string ParameterToString(object obj) + { + if (obj is DateTime) { + return ((DateTime)obj).ToString ("u"); + } else if (obj is List) { + return String.Join(",", obj as List); + } else { + return Convert.ToString (obj); + } + } + + /// + /// Deserialize the JSON string into a proper object + /// + /// HTTP body (e.g. string, JSON) + /// Object type + /// Object representation of the JSON string + public object Deserialize(string content, Type type, IList headers=null) { + if (type.GetType() == typeof(Object)) { // return an object + return (Object)content; + } else if (type.Name == "Stream") { + String fileName, filePath; + if (String.IsNullOrEmpty (Configuration.TempFolderPath)) { + filePath = System.IO.Path.GetTempPath (); + } else { + filePath = Configuration.TempFolderPath; + } + + Regex regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); + Match match = regex.Match(headers.ToString()); + if (match.Success) { + // replace first and last " or ', if found + fileName = filePath + match.Value.Replace("\"", "").Replace("'",""); + } else { + fileName = filePath + Guid.NewGuid().ToString(); + } + File.WriteAllText (fileName, content); + return new FileStream(fileName, FileMode.Open); + } else if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) { // return a datetime object + return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } else if (type.Name == "String" || type.Name.StartsWith("System.Nullable")) { // return primitive + return ConvertType(content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(content, type); + } + catch (IOException e) { + throw new ApiException(500, e.Message); + } + } + + /// + /// Serialize an object into JSON string + /// + /// Object + /// JSON string + public string Serialize(object obj) { + try + { + return obj != null ? JsonConvert.SerializeObject(obj) : null; + } + catch (Exception e) { + throw new ApiException(500, e.Message); + } + } + + /// + /// Get the API key with prefix + /// + /// Object + /// API key with prefix + public string GetApiKeyWithPrefix (string apiKeyIdentifier) + { + var apiKeyValue = ""; + Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) { + return apiKeyPrefix + " " + apiKeyValue; + } else { + return apiKeyValue; + } + } + + /// + /// Update parameters based on authentication + /// + /// Query parameters + /// Header parameters + /// Authentication settings + public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) { + if (authSettings == null || authSettings.Length == 0) + return; + + foreach (string auth in authSettings) { + // determine which one to use + switch(auth) { + + case "api_key": + headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); + + break; + + case "petstore_auth": + + //TODO support oauth + break; + + default: + //TODO show warning about security definition not found + break; + } + } + + } + + /// + /// convert a stream to byte array (byte[]) + /// Ref: http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream + /// + /// input stream + /// Array of Byte + public byte[] StreamToByteArray(Stream input) + { + byte[] buffer = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int read; + while ((read = input.Read(buffer, 0, buffer.Length)) > 0) + { + ms.Write(buffer, 0, read); + } + return ms.ToArray(); + } + } + + /// + /// Encode string in base64 format + /// + /// String to be encoded + public static string Base64Encode(string text) { + var textByte = System.Text.Encoding.UTF8.GetBytes(text); + return System.Convert.ToBase64String(textByte); + } + + /// + /// Dynamically cast the object into target type + /// Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast + /// + /// Object to be casted + /// Target type + public static dynamic ConvertType(dynamic source, Type dest) { + return Convert.ChangeType(source, dest); + } + } - - /// - /// Encode string in base64 format - /// - /// String to be encoded - public static string Base64Encode(string text) { - var textByte = System.Text.Encoding.UTF8.GetBytes(text); - return System.Convert.ToBase64String(textByte); - } - - /// - /// Dynamically cast the object into target type - /// Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast - /// - /// Object to be casted - /// Target type - public static dynamic ConvertType(dynamic source, Type dest) { - return Convert.ChangeType(source, dest); - } - - } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb index e5bbf0a9ef2b9ffa076f8a04f00aded3071881f9..870fb99f816ad2d777d70b5c205fdb44b2ec38c8 100644 GIT binary patch literal 16754 zcmd6PcU)B0_Wi#14lu(oK4%7`_ogVK0}9Nb!hi@!F}5g{NEs0VY51i2FCaD{p07;`K(#%?sMntv(G-~+=}kY z|NSU5;&Mj=N&i%rhL3vvo!iMw!~DuSWr@8sf;ed zMu}x`OjSX}&~i&vOi_8MWpH)OP)l`H^^i(SOi|UKg36&W-K5=9#nSGUs_K~R(n5P{ zOjTu3OhrNIVB2pp^K3iBqzo;M>0+q{wJfR{uzYaxm&G;NTYobjA6>a(ZpOdbe17ef zZ8NW#mPSAO@!W|t>uG9sH`Wb~8$QZl>h{q2O72IOJ71r1Cw?@|e3}~0GVi$Emgaw4 z{-;~T+IPE_-#Kw{aTd*cTG}m*FE(5xLor zEJLeHhYWVm{CPb0YH0gO|7U z{_TTvwG%8?HG-uv6p{I+sInLTFHz_GdoTc4f@D>Xf@ zve;7TpxrO*2{iU;J!8c-pTV0pjoeT|)1R&`$I|Yg)n8B9-e~0Y{3u!P*Fv^+aOB; zCbM-@a2+_LvckHda2;4$Zn17SDTfZJsx}WP9!bt_1;eTbb+c4gmkuteA{S+)rE2Jq z!BrNtLhPVX+;WbD%^cUnRM^gBGNnf9jOlOaCYJlu=zYq{4DDEyQ5ubRU{FASM&lKt z(X>t01jT9N%l_$!Zac2058U^$ zP2?C3HlagJ4rBWX=3z3o1$p>{m-7&2G#d?q3-83$&4$iA%`hGPoMMZnQAkpHOF1Vm zjNv>rK^=;tRNR>+w9E5=rySH0FIwug%EGfDvF(P3R|PL**FV0tsXe~( zw}R+)(D-1nF6`T@-T{_>FPJt4Z<5Ok?2fSfkzhI+d`vDawL8S}*MsS|;2U!33*s@B zeF??{D&d5Fm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