diff --git a/bin/csharp-petstore-all-httpClient.sh b/bin/csharp-petstore-all-httpClient.sh new file mode 100644 index 00000000000..e21736f2f91 --- /dev/null +++ b/bin/csharp-petstore-all-httpClient.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# C# Petstore API client (.NET 3.5) +./bin/csharp-petstore-httpClient.sh + +# C# Petstore API client (v5.0 for .net standarnd 1.3+) +./bin/csharp-petstore-net-standard-httpClient.sh + +./bin/csharp-petstore-netcore-project-httpClient.sh + diff --git a/bin/csharp-petstore-httpClient.json b/bin/csharp-petstore-httpClient.json new file mode 100644 index 00000000000..35be7406a46 --- /dev/null +++ b/bin/csharp-petstore-httpClient.json @@ -0,0 +1,3 @@ +{ + "library": "httpClient" +} \ No newline at end of file diff --git a/bin/csharp-petstore-httpClient.sh b/bin/csharp-petstore-httpClient.sh new file mode 100644 index 00000000000..2ab88161456 --- /dev/null +++ b/bin/csharp-petstore-httpClient.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/httpClient/csharp/SwaggerClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}" -c ./bin/csharp-petstore-httpClient.json" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-petstore-net-standard-httpClient.json b/bin/csharp-petstore-net-standard-httpClient.json new file mode 100644 index 00000000000..ce25674ab13 --- /dev/null +++ b/bin/csharp-petstore-net-standard-httpClient.json @@ -0,0 +1,4 @@ +{ + "targetFramework": "v5.0", + "library": "httpClient" +} diff --git a/bin/csharp-petstore-net-standard-httpClient.sh b/bin/csharp-petstore-net-standard-httpClient.sh new file mode 100644 index 00000000000..f335e0aa0be --- /dev/null +++ b/bin/csharp-petstore-net-standard-httpClient.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-standard-httpClient.json" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/csharp-petstore-netcore-project-httpClient.json b/bin/csharp-petstore-netcore-project-httpClient.json new file mode 100644 index 00000000000..35be7406a46 --- /dev/null +++ b/bin/csharp-petstore-netcore-project-httpClient.json @@ -0,0 +1,3 @@ +{ + "library": "httpClient" +} \ No newline at end of file diff --git a/bin/csharp-petstore-netcore-project-httpClient.sh b/bin/csharp-petstore-netcore-project-httpClient.sh new file mode 100644 index 00000000000..f88044eb00b --- /dev/null +++ b/bin/csharp-petstore-netcore-project-httpClient.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate $@ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject --additional-properties packageGuid={67035b31-f8e5-41a4-9673-954035084f7d},netCoreProjectFile=true -c ./bin/csharp-petstore-net-standard-httpClient.json" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/csharp-petstore-all-httpClient.bat b/bin/windows/csharp-petstore-all-httpClient.bat new file mode 100644 index 00000000000..9dc78bb0dc8 --- /dev/null +++ b/bin/windows/csharp-petstore-all-httpClient.bat @@ -0,0 +1,8 @@ +REM C# Petstore API client +call .\bin\windows\csharp-petstore-httpClient.bat + +REM C# Petstore API client (v5.0 for .net standarnd 1.3+) +call .\bin\windows\csharp-petstore-netstandard-httpClient.bat + +call .\bin\windows\csharp-petstore-netcore-project-httpClient.bat + diff --git a/bin/windows/csharp-petstore-httpClient.bat b/bin/windows/csharp-petstore-httpClient.bat new file mode 100644 index 00000000000..1df71fee655 --- /dev/null +++ b/bin/windows/csharp-petstore-httpClient.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples\client\petstore\csharp\httpClient\SwaggerClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-httpClient.json" + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-petstore-netcore-project-httpClient.bat b/bin/windows/csharp-petstore-netcore-project-httpClient.bat new file mode 100644 index 00000000000..8c1827c347e --- /dev/null +++ b/bin/windows/csharp-petstore-netcore-project-httpClient.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples\client\petstore\csharp\httpClient\SwaggerClientNetCoreProject --additional-properties targetFramework=v5.0,packageGuid={67035b31-f8e5-41a4-9673-954035084f7d},netCoreProjectFile=true -c ./bin/csharp-petstore-netcore-project-httpClient.json" + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/csharp-petstore-netstandard-httpClient.bat b/bin/windows/csharp-petstore-netstandard-httpClient.bat new file mode 100644 index 00000000000..a4cbc2a916b --- /dev/null +++ b/bin/windows/csharp-petstore-netstandard-httpClient.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples\client\petstore\csharp\httpClient\SwaggerClientNetStandard --additional-properties targetFramework=v5.0,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55} + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 34f4031557a..afdd5d9ed1a 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -177,6 +177,17 @@ public CSharpClientCodegen() { regexModifiers.put('m', "Multiline"); regexModifiers.put('s', "Singleline"); regexModifiers.put('x', "IgnorePatternWhitespace"); + + supportedLibraries.put("restSharp", "RestSharp client: RestSharp.RestClient"); + supportedLibraries.put("httpClient", "HTTP client: System.Net.HttpClient"); + + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); + libraryOption.setEnum(supportedLibraries); + // set restSharp as the default + libraryOption.setDefault("restSharp"); + cliOptions.add(libraryOption); + + setLibrary("restSharp"); } @Override @@ -351,6 +362,7 @@ public void processOpts() { clientPackageDir, "IApiAccessor.cs")); supportingFiles.add(new SupportingFile("Configuration.mustache", clientPackageDir, "Configuration.cs")); + LOGGER.info("apiClient {}", clientPackageDir); supportingFiles.add(new SupportingFile("ApiClient.mustache", clientPackageDir, "ApiClient.cs")); supportingFiles.add(new SupportingFile("ApiException.mustache", @@ -437,6 +449,11 @@ public void processOpts() { } } } + if("httpClient".equals(getLibrary())) { + supportingFiles.add(new SupportingFile("RequestParameters.mustache", clientPackageDir, "RequestParameters.cs")); + supportingFiles.add(new SupportingFile("ResponseExtension.mustache", clientPackageDir, "ResponseExtension.cs")); + supportingFiles.add(new SupportingFile("InterceptResult.mustache", clientPackageDir, "InterceptResult.cs")); + } additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ApiClient.mustache new file mode 100644 index 00000000000..be9bad5f9d9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ApiClient.mustache @@ -0,0 +1,472 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.IO; +{{^netStandard}} +{{^supportsUWP}} +using System.Web; +{{/supportsUWP}} +{{/netStandard}} +using System.Linq; +using System.Text; +using Newtonsoft.Json; +{{#netStandard}} +using System.Net.Http; +{{/netStandard}} +{{^netStandard}} +using System.Net.Http; +{{/netStandard}} + +namespace {{packageName}}.Client +{ + /// + /// API client is mainly responsible for making the HTTP call to the API backend. + /// + {{>visibility}} partial class ApiClient : IDisposable + { + private JsonSerializerSettings serializerSettings = new JsonSerializerSettings + { + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(HttpRequestMessage request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(HttpRequestMessage request, HttpResponseMessage response, InterceptResult res); + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + public ApiClient() + : this((string)null) + {} + + /// + /// Initializes a new instance of the class + /// with default base path ({{{basePath}}}). + /// + /// An instance of Configuration. + public ApiClient(Configuration config) + { + Configuration = config ?? {{packageName}}.Client.Configuration.Default; + + RestClient = ClientFactory(Configuration); + {{#netStandard}} + //special http client adjustments + {{/netStandard}} + } + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + /// The base path. + public ApiClient(String basePath = "{{{basePath}}}") + { + if (String.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + RestClient = ClientFactory(Configuration); + {{#netStandard}} + //special http client adjustments + {{/netStandard}} + Configuration = Client.Configuration.Default; + } + + /// + /// may be overriden to customize client initialization + /// + public static Func ClientFactory = ClientFactoryDefault; + + static HttpClient ClientFactoryDefault(IReadableConfiguration config) + { + var res = new HttpClient + { + BaseAddress = new Uri(config.BasePath), + Timeout = TimeSpan.FromMilliseconds(config.Timeout), + }; + res.DefaultRequestHeaders.Add("User-Agent", config.UserAgent); + return res; + } + + /// + /// Gets or sets the default API client for making HTTP calls. + /// + /// The default API client. + [Obsolete("ApiClient.Default is deprecated, please use 'Configuration.Default.ApiClient' instead.")] + public static ApiClient Default; + + private bool disposedValue; + + /// + /// Gets or sets an instance of the IReadableConfiguration. + /// + /// An instance of the IReadableConfiguration. + /// + /// helps us to avoid modifying possibly global + /// configuration values from within a given client. It does not guarantee thread-safety + /// of the instance in any way. + /// + public IReadableConfiguration Configuration { get; set; } + + /// + /// Gets or sets the RestClient. + /// + /// An instance of the RestClient + public HttpClient RestClient { get; set; } + + // Creates and sets up a RestRequest prior to a call. + private HttpRequestMessage PrepareRequest(String path, HttpMethod method, RequestParameters parameters) + { + foreach (var pathParameter in parameters.pathParams) + path = path.Replace(string.Concat("{", pathParameter.Key, "}"), pathParameter.Value); + + var builder = new UriBuilder($"{Configuration.BasePath}/"); + builder.Path = builder.Path + path.TrimStart('/'); + builder.Query = parameters.GetQuery(); + + var address = builder.ToString(); + + var request = new HttpRequestMessage(method, address); + {{#netStandard}} + //special http client adjustments + {{/netStandard}} + + // add header parameter, if any + foreach(var param in parameters.headerParams) + request.Headers.Add(param.Key, param.Value); + + // add form parameter, if any + foreach(var param in parameters.formParams) + request.Headers.Add(param.Key, param.Value); + + long contentLength = 0; + + if (parameters.postBody != null) // http body (model or byte[]) parameter + { + var stringBody = parameters.postBody as string; + var contentValue = stringBody != null + ? stringBody + : JsonConvert.SerializeObject(parameters.postBody); + var content = new StringContent(contentValue, Encoding.UTF8, parameters.contentType); + request.Content = content; //.(contentType, postBody, ParameterType.RequestBody); + + contentLength = contentValue.Length; + } + + return request; + } + + /// + /// Makes the HTTP request (Sync). + /// + /// URL path. + /// HTTP method. + /// Object + public HttpResponseMessage CallApi( + String path, HttpMethod method, RequestParameters parameters) + { + var request = PrepareRequest(path, method, parameters); + + InterceptRequest(request); + var res = new InterceptResult(); + {{#netStandard}} + var response = RestClient.SendAsync(request).Result; + {{/netStandard}} + {{^netStandard}} + {{^supportsUWP}} + var response = RestClient.SendAsync(request).Result; + {{/supportsUWP}} + {{#supportsUWP}} + // Using async method to perform sync call (uwp-only) + var response = RestClient.SendAsync(request).Result; + {{/supportsUWP}} + {{/netStandard}} + InterceptResponse(request, response, res); + if (res.Retry) + { + request = PrepareRequest(path, method, parameters); //HttpClient requires to create new request message + response = RestClient.SendAsync(request).Result; + InterceptResponse(request, response, res); + } + + return response; + } + {{#supportsAsync}} + /// + /// Makes the asynchronous HTTP request. + /// + /// URL path. + /// HTTP method. + /// The Task instance. + public async System.Threading.Tasks.Task CallApiAsync( + String path, HttpMethod method, RequestParameters parameters) + { + var request = PrepareRequest(path, method, parameters); + InterceptRequest(request); + var res = new InterceptResult(); + var response = await RestClient.SendAsync(request); + InterceptResponse(request, response, res); + if (res.Retry) + { + request = PrepareRequest(path, method, parameters); //HttpClient requires to create new request message + response = await RestClient.SendAsync(request); + InterceptResponse(request, response, res); + } + return response; + }{{/supportsAsync}} + + /// + /// Escape string (url-encoded). + /// + /// String to be escaped. + /// Escaped string. + public string EscapeString(string str) + { + return UrlEncode(str); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// + /// + /// + public T Deserialize(HttpResponseMessage response) + { + return (T)Deserialize(response, typeof(T)); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + public object Deserialize(HttpResponseMessage response, Type type) + { + var headers = response.Headers; + if (type == typeof(byte[])) // return byte array + { + return response.Content.ReadAsByteArrayAsync().Result; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + if (headers != null) + { + var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) + ? Path.GetTempPath() + : Configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) + { + var match = regex.Match(header.Value.First()); + if (match.Success) + { + string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, response.Content.ReadAsByteArrayAsync().Result); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(response.Content.ReadAsByteArrayAsync().Result); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content.ReadAsStringAsync().Result, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return ConvertType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result, type, serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + /// Encode string in base64 format. + /// + /// String to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Dynamically cast the object into target type. + /// + /// Object to be casted + /// Target type + /// Casted object + {{#supportsAsync}} + public static dynamic ConvertType(dynamic fromObject, Type toObject) + {{/supportsAsync}} + {{^supportsAsync}} + public static object ConvertType(T fromObject, Type toObject) where T : class + {{/supportsAsync}} + { + return Convert.ChangeType(fromObject, toObject); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + byte[] buf = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int count; + while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) + { + ms.Write(buf, 0, count); + } + return ms.ToArray(); + } + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// String to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + + if (match.Success) + { + return match.Groups[1].Value; + } + else + { + return filename; + } + } + {{^netStandard}} + {{#supportsUWP}} + /// + /// Convert stream to byte array + /// + /// IO stream + /// Byte array + public static byte[] ToByteArray(Stream stream) + { + stream.Position = 0; + byte[] buffer = new byte[stream.Length]; + for (int totalBytesCopied = 0; totalBytesCopied < stream.Length;) + totalBytesCopied += stream.Read(buffer, totalBytesCopied, Convert.ToInt32(stream.Length) - totalBytesCopied); + return buffer; + } + {{/supportsUWP}} + {{/netStandard}} + + /// + /// disposing + /// + /// + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + RestClient.Dispose(); + } + + // TODO: free unmanaged resources (unmanaged objects) and override finalizer + // TODO: set large fields to null + disposedValue = true; + } + } + + /// + /// IDisposable implementation + /// + public void Dispose() + { + // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ApiException.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ApiException.mustache new file mode 100644 index 00000000000..cc9108329a5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ApiException.mustache @@ -0,0 +1,53 @@ +{{>partial_header}} +using System; + +namespace {{packageName}}.Client +{ + /// + /// API Exception + /// + {{>visibility}} class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} ErrorContent { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() {} + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base($"message ({errorCode})") + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + public ApiException(int errorCode, string message, {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} errorContent = null) : base($"{message} ({errorCode})") + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + } + + public string Path { get; set; } + } + +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/Configuration.mustache new file mode 100644 index 00000000000..e863cbe7670 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/Configuration.mustache @@ -0,0 +1,452 @@ +{{>partial_header}} +using System; +using System.Reflection; +{{^net35}} +using System.Collections.Concurrent; +{{/net35}} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace {{packageName}}.Client +{ + /// + /// Represents a set of configuration settings + /// + {{>visibility}} class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "{{packageVersion}}"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + private static readonly object GlobalConfigSync = new { }; + private static Configuration _globalConfiguration; + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + var message = response.Content?.ReadAsStringAsync()?.Result; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}", methodName), + message) + { Path = response.RequestMessage.RequestUri.ToString() }; + } + {{^netStandard}}if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, message), message) + { Path = response.RequestMessage.RequestUri.ToString() }; + }{{/netStandard}} + return null; + }; + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static Configuration Default + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + + #endregion Static Members + + #region Private Members + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + private IDictionary _apiKey = null; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix = null; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + #endregion Private Members + + #region Constructors + + static Configuration() + { + _globalConfiguration = new GlobalConfiguration(); + } + + const string userAgentDefault = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{packageVersion}} csharp{{/httpUserAgent}}"; // space before csharp + + /// + /// Initializes a new instance of the class + /// + public Configuration() + { + UserAgent = userAgentDefault; + BasePath = "{{{basePath}}}"; + DefaultHeader = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + public Configuration( + IDictionary defaultHeader, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "{{{basePath}}}") : this() + { + if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeader == null) + throw new ArgumentNullException("defaultHeader"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeader) + { + DefaultHeader.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + /// + /// Initializes a new instance of the class with different settings + /// + /// Api client + /// Dictionary of default HTTP header + /// Username + /// Password + /// accessToken + /// Dictionary of API key + /// Dictionary of API key prefix + /// Temp folder path + /// DateTime format string + /// HTTP connection timeout (in milliseconds) + /// HTTP user agent + [Obsolete("Use explicit object construction and setting of properties.", true)] + public Configuration( + // ReSharper disable UnusedParameter.Local + ApiClient apiClient = null, + IDictionary defaultHeader = null, + string username = null, + string password = null, + string accessToken = null, + IDictionary apiKey = null, + IDictionary apiKeyPrefix = null, + string tempFolderPath = null, + string dateTimeFormat = null, + int timeout = 100000, + string userAgent = userAgentDefault + // ReSharper restore UnusedParameter.Local + ) + { + + } + + /// + /// Initializes a new instance of the Configuration class. + /// + /// Api client. + [Obsolete("This constructor caused unexpected sharing of static data. It is no longer supported.", true)] + // ReSharper disable once UnusedParameter.Local + public Configuration(ApiClient apiClient) + { + + } + + #endregion Constructors + + + #region Properties + + private ApiClient _apiClient = null; + /// + /// Gets an instance of an ApiClient for this configuration + /// + public virtual ApiClient ApiClient + { + get + { + if (_apiClient == null) _apiClient = CreateApiClient(); + return _apiClient; + } + } + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { get; set; } + + /// + /// Gets or sets the default header. + /// + public virtual IDictionary DefaultHeader { get; set; } + + int timeout; + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout + { + get { return timeout; } + set + { + timeout = System.Convert.ToInt32(value); + if (_apiClient != null) + ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(value); + } + } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + var apiKeyValue = ""; + ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) + return apiKeyPrefix + " " + apiKeyValue; + else + return apiKeyValue; + } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + // Possible breaking change since swagger-codegen 2.2.1, enforce a valid temporary path on set. + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + #endregion Properties + + #region Methods + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + public void AddDefaultHeader(string key, string value) + { + DefaultHeader[key] = value; + } + + /// + /// Creates a new based on this instance. + /// + /// + public ApiClient CreateApiClient() + { + return new ApiClient(this); + } + + /// + /// Returns a string with essential information for debugging. + /// + public static String ToDebugReport() + { + String report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + {{^netStandard}} + {{^supportsUWP}} + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + {{/supportsUWP}} + {{/netStandard}} + {{#netStandard}} + report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; + {{/netStandard}} + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ExceptionFactory.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ExceptionFactory.mustache new file mode 100644 index 00000000000..bc9ac7b631d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ExceptionFactory.mustache @@ -0,0 +1,20 @@ +{{>partial_header}} + +using System; +{{#netStandard}} +using System.Net.Http; +{{/netStandard}} +{{^netStandard}} +using System.Net.Http; +{{/netStandard}} + +namespace {{packageName}}.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + {{>visibility}} delegate Exception ExceptionFactory(string methodName, HttpResponseMessage response); +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/IApiAccessor.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/IApiAccessor.mustache new file mode 100644 index 00000000000..e7be9db62ef --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/IApiAccessor.mustache @@ -0,0 +1,32 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; + +namespace {{packageName}}.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + {{>visibility}} interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + Configuration Configuration {get; set;} + + /// + /// Gets the base path of the API client. + /// + /// The base path + String GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/InterceptResult.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/InterceptResult.mustache new file mode 100644 index 00000000000..610a68d8a50 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/InterceptResult.mustache @@ -0,0 +1,16 @@ +{{>partial_header}} +using System; + +namespace {{packageName}}.Client +{ + /// + /// allows interceptor to return some data to the + /// + class InterceptResult + { + /// + /// should it retry to send the request + /// + public bool Retry; + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/Project.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/Project.mustache new file mode 100644 index 00000000000..fdd45a2e76e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/Project.mustache @@ -0,0 +1,114 @@ + + + + + {{#netStandard}}14.0{{/netStandard}} + Debug + AnyCPU + {{packageGuid}} + Library + Properties + {{packageName}} + {{packageName}} + {{#netStandard}} + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {{targetFramework}} + {{/netStandard}} + {{^netStandard}} + {{^supportsUWP}} + {{targetFramework}} + {{/supportsUWP}} + {{#supportsUWP}} + UAP + 10.0.10240.0 + 10.0.10240.0 + 14 + {{/supportsUWP}} + {{/netStandard}} + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + {{^netStandard}} + + + + + + + + + + + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + {{binRelativePath}}\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + + + $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.2.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.2.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll + {{binRelativePath}}\JsonSubTypes.1.2.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll + + {{#generatePropertyChanged}} + + ..\..\packages\PropertyChanged.Fody.1.51.3\Lib\portable-net4+sl4+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\PropertyChanged.dll + + {{/generatePropertyChanged}} + {{/netStandard}} + {{#netStandard}} + + + {{/netStandard}} + + + + + {{^netStandard}} + + + {{#generatePropertyChanged}} + + {{/generatePropertyChanged}} + + + {{#generatePropertyChanged}} + + {{/generatePropertyChanged}} + {{/netStandard}} + {{#netStandard}} + + + {{/netStandard}} + + diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/RequestParameters.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/RequestParameters.mustache new file mode 100644 index 00000000000..f401c7bda91 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/RequestParameters.mustache @@ -0,0 +1,347 @@ +{{>partial_header}} + +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Text.RegularExpressions; + +namespace {{packageName}}.Client +{ + /// + /// request parameters helper + /// + public class RequestParameters + { + private readonly IReadableConfiguration config; + + public List> queryParams { get; } + public Object postBody { get; set; } + public Dictionary headerParams { get; } + public Dictionary formParams { get; } + //public Dictionary fileParams; + public Dictionary pathParams { get; } + public String contentType { get; set; } + + ///// + ///// 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, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name)); + // else + // return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided"); + //} + + /// + /// initialized object instance + /// + /// configuration instance + /// allowed content types + /// accepted formats + public RequestParameters(IReadableConfiguration config, string[] contentTypes = null, string[] accepts = null) + { + this.pathParams = new Dictionary(); + this.formParams = new Dictionary(); + this.pathParams = new Dictionary(); + this.headerParams = new Dictionary(); + this.queryParams = new List>(); + this.config = config; + + // order matters + if (contentTypes != null) + this.contentType = SelectHeaderContentType(contentTypes); + if (accepts != null) + { + var localVarHttpHeaderAccept = SelectHeaderAccept(accepts); + if (localVarHttpHeaderAccept != null) + + AddHeader("Accept", localVarHttpHeaderAccept); + } + } + + /// + /// add path parameter value + /// + /// + /// + public void AddPath(string name, object value) + { + if (value != null) + pathParams.Add(name, ParameterToString(value)); + } + + /// + /// add header parameter value + /// + /// + /// + public void AddHeader(string name, object value) + { + if (value != null) + headerParams.Add(name, ParameterToString(value)); + } + + /// + /// add body parameter value + /// + /// + public void AddBody(object value) + { + if (value != null && value.GetType() != typeof(byte[])) + { + postBody = Serialize(value); // http body (model) parameter + } + else + { + postBody = value; // byte array + } + + } + + /// + /// add query parameter value + /// + /// + /// + /// + public void AddQuery(string format, string name, object value) + { + if (value != null) + queryParams.AddRange(ParameterToKeyValuePairs(format, name, value)); + } + + /// + /// add query parameter value + /// + /// + /// + public void AddQuery(string name, object value) + { + if (value != null) + queryParams.AddRange(ParameterToKeyValuePairs("", name, value)); + } + + /// + /// add form parameter value + /// + /// parameter name + /// parameter value + public void AddForm(string name, object value) + { + if (value != null) + formParams.Add(name, ParameterToString(value)); + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// "multi" of causes collection from to be set multiple times + /// Key name. + /// Value object. + /// A list of KeyValuePairs both key and value are encoded + public IEnumerable> ParameterToKeyValuePairs(string collectionFormat, string name, object value) + { + var parameters = new List>(); + + if (IsCollection(value) && collectionFormat == "multi") + { + var valueCollection = value as System.Collections.IEnumerable; + parameters.AddRange(from object item in valueCollection select new KeyValuePair(name, ParameterToString(item))); + } + else + { + parameters.Add(new KeyValuePair(name, ParameterToString(value))); + } + + return parameters; + } + + /// + /// Check if generic object is a collection. + /// + /// + /// True if object is a collection type + private static bool IsCollection(object value) + { + return value is System.Collections.IList || value is System.Collections.ICollection; + } + + /// + /// Serialize an input (model) 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); + } + } + + /// + /// concatenates query parameters from + /// + /// query string having encoded names and values + public string GetQuery() + { + var separator = "?"; + var sb = new StringBuilder(); // is it the best way on .Net Standard 1.6 ? + + foreach (var q in queryParams) + { + var key = Encode(q.Key); + var value = Encode(q.Value); + + sb.Append($"{separator}{key}={value}"); + separator = "&"; + } + return sb.ToString(); + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public String SelectHeaderContentType(String[] contentTypes) + { + if (contentTypes.Length == 0) + return "application/json"; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType.ToLower())) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// Formatted and encoded string. + public string ParameterToString(object obj) + { + if (obj is DateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTime)obj).ToString(config.DateTimeFormat); + else if (obj is DateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTimeOffset)obj).ToString(config.DateTimeFormat); + else if (obj is System.Collections.IList) + { + var flattenedString = new StringBuilder(); + foreach (var param in (System.Collections.IList)obj) + { + if (flattenedString.Length > 0) + flattenedString.Append(","); + flattenedString.Append(Convert.ToString(param, neutral)); + } + return flattenedString.ToString(); + } + else + return Convert.ToString(obj, neutral); + } + + static IFormatProvider neutral = System.Globalization.CultureInfo.InvariantCulture; + + string Encode(string value) + { + return System.Net.WebUtility.UrlEncode(value); + } + + public void AddAuthKeyInHeader(string keyParamName) + { + if (!String.IsNullOrEmpty(config.GetApiKeyWithPrefix(keyParamName))) + { + AddHeader(keyParamName, config.GetApiKeyWithPrefix(keyParamName)); + } + } + + public void AddAuthKeyInQuery(string keyParamName) + { + if (!String.IsNullOrEmpty(config.GetApiKeyWithPrefix(keyParamName))) + { + AddQuery("", keyParamName, config.GetApiKeyWithPrefix(keyParamName)); + } + } + + public void AddAuthBasic() + { + // http basic authentication required + if (!String.IsNullOrEmpty(config.Username) || !String.IsNullOrEmpty(config.Password)) + { + AddHeader("Authorization", "Basic " + ApiClient.Base64Encode(config.Username + ":" + config.Password)); + } + } + + public void AddAuthAccessToken() + { + // oauth required + if (!String.IsNullOrEmpty(config.AccessToken)) + { + AddHeader("Authorization", "Bearer " + config.AccessToken); + } + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ResponseExtension.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ResponseExtension.mustache new file mode 100644 index 00000000000..c9b8fe06078 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/ResponseExtension.mustache @@ -0,0 +1,24 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; + +namespace {{packageName}}.Client +{ + /// + /// HttpResponseMessage helper + /// + public static class ResponseExtension + { + /// + /// HttpResponseMessage headers to IDictionary convertion + /// + public static IDictionary ToHeaders(this HttpResponseMessage value) + { + return value.Headers.ToDictionary(x => x.Key, x => string.Join("", x.Value)); + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/api.mustache new file mode 100644 index 00000000000..7b96febdb76 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/api.mustache @@ -0,0 +1,392 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +{{#netStandard}} +using System.Net.Http; +{{/netStandard}} +{{^netStandard}} +using System.Net.Http; +{{/netStandard}} +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + {{#supportsAsync}} + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/operation}} + #endregion Asynchronous Operations + {{/supportsAsync}} + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(String basePath) + { + this.Configuration = new {{packageName}}.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public {{classname}}({{packageName}}.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = {{packageName}}.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new {{^net35}}ReadOnly{{/net35}}Dictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + public ApiResponse<{{#returnType}} {{{returnType}}} {{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#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 {{classname}}->{{operationId}}"); + {{/required}} + {{/allParams}} + + var localVarPath = "{{#netStandard}}.{{/netStandard}}{{{path}}}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + {{#consumes}} + "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}} + {{/consumes}} + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + {{#produces}} + "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} + {{/produces}} + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + {{#pathParams}} + requestParameters.AddPath("{{baseName}}", {{paramName}}); // path parameter + {{/pathParams}} + {{#queryParams}} + requestParameters.AddQuery("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}); // query parameter + {{/queryParams}} + {{#headerParams}} + requestParameters.AddHeader("{{baseName}}", {{paramName}}); // header parameter + {{/headerParams}} + {{#formParams}} + {{#isFile}}//if ({{paramName}} != null) localVarFileParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}requestParameters.AddForm("{{baseName}}", {{paramName}}); // form parameter{{/isFile}} + {{/formParams}} + {{#bodyParam}} + requestParameters.AddBody({{paramName}}); // body parameter + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInHeader}} + requestParameters.AddAuthKeyInHeader("{{keyParamName}}"); + {{/isKeyInHeader}} + {{#isKeyInQuery}} + requestParameters.AddAuthKeyInQuery("{{keyParamName}}"); + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + // http basic authentication required + requestParameters.AddAuthBasic(); + {{/isBasic}} + {{#isOAuth}} + // oauth required + requestParameters.AddAuthAccessToken(); + {{/isOAuth}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("{{httpMethod}}"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("{{operationId}}", localVarResponse); + if (exception != null) throw exception; + } + + {{#returnType}} + return new ApiResponse<{{{returnType}}}>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize<{{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}>(localVarResponse)); + {{/returnType}} + {{^returnType}} + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + {{/returnType}} + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} + + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + public async System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#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 {{classname}}->{{operationId}}"); + {{/required}} + {{/allParams}} + + var localVarPath = "{{#netStandard}}.{{/netStandard}}{{{path}}}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + {{#consumes}} + "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}} + {{/consumes}} + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + {{#produces}} + "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} + {{/produces}} + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + {{#pathParams}} + requestParameters.AddPath("{{baseName}}", {{paramName}}); // path parameter + {{/pathParams}} + {{#queryParams}} + requestParameters.AddQuery("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}); // query parameter + {{/queryParams}} + {{#headerParams}} + requestParameters.AddHeader("{{baseName}}", {{paramName}}); // header parameter + {{/headerParams}} + {{#formParams}} + {{#isFile}}//if ({{paramName}} != null) localVarFileParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}requestParameters.AddForm("{{baseName}}", {{paramName}}); // form parameter{{/isFile}} + {{/formParams}} + {{#bodyParam}} + requestParameters.AddBody({{paramName}}); + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInHeader}} + requestParameters.AddAuthKeyInHeader("{{keyParamName}}"); + {{/isKeyInHeader}} + {{#isKeyInQuery}} + requestParameters.AddAuthKeyInQuery("{{keyParamName}}"); + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + // http basic authentication required + requestParameters.AddAuthBasic(); + {{/isBasic}} + {{#isOAuth}} + // oauth required + requestParameters.AddAuthAccessToken(); + {{/isOAuth}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("{{httpMethod}}"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("{{operationId}}", localVarResponse); + if (exception != null) throw exception; + } + + {{#returnType}} + return new ApiResponse<{{{returnType}}}>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize<{{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}>(localVarResponse)); + {{/returnType}} + {{^returnType}} + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + {{/returnType}} + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/api_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/api_test.mustache new file mode 100644 index 00000000000..6b22ed87ade --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/api_test.mustache @@ -0,0 +1,74 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class {{classname}}Tests + { + private {{classname}} instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new {{classname}}(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' {{classname}} + //Assert.IsInstanceOfType(typeof({{classname}}), instance, "instance is a {{classname}}"); + } + + {{#operations}}{{#operation}} + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}//Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}} + } + {{/operation}}{{/operations}} + } + +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/netcore_project.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/netcore_project.mustache new file mode 100644 index 00000000000..7623944dec1 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/netcore_project.mustache @@ -0,0 +1,43 @@ + + + + {{targetFrameworkNuget}} + {{packageName}} + {{packageName}} + Library + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + true + true + true + {{packageName}} + {{packageVersion}} + + + + {{#netStandard}} + + {{/netStandard}} + + + + + + {{^netStandard}} + + + + + + + + + + + + {{/netStandard}} + + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/netcore_testproject.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/netcore_testproject.mustache new file mode 100644 index 00000000000..184e65c2f3a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/netcore_testproject.mustache @@ -0,0 +1,47 @@ + + + + {{targetFrameworkNuget}} + {{testPackageName}} + {{testPackageName}} + Library + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + true + true + true + {{testPackageName}} + + + + + {{#netStandard}} + + {{/netStandard}} + + + + + + {{^netStandard}} + + + + + + + + + + + + {{/netStandard}} + + + + + + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/packages.config.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/packages.config.mustache new file mode 100644 index 00000000000..b9638605672 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/packages.config.mustache @@ -0,0 +1,6 @@ + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/packages_test.config.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/packages_test.config.mustache new file mode 100644 index 00000000000..11a53bf8e84 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/packages_test.config.mustache @@ -0,0 +1,7 @@ + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/project.json.mustache b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/project.json.mustache new file mode 100644 index 00000000000..215ca2c42f5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/libraries/httpClient/project.json.mustache @@ -0,0 +1,12 @@ +{ + "supports": {}, + "dependencies": { + "System.Net.Http": "4.3.4", + "System.ComponentModel.Annotations": "5.0.0", + "Newtonsoft.Json": "10.0.3", + "JsonSubTypes": "1.2.0" + }, + "frameworks": { + "{{targetFrameworkNuget}}": {} + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpClientOptionsTest.java index 2d2861d0475..225c6ee77d2 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpClientOptionsTest.java @@ -62,6 +62,8 @@ protected void setExpectations() { times = 1; clientCodegen.setValidatable(true); times = 1; +// clientCodegen.setLibrary(CSharpClientOptionsProvider.DEFAULT_LIBRARY_VALUE); +// times = 1; }}; } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java index 8df7488e051..a864bc410ca 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/CSharpClientOptionsProvider.java @@ -14,6 +14,8 @@ public class CSharpClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String MODEL_PROPERTY_NAMING = "modelPropertyNaming"; + public static final String DEFAULT_LIBRARY_VALUE = "restSharp"; + @Override public String getLanguage() { return "csharp"; @@ -43,6 +45,7 @@ public Map createOptions() { .put(CodegenConstants.NETCORE_PROJECT_FILE, "false") .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING) .put(CodegenConstants.VALIDATABLE, "true") + .put(CodegenConstants.LIBRARY, DEFAULT_LIBRARY_VALUE) .build(); } diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/.gitignore b/samples/client/petstore/csharp/httpClient/SwaggerClient/.gitignore new file mode 100644 index 00000000000..17302c93bf0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/.gitignore @@ -0,0 +1,186 @@ +# Ref: https://gist.github.com/kmorcinek/2710267 +# Download this file using PowerShell v3 under Windows with the following comand +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore + +# User-specific files +*.suo +*.user +*.sln.docstates +./nuget + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# svn +.svn + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/.swagger-codegen-ignore b/samples/client/petstore/csharp/httpClient/SwaggerClient/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/.swagger-codegen/VERSION b/samples/client/petstore/csharp/httpClient/SwaggerClient/.swagger-codegen/VERSION new file mode 100644 index 00000000000..0b155951995 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/.travis.yml b/samples/client/petstore/csharp/httpClient/SwaggerClient/.travis.yml new file mode 100644 index 00000000000..805caf43c2c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/.travis.yml @@ -0,0 +1,9 @@ +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +language: csharp +mono: + - latest +solution: IO.Swagger.sln +script: + - /bin/sh ./mono_nunit_test.sh diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/httpClient/SwaggerClient/IO.Swagger.sln new file mode 100644 index 00000000000..9f451b66298 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/IO.Swagger.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30621.155 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {040E1582-62B2-4C79-BC4E-4435FD2A6C4D} + EndGlobalSection +EndGlobal diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/README.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/README.md new file mode 100644 index 00000000000..97ae0489427 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/README.md @@ -0,0 +1,205 @@ +# IO.Swagger - the C# library for the Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: io.swagger.codegen.languages.CSharpClientCodegen + + +## Frameworks supported +- .NET 4.0 or later +- Windows Phone 7.1 (Mango) + + +## Dependencies +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) + + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; +``` + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out IO.Swagger.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + + +## Getting Started + +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class Example + { + public void main() + { + + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Model.Animal](docs/Animal.md) + - [Model.AnimalFarm](docs/AnimalFarm.md) + - [Model.ApiResponse](docs/ApiResponse.md) + - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) + - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) + - [Model.Category](docs/Category.md) + - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) + - [Model.EnumArrays](docs/EnumArrays.md) + - [Model.EnumClass](docs/EnumClass.md) + - [Model.EnumTest](docs/EnumTest.md) + - [Model.FormatTest](docs/FormatTest.md) + - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) + - [Model.List](docs/List.md) + - [Model.MapTest](docs/MapTest.md) + - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.Model200Response](docs/Model200Response.md) + - [Model.ModelClient](docs/ModelClient.md) + - [Model.Name](docs/Name.md) + - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) + - [Model.Order](docs/Order.md) + - [Model.OuterComposite](docs/OuterComposite.md) + - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.Pet](docs/Pet.md) + - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) + - [Model.SpecialModelName](docs/SpecialModelName.md) + - [Model.Tag](docs/Tag.md) + - [Model.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/build.bat b/samples/client/petstore/csharp/httpClient/SwaggerClient/build.bat new file mode 100644 index 00000000000..d37b6115ab8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/build.bat @@ -0,0 +1,17 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319 + +if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')" +.\nuget.exe install src\IO.Swagger\packages.config -o packages + +if not exist ".\bin" mkdir bin + +copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll +copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/build.sh b/samples/client/petstore/csharp/httpClient/SwaggerClient/build.sh new file mode 100644 index 00000000000..5413cda4ddd --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/build.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +frameworkVersion=net45 + +# sdk must match installed framworks under PREFIX/lib/mono/[value] +sdk=4.5.2-api + +# langversion refers to C# language features. see man mcs for details. +langversion=${sdk} +nuget_cmd=nuget + +# Match against our known SDK possibilities +case "${sdk}" in + 4) + langversion=4 + ;; + 4.5*) + langversion=5 + ;; + 4.6*) + langversion=6 + ;; + 4.7*) + langversion=7 # ignoring 7.1 for now. + ;; + *) + langversion=6 + ;; +esac + +echo "[INFO] Target framework: ${frameworkVersion}" + +if ! type nuget &>/dev/null; then + echo "[INFO] Download nuget and packages" + wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; + nuget_cmd="mono nuget.exe" +fi + +mozroots --import --sync +${nuget_cmd} install src/IO.Swagger/packages.config -o packages; + +echo "[INFO] Copy DLLs to the 'bin' folder" +mkdir -p bin; +cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll; +cp packages/JsonSubTypes.1.2.0/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll + +echo "[INFO] Run 'mcs' to build bin/IO.Swagger.dll" +mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\ +bin/RestSharp.dll,\ +System.ComponentModel.DataAnnotations.dll,\ +System.Runtime.Serialization.dll \ +-target:library \ +-out:bin/IO.Swagger.dll \ +-recurse:'src/IO.Swagger/*.cs' \ +-doc:bin/IO.Swagger.xml \ +-platform:anycpu + +if [ $? -ne 0 ] +then + echo "[ERROR] Compilation failed with exit code $?" + exit 1 +else + echo "[INFO] bin/IO.Swagger.dll was created successfully" +fi diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..ac4f9d10798 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AdditionalPropertiesClass.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.AdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Animal.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Animal.md new file mode 100644 index 00000000000..f461176159c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Animal.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Animal +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AnimalFarm.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AnimalFarm.md new file mode 100644 index 00000000000..4d1cccb0cef --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AnimalFarm.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.AnimalFarm +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..89bc406754a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/AnotherFakeApi.md @@ -0,0 +1,70 @@ +# IO.Swagger.Api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **TestSpecialTags** +> ModelClient TestSpecialTags (ModelClient body) + +To test special tags + +To test special tags + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestSpecialTagsExample + { + public void main() + { + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ApiResponse.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ApiResponse.md new file mode 100644 index 00000000000..3e4b4c5e9cb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ApiResponse.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ApiResponse +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int?** | | [optional] +**Type** | **string** | | [optional] +**Message** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..3431d89edd0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ArrayOfArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..9dc573663d6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal?>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayTest.md new file mode 100644 index 00000000000..37fb2788b77 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ArrayTest.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ArrayTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Boolean.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Capitalization.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Capitalization.md new file mode 100644 index 00000000000..87d14f03e0d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Capitalization.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Capitalization +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Cat.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Cat.md new file mode 100644 index 00000000000..a88425f4307 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Cat.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.Cat +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Category.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Category.md new file mode 100644 index 00000000000..20b56b1728c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Category.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Category +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ClassModel.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ClassModel.md new file mode 100644 index 00000000000..9bfd15db501 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ClassModel.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ClassModel +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Dog.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Dog.md new file mode 100644 index 00000000000..c3ee6d927b4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Dog.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.Dog +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumArrays.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumArrays.md new file mode 100644 index 00000000000..86fd208f8f8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumArrays.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.EnumArrays +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | **string** | | [optional] +**ArrayEnum** | **List<string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumClass.md new file mode 100644 index 00000000000..d936aad6f0b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumClass.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.EnumClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumTest.md new file mode 100644 index 00000000000..f3278be4cf3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/EnumTest.md @@ -0,0 +1,13 @@ +# IO.Swagger.Model.EnumTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int?** | | [optional] +**EnumNumber** | **double?** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FakeApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FakeApi.md new file mode 100644 index 00000000000..490521457a0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FakeApi.md @@ -0,0 +1,660 @@ +# IO.Swagger.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data + + + +# **FakeOuterBooleanSerialize** +> bool? FakeOuterBooleanSerialize (OuterBoolean body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + + try + { + bool? result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +**bool?** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterNumberSerialize** +> decimal? FakeOuterNumberSerialize (OuterNumber body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + + try + { + decimal? result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +**decimal?** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (OuterString body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterString(); // OuterString | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User body, string query) + + + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new User(); // User | + var query = query_example; // string | + + try + { + apiInstance.TestBodyWithQueryParams(body, query); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| | + **query** | **string**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient body) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClientModelExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public void main() + { + // Configure HTTP basic authorization: http_basic_test + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(); + var number = 8.14; // decimal? | None + var _double = 1.2; // double? | None + var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None + var _byte = B; // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789; // long? | None (optional) + var _float = 3.4; // float? | None (optional) + var _string = _string_example; // string | None (optional) + var binary = B; // byte[] | None (optional) + var date = 2013-10-20; // DateTime? | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var password = password_example; // string | None (optional) + var callback = callback_example; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **decimal?**| None | + **_double** | **double?**| None | + **patternWithoutDelimiter** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **_string** | **string**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] + **password** | **string**| None | [optional] + **callback** | **string**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public void main() + { + var apiInstance = new FakeApi(); + var enumFormStringArray = enumFormStringArray_example; // List | Form parameter enum test (string array) (optional) + var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) + var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) + var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumFormStringArray** | **List<string>**| Form parameter enum test (string array) | [optional] + **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] + **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] + **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] + **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] + **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Object param) + +test inline additionalProperties + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public void main() + { + var apiInstance = new FakeApi(); + var param = ; // Object | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(param); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public void main() + { + var apiInstance = new FakeApi(); + var param = param_example; // string | field1 + var param2 = param2_example; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **string**| field1 | + **param2** | **string**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..0c972a86431 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FakeClassnameTags123Api.md @@ -0,0 +1,75 @@ +# IO.Swagger.Api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **TestClassname** +> ModelClient TestClassname (ModelClient body) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClassnameExample + { + public void main() + { + // Configure API key authorization: api_key_query + Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FormatTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FormatTest.md new file mode 100644 index 00000000000..1108a1af428 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/FormatTest.md @@ -0,0 +1,21 @@ +# IO.Swagger.Model.FormatTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int?** | | [optional] +**Int32** | **int?** | | [optional] +**Int64** | **long?** | | [optional] +**Number** | **decimal?** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **byte[]** | | [optional] +**Date** | **DateTime?** | | +**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid?** | | [optional] +**Password** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..cf0190498b9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/HasOnlyReadOnly.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.HasOnlyReadOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] +**Foo** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Ints.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/List.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/List.md new file mode 100644 index 00000000000..d7555b7e7ac --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/List.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.List +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/MapTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/MapTest.md new file mode 100644 index 00000000000..5c202aa336a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/MapTest.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.MapTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..e2c978f9ab1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.MixedPropertiesAndAdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid?** | | [optional] +**DateTime** | **DateTime?** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Model200Response.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Model200Response.md new file mode 100644 index 00000000000..62db21288f2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Model200Response.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Model200Response +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **int?** | | [optional] +**Class** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ModelClient.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ModelClient.md new file mode 100644 index 00000000000..c3817230640 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ModelClient.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ModelClient +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**__Client** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Name.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Name.md new file mode 100644 index 00000000000..678132c8e4e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Name.md @@ -0,0 +1,12 @@ +# IO.Swagger.Model.Name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int?** | | +**SnakeCase** | **int?** | | [optional] +**Property** | **string** | | [optional] +**_123Number** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/NumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/NumberOnly.md new file mode 100644 index 00000000000..a156dc4e2fc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/NumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.NumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Numbers.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Order.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Order.md new file mode 100644 index 00000000000..32aeab388e5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Order.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Order +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**PetId** | **long?** | | [optional] +**Quantity** | **int?** | | [optional] +**ShipDate** | **DateTime?** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool?** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/OuterComposite.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/OuterComposite.md new file mode 100644 index 00000000000..84714b7759e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/OuterComposite.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.OuterComposite +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/OuterEnum.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/OuterEnum.md new file mode 100644 index 00000000000..55eb118a349 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/OuterEnum.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterEnum +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Pet.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Pet.md new file mode 100644 index 00000000000..e83933d1c60 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Pet.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Pet +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Tags** | [**List<Tag>**](Tag.md) | | [optional] +**Status** | **string** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/PetApi.md new file mode 100644 index 00000000000..4ba479f81d1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/PetApi.md @@ -0,0 +1,526 @@ +# IO.Swagger.Api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **AddPet** +> void AddPet (Pet body) + +Add a new pet to the store + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class AddPetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var body = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeletePet** +> void DeletePet (long? petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeletePetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | Pet id to delete + var apiKey = apiKey_example; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| Pet id to delete | + **apiKey** | **string**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByStatus** +> List FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var status = status_example; // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List<Pet> result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **List<string>**| Status values that need to be considered for filter | + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByTags** +> List FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List<Pet> result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetPetById** +> Pet GetPetById (long? petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public void main() + { + // Configure API key authorization: api_key + Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet body) + +Update an existing pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdatePetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var body = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long? petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet that needs to be updated + var name = name_example; // string | Updated name of the pet (optional) + var status = status_example; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet that needs to be updated | + **name** | **string**| Updated name of the pet | [optional] + **status** | **string**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + +uploads an image + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UploadFileExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet to update + var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to update | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..b5f8d484869 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/ReadOnlyFirst.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.ReadOnlyFirst +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] +**Baz** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Return.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/SpecialModelName.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/SpecialModelName.md new file mode 100644 index 00000000000..ee1bc316835 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/SpecialModelName.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.SpecialModelName +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/StoreApi.md new file mode 100644 index 00000000000..28e3fe59067 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/StoreApi.md @@ -0,0 +1,254 @@ +# IO.Swagger.Api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + + +# **DeleteOrder** +> 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 + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public void main() + { + var apiInstance = new StoreApi(); + var orderId = orderId_example; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **string**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetInventory** +> Dictionary GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetInventoryExample + { + public void main() + { + // Configure API key authorization: api_key + Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(); + + try + { + // Returns pet inventories by status + Dictionary<string, int?> result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetOrderById** +> Order GetOrderById (long? orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public void main() + { + var apiInstance = new StoreApi(); + var orderId = 789; // long? | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long?**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order body) + +Place an order for a pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public void main() + { + var apiInstance = new StoreApi(); + var body = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Tag.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Tag.md new file mode 100644 index 00000000000..64c5e6bdc72 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/Tag.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Tag +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/User.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/User.md new file mode 100644 index 00000000000..fbea33c48b9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/User.md @@ -0,0 +1,16 @@ +# IO.Swagger.Model.User +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int?** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/UserApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/UserApi.md new file mode 100644 index 00000000000..dfe89c60ab9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/docs/UserApi.md @@ -0,0 +1,488 @@ +# IO.Swagger.Api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user +[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +# **CreateUser** +> void CreateUser (User body) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List body) + +Creates list of users with given input array + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List body) + +Creates list of users with given input array + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeleteUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class LoginUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The user name for login + var password = password_example; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The user name for login | + **password** | **string**| The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class LogoutUserExample + { + public void main() + { + var apiInstance = new UserApi(); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateUser** +> void UpdateUser (string username, User body) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdateUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | name that need to be deleted + var body = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/git_push.sh b/samples/client/petstore/csharp/httpClient/SwaggerClient/git_push.sh new file mode 100644 index 00000000000..160f6f21399 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/mono_nunit_test.sh b/samples/client/petstore/csharp/httpClient/SwaggerClient/mono_nunit_test.sh new file mode 100644 index 00000000000..1276032d81b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/mono_nunit_test.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +mozroots --import --sync + +echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" +rm src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll 2> /dev/null + +echo "[INFO] install NUnit runners via NuGet" +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +mozroots --import --sync +mono nuget.exe install src/IO.Swagger.Test/packages.config -o packages + +echo "[INFO] Install NUnit runners via NuGet" +mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages + +echo "[INFO] Build the solution and run the unit test" +xbuild IO.Swagger.sln && \ + mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/IO.Swagger.Test/bin/Debug/IO.Swagger.Test.dll diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..5abd1100189 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing AnotherFakeApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class AnotherFakeApiTests + { + private AnotherFakeApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new AnotherFakeApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of AnotherFakeApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' AnotherFakeApi + //Assert.IsInstanceOfType(typeof(AnotherFakeApi), instance, "instance is a AnotherFakeApi"); + } + + + /// + /// Test TestSpecialTags + /// + [Test] + public void TestSpecialTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient body = null; + //var response = instance.TestSpecialTags(body); + //Assert.IsInstanceOf (response, "response is ModelClient"); + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs new file mode 100644 index 00000000000..b79b7417938 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs @@ -0,0 +1,210 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing FakeApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class FakeApiTests + { + private FakeApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new FakeApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of FakeApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' FakeApi + //Assert.IsInstanceOfType(typeof(FakeApi), instance, "instance is a FakeApi"); + } + + + /// + /// Test FakeOuterBooleanSerialize + /// + [Test] + public void FakeOuterBooleanSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //OuterBoolean body = null; + //var response = instance.FakeOuterBooleanSerialize(body); + //Assert.IsInstanceOf (response, "response is bool?"); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Test] + public void FakeOuterCompositeSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //OuterComposite body = null; + //var response = instance.FakeOuterCompositeSerialize(body); + //Assert.IsInstanceOf (response, "response is OuterComposite"); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Test] + public void FakeOuterNumberSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //OuterNumber body = null; + //var response = instance.FakeOuterNumberSerialize(body); + //Assert.IsInstanceOf (response, "response is decimal?"); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Test] + public void FakeOuterStringSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //OuterString body = null; + //var response = instance.FakeOuterStringSerialize(body); + //Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Test] + public void TestBodyWithQueryParamsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User body = null; + //string query = null; + //instance.TestBodyWithQueryParams(body, query); + + } + + /// + /// Test TestClientModel + /// + [Test] + public void TestClientModelTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient body = null; + //var response = instance.TestClientModel(body); + //Assert.IsInstanceOf (response, "response is ModelClient"); + } + + /// + /// Test TestEndpointParameters + /// + [Test] + public void TestEndpointParametersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //decimal? number = null; + //double? _double = null; + //string patternWithoutDelimiter = null; + //byte[] _byte = null; + //int? integer = null; + //int? int32 = null; + //long? int64 = null; + //float? _float = null; + //string _string = null; + //byte[] binary = null; + //DateTime? date = null; + //DateTime? dateTime = null; + //string password = null; + //string callback = null; + //instance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + + } + + /// + /// Test TestEnumParameters + /// + [Test] + public void TestEnumParametersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List enumFormStringArray = null; + //string enumFormString = null; + //List enumHeaderStringArray = null; + //string enumHeaderString = null; + //List enumQueryStringArray = null; + //string enumQueryString = null; + //int? enumQueryInteger = null; + //double? enumQueryDouble = null; + //instance.TestEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Test] + public void TestInlineAdditionalPropertiesTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Object param = null; + //instance.TestInlineAdditionalProperties(param); + + } + + /// + /// Test TestJsonFormData + /// + [Test] + public void TestJsonFormDataTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string param = null; + //string param2 = null; + //instance.TestJsonFormData(param, param2); + + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..6df4f217223 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class FakeClassnameTags123ApiTests + { + private FakeClassnameTags123Api instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new FakeClassnameTags123Api(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of FakeClassnameTags123Api + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' FakeClassnameTags123Api + //Assert.IsInstanceOfType(typeof(FakeClassnameTags123Api), instance, "instance is a FakeClassnameTags123Api"); + } + + + /// + /// Test TestClassname + /// + [Test] + public void TestClassnameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient body = null; + //var response = instance.TestClassname(body); + //Assert.IsInstanceOf (response, "response is ModelClient"); + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs new file mode 100644 index 00000000000..6212b8d9656 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs @@ -0,0 +1,169 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing PetApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class PetApiTests + { + private PetApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new PetApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of PetApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' PetApi + //Assert.IsInstanceOfType(typeof(PetApi), instance, "instance is a PetApi"); + } + + + /// + /// Test AddPet + /// + [Test] + public void AddPetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Pet body = null; + //instance.AddPet(body); + + } + + /// + /// Test DeletePet + /// + [Test] + public void DeletePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long? petId = null; + //string apiKey = null; + //instance.DeletePet(petId, apiKey); + + } + + /// + /// Test FindPetsByStatus + /// + [Test] + public void FindPetsByStatusTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.FindPetsByStatus(status); + //Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test FindPetsByTags + /// + [Test] + public void FindPetsByTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List tags = null; + //var response = instance.FindPetsByTags(tags); + //Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test GetPetById + /// + [Test] + public void GetPetByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long? petId = null; + //var response = instance.GetPetById(petId); + //Assert.IsInstanceOf (response, "response is Pet"); + } + + /// + /// Test UpdatePet + /// + [Test] + public void UpdatePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Pet body = null; + //instance.UpdatePet(body); + + } + + /// + /// Test UpdatePetWithForm + /// + [Test] + public void UpdatePetWithFormTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long? petId = null; + //string name = null; + //string status = null; + //instance.UpdatePetWithForm(petId, name, status); + + } + + /// + /// Test UploadFile + /// + [Test] + public void UploadFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long? petId = null; + //string additionalMetadata = null; + //System.IO.Stream _file = null; + //var response = instance.UploadFile(petId, additionalMetadata, _file); + //Assert.IsInstanceOf (response, "response is ApiResponse"); + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/StoreApiTests.cs new file mode 100644 index 00000000000..80838fffa5c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/StoreApiTests.cs @@ -0,0 +1,115 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing StoreApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class StoreApiTests + { + private StoreApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new StoreApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of StoreApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' StoreApi + //Assert.IsInstanceOfType(typeof(StoreApi), instance, "instance is a StoreApi"); + } + + + /// + /// Test DeleteOrder + /// + [Test] + public void DeleteOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string orderId = null; + //instance.DeleteOrder(orderId); + + } + + /// + /// Test GetInventory + /// + [Test] + public void GetInventoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetInventory(); + //Assert.IsInstanceOf> (response, "response is Dictionary"); + } + + /// + /// Test GetOrderById + /// + [Test] + public void GetOrderByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long? orderId = null; + //var response = instance.GetOrderById(orderId); + //Assert.IsInstanceOf (response, "response is Order"); + } + + /// + /// Test PlaceOrder + /// + [Test] + public void PlaceOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Order body = null; + //var response = instance.PlaceOrder(body); + //Assert.IsInstanceOf (response, "response is Order"); + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/UserApiTests.cs new file mode 100644 index 00000000000..a3beb06aca6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Api/UserApiTests.cs @@ -0,0 +1,165 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing UserApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class UserApiTests + { + private UserApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new UserApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of UserApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' UserApi + //Assert.IsInstanceOfType(typeof(UserApi), instance, "instance is a UserApi"); + } + + + /// + /// Test CreateUser + /// + [Test] + public void CreateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User body = null; + //instance.CreateUser(body); + + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Test] + public void CreateUsersWithArrayInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List body = null; + //instance.CreateUsersWithArrayInput(body); + + } + + /// + /// Test CreateUsersWithListInput + /// + [Test] + public void CreateUsersWithListInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List body = null; + //instance.CreateUsersWithListInput(body); + + } + + /// + /// Test DeleteUser + /// + [Test] + public void DeleteUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //instance.DeleteUser(username); + + } + + /// + /// Test GetUserByName + /// + [Test] + public void GetUserByNameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //var response = instance.GetUserByName(username); + //Assert.IsInstanceOf (response, "response is User"); + } + + /// + /// Test LoginUser + /// + [Test] + public void LoginUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //string password = null; + //var response = instance.LoginUser(username, password); + //Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test LogoutUser + /// + [Test] + public void LogoutUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.LogoutUser(); + + } + + /// + /// Test UpdateUser + /// + [Test] + public void UpdateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //User body = null; + //instance.UpdateUser(username, body); + + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj new file mode 100644 index 00000000000..a1beb457897 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {19F1DEBC-DE5E-4517-8062-F000CD499087} + Library + Properties + IO.Swagger.Test + IO.Swagger.Test + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + + + $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll + + + $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll + + + + + + + + + + + + {321C8C3F-0156-40C1-AE42-D59761FB9B6C} + IO.Swagger + + + + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..60b6cee9f53 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AdditionalPropertiesClassTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class AdditionalPropertiesClassTests + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Test] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" AdditionalPropertiesClass + //Assert.IsInstanceOfType (instance, "variable 'instance' is a AdditionalPropertiesClass"); + } + + + /// + /// Test the property 'MapProperty' + /// + [Test] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + /// + /// Test the property 'MapOfMapProperty' + /// + [Test] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AnimalFarmTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AnimalFarmTests.cs new file mode 100644 index 00000000000..6fa7b87485a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AnimalFarmTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing AnimalFarm + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class AnimalFarmTests + { + // TODO uncomment below to declare an instance variable for AnimalFarm + //private AnimalFarm instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of AnimalFarm + //instance = new AnimalFarm(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of AnimalFarm + /// + [Test] + public void AnimalFarmInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" AnimalFarm + //Assert.IsInstanceOfType (instance, "variable 'instance' is a AnimalFarm"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AnimalTests.cs new file mode 100644 index 00000000000..ba3786457af --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/AnimalTests.cs @@ -0,0 +1,106 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Animal + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class AnimalTests + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Animal + /// + [Test] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Animal + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Animal"); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Test] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsInstanceOf(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + /// + /// Test deserialize a Cat from type Animal + /// + [Test] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsInstanceOf(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Color' + /// + [Test] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ApiResponseTests.cs new file mode 100644 index 00000000000..8a5649b4676 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ApiResponseTests.cs @@ -0,0 +1,96 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ApiResponseTests + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ApiResponse + /// + [Test] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ApiResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ApiResponse"); + } + + + /// + /// Test the property 'Code' + /// + [Test] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Type' + /// + [Test] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'Message' + /// + [Test] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..3f8f100a7f5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ArrayOfArrayOfNumberOnlyTests + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Test] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ArrayOfArrayOfNumberOnly + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ArrayOfArrayOfNumberOnly"); + } + + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Test] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..28a540e676b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayOfNumberOnlyTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ArrayOfNumberOnlyTests + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Test] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ArrayOfNumberOnly + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ArrayOfNumberOnly"); + } + + + /// + /// Test the property 'ArrayNumber' + /// + [Test] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..09864b81ac2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ArrayTestTests.cs @@ -0,0 +1,96 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ArrayTest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ArrayTestTests + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ArrayTest + /// + [Test] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ArrayTest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ArrayTest"); + } + + + /// + /// Test the property 'ArrayOfString' + /// + [Test] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Test] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Test] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/BooleanTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/BooleanTests.cs new file mode 100644 index 00000000000..c4fdadb0100 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/BooleanTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Boolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class BooleanTests + { + // TODO uncomment below to declare an instance variable for Boolean + //private Boolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Boolean + //instance = new Boolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Boolean + /// + [Test] + public void BooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Boolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Boolean"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CapitalizationTests.cs new file mode 100644 index 00000000000..fe7637ded78 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CapitalizationTests.cs @@ -0,0 +1,120 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Capitalization + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class CapitalizationTests + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Capitalization + /// + [Test] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Capitalization + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Capitalization"); + } + + + /// + /// Test the property 'SmallCamel' + /// + [Test] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + /// + /// Test the property 'CapitalCamel' + /// + [Test] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + /// + /// Test the property 'SmallSnake' + /// + [Test] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + /// + /// Test the property 'CapitalSnake' + /// + [Test] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Test] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + /// + /// Test the property 'ATT_NAME' + /// + [Test] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CatTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CatTests.cs new file mode 100644 index 00000000000..d79719efdbc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CatTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Cat + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class CatTests + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Cat + /// + [Test] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Cat + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Cat"); + } + + + /// + /// Test the property 'Declawed' + /// + [Test] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CategoryTests.cs new file mode 100644 index 00000000000..13497ed1fd6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/CategoryTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Category + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class CategoryTests + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Category + /// + [Test] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Category + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Category"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ClassModelTests.cs new file mode 100644 index 00000000000..fd22d2a3d86 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ClassModelTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ClassModel + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ClassModelTests + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ClassModel + /// + [Test] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ClassModel + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ClassModel"); + } + + + /// + /// Test the property 'Class' + /// + [Test] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/DogTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/DogTests.cs new file mode 100644 index 00000000000..3f47e42e8c2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/DogTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Dog + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class DogTests + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Dog + /// + [Test] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Dog + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Dog"); + } + + + /// + /// Test the property 'Breed' + /// + [Test] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumArraysTests.cs new file mode 100644 index 00000000000..f84821d33eb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumArraysTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing EnumArrays + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class EnumArraysTests + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of EnumArrays + /// + [Test] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" EnumArrays + //Assert.IsInstanceOfType (instance, "variable 'instance' is a EnumArrays"); + } + + + /// + /// Test the property 'JustSymbol' + /// + [Test] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + /// + /// Test the property 'ArrayEnum' + /// + [Test] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumClassTests.cs new file mode 100644 index 00000000000..b37648d2200 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumClassTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing EnumClass + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class EnumClassTests + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of EnumClass + /// + [Test] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" EnumClass + //Assert.IsInstanceOfType (instance, "variable 'instance' is a EnumClass"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs new file mode 100644 index 00000000000..b997bfa5e28 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing EnumTest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class EnumTestTests + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of EnumTest + /// + [Test] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" EnumTest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a EnumTest"); + } + + + /// + /// Test the property 'EnumString' + /// + [Test] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + /// + /// Test the property 'EnumStringRequired' + /// + [Test] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// + /// Test the property 'EnumInteger' + /// + [Test] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + /// + /// Test the property 'EnumNumber' + /// + [Test] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + /// + /// Test the property 'OuterEnum' + /// + [Test] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/FormatTestTests.cs new file mode 100644 index 00000000000..cd3f8ff3c66 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/FormatTestTests.cs @@ -0,0 +1,176 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing FormatTest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class FormatTestTests + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of FormatTest + /// + [Test] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" FormatTest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a FormatTest"); + } + + + /// + /// Test the property 'Integer' + /// + [Test] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + /// + /// Test the property 'Int32' + /// + [Test] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + /// + /// Test the property 'Int64' + /// + [Test] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + /// + /// Test the property 'Number' + /// + [Test] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + /// + /// Test the property 'Float' + /// + [Test] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + /// + /// Test the property 'Double' + /// + [Test] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + /// + /// Test the property 'String' + /// + [Test] + public void StringTest() + { + // TODO unit test for the property 'String' + } + /// + /// Test the property 'Byte' + /// + [Test] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + /// + /// Test the property 'Binary' + /// + [Test] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + /// + /// Test the property 'Date' + /// + [Test] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + /// + /// Test the property 'DateTime' + /// + [Test] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Password' + /// + [Test] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 00000000000..cafd23d90b2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/HasOnlyReadOnlyTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing HasOnlyReadOnly + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class HasOnlyReadOnlyTests + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Test] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" HasOnlyReadOnly + //Assert.IsInstanceOfType (instance, "variable 'instance' is a HasOnlyReadOnly"); + } + + + /// + /// Test the property 'Bar' + /// + [Test] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Foo' + /// + [Test] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/IntsTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/IntsTests.cs new file mode 100644 index 00000000000..37d70a773c5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/IntsTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Ints + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class IntsTests + { + // TODO uncomment below to declare an instance variable for Ints + //private Ints instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Ints + //instance = new Ints(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Ints + /// + [Test] + public void IntsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Ints + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Ints"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ListTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ListTests.cs new file mode 100644 index 00000000000..6ca026a83e0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ListTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing List + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ListTests + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of List + /// + [Test] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" List + //Assert.IsInstanceOfType (instance, "variable 'instance' is a List"); + } + + + /// + /// Test the property '_123List' + /// + [Test] + public void _123ListTest() + { + // TODO unit test for the property '_123List' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/MapTestTests.cs new file mode 100644 index 00000000000..d61693c3322 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/MapTestTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing MapTest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MapTestTests + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MapTest + /// + [Test] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MapTest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MapTest"); + } + + + /// + /// Test the property 'MapMapOfString' + /// + [Test] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + /// + /// Test the property 'MapOfEnumString' + /// + [Test] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..55302d27c40 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,96 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MixedPropertiesAndAdditionalPropertiesClassTests + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Test] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MixedPropertiesAndAdditionalPropertiesClass"); + } + + + /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'DateTime' + /// + [Test] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Map' + /// + [Test] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/Model200ResponseTests.cs new file mode 100644 index 00000000000..0c2923ce04b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/Model200ResponseTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Model200Response + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class Model200ResponseTests + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Model200Response + /// + [Test] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Model200Response + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Model200Response"); + } + + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Class' + /// + [Test] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ModelClientTests.cs new file mode 100644 index 00000000000..8aacfe5e13a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ModelClientTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ModelClient + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ModelClientTests + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ModelClient + /// + [Test] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ModelClient + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ModelClient"); + } + + + /// + /// Test the property '__Client' + /// + [Test] + public void __ClientTest() + { + // TODO unit test for the property '__Client' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NameTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NameTests.cs new file mode 100644 index 00000000000..3802292269a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NameTests.cs @@ -0,0 +1,104 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Name + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NameTests + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Name + /// + [Test] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Name + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Name"); + } + + + /// + /// Test the property '_Name' + /// + [Test] + public void _NameTest() + { + // TODO unit test for the property '_Name' + } + /// + /// Test the property 'SnakeCase' + /// + [Test] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + /// + /// Test the property 'Property' + /// + [Test] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + /// + /// Test the property '_123Number' + /// + [Test] + public void _123NumberTest() + { + // TODO unit test for the property '_123Number' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NumberOnlyTests.cs new file mode 100644 index 00000000000..afa72bf45e4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NumberOnlyTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing NumberOnly + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NumberOnlyTests + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of NumberOnly + /// + [Test] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" NumberOnly + //Assert.IsInstanceOfType (instance, "variable 'instance' is a NumberOnly"); + } + + + /// + /// Test the property 'JustNumber' + /// + [Test] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NumbersTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NumbersTests.cs new file mode 100644 index 00000000000..7c0f6a64d87 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/NumbersTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Numbers + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NumbersTests + { + // TODO uncomment below to declare an instance variable for Numbers + //private Numbers instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Numbers + //instance = new Numbers(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Numbers + /// + [Test] + public void NumbersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Numbers + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Numbers"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OrderTests.cs new file mode 100644 index 00000000000..40757e5c01c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OrderTests.cs @@ -0,0 +1,120 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OrderTests + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Order + /// + [Test] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Order + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Order"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'PetId' + /// + [Test] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + /// + /// Test the property 'Quantity' + /// + [Test] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + /// + /// Test the property 'ShipDate' + /// + [Test] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Complete' + /// + [Test] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..8cae88a554a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,96 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterCompositeTests + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterComposite + /// + [Test] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterComposite + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterComposite"); + } + + + /// + /// Test the property 'MyNumber' + /// + [Test] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Test] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Test] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OuterEnumTests.cs new file mode 100644 index 00000000000..b65bc240b0d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/OuterEnumTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterEnum + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterEnumTests + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterEnum + /// + [Test] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterEnum + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterEnum"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/PetTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/PetTests.cs new file mode 100644 index 00000000000..89b221bde94 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/PetTests.cs @@ -0,0 +1,120 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class PetTests + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Pet + /// + [Test] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Pet + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Pet"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Test] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Test] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Test] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 00000000000..f3836f4cabd --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ReadOnlyFirstTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing ReadOnlyFirst + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReadOnlyFirstTests + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Test] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ReadOnlyFirst + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ReadOnlyFirst"); + } + + + /// + /// Test the property 'Bar' + /// + [Test] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Baz' + /// + [Test] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..ec2a68a5fbb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 00000000000..547c62fd482 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/SpecialModelNameTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing SpecialModelName + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class SpecialModelNameTests + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of SpecialModelName + /// + [Test] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" SpecialModelName + //Assert.IsInstanceOfType (instance, "variable 'instance' is a SpecialModelName"); + } + + + /// + /// Test the property 'SpecialPropertyName' + /// + [Test] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/TagTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/TagTests.cs new file mode 100644 index 00000000000..adb4bf7c8be --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/TagTests.cs @@ -0,0 +1,88 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TagTests + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Tag + /// + [Test] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Tag + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Tag"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/UserTests.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/UserTests.cs new file mode 100644 index 00000000000..1f64a7aa433 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/Model/UserTests.cs @@ -0,0 +1,136 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class UserTests + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of User + /// + [Test] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" User + //Assert.IsInstanceOfType (instance, "variable 'instance' is a User"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Username' + /// + [Test] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + /// + /// Test the property 'FirstName' + /// + [Test] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + /// + /// Test the property 'LastName' + /// + [Test] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + /// + /// Test the property 'Email' + /// + [Test] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + /// + /// Test the property 'Password' + /// + [Test] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'Phone' + /// + [Test] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'UserStatus' + /// + [Test] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/app.config b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/app.config new file mode 100644 index 00000000000..44298137ae7 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/packages.config b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/packages.config new file mode 100644 index 00000000000..169fdfc6b94 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..e81544ccae4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs @@ -0,0 +1,287 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestSpecialTags (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestSpecialTagsWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public AnotherFakeApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestSpecialTags (ModelClient body) + { + ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "/another-fake/dummy"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "/another-fake/dummy"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs new file mode 100644 index 00000000000..2b47afb3504 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -0,0 +1,1898 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool? + bool? FakeOuterBooleanSerialize (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal? + decimal? FakeOuterNumberSerialize (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// string + string FakeOuterStringSerialize (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void TestBodyWithQueryParams (User body, string query); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithQueryParamsWithHttpInfo (User body, string query); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClientModel (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClientModelWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// ApiResponse of Object(void) + ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// + void TestInlineAdditionalProperties (Object param); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Object param); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + void TestJsonFormData (string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of bool? + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (bool?) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of decimal? + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (decimal?) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (User body, string query); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (User body, string query); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Task of void + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Object param); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Object param); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of void + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of ApiResponse + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool? + public bool? FakeOuterBooleanSerialize (OuterBoolean body = null) + { + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "/fake/outer/boolean"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of bool? + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + { + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (bool?) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "/fake/outer/boolean"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + { + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "/fake/outer/composite"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + { + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "/fake/outer/composite"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal? + public decimal? FakeOuterNumberSerialize (OuterNumber body = null) + { + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "/fake/outer/number"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of decimal? + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + { + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (decimal?) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "/fake/outer/number"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// string + public string FakeOuterStringSerialize (OuterString body = null) + { + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + { + + var localVarPath = "/fake/outer/string"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + { + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + { + + var localVarPath = "/fake/outer/string"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + public void TestBodyWithQueryParams (User body, string query) + { + TestBodyWithQueryParamsWithHttpInfo(body, query); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (User body, string query) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'query' is set + if (query == null) + throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + var localVarPath = "/fake/body-with-query-params"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "query", query); // query parameter + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (User body, string query) + { + await TestBodyWithQueryParamsAsyncWithHttpInfo(body, query); + + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (User body, string query) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'query' is set + if (query == null) + throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + var localVarPath = "/fake/body-with-query-params"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "query", query); // query parameter + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClientModel (ModelClient body) + { + ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "/fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "/fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "/fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("integer", integer); // form parameter + requestParameters.AddForm("int32", int32); // form parameter + requestParameters.AddForm("int64", int64); // form parameter + requestParameters.AddForm("number", number); // form parameter + requestParameters.AddForm("float", _float); // form parameter + requestParameters.AddForm("double", _double); // form parameter + requestParameters.AddForm("string", _string); // form parameter + requestParameters.AddForm("pattern_without_delimiter", patternWithoutDelimiter); // form parameter + requestParameters.AddForm("byte", _byte); // form parameter + requestParameters.AddForm("binary", binary); // form parameter + requestParameters.AddForm("date", date); // form parameter + requestParameters.AddForm("dateTime", dateTime); // form parameter + requestParameters.AddForm("password", password); // form parameter + requestParameters.AddForm("callback", callback); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + requestParameters.AddAuthBasic(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "/fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("integer", integer); // form parameter + requestParameters.AddForm("int32", int32); // form parameter + requestParameters.AddForm("int64", int64); // form parameter + requestParameters.AddForm("number", number); // form parameter + requestParameters.AddForm("float", _float); // form parameter + requestParameters.AddForm("double", _double); // form parameter + requestParameters.AddForm("string", _string); // form parameter + requestParameters.AddForm("pattern_without_delimiter", patternWithoutDelimiter); // form parameter + requestParameters.AddForm("byte", _byte); // form parameter + requestParameters.AddForm("binary", binary); // form parameter + requestParameters.AddForm("date", date); // form parameter + requestParameters.AddForm("dateTime", dateTime); // form parameter + requestParameters.AddForm("password", password); // form parameter + requestParameters.AddForm("callback", callback); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + requestParameters.AddAuthBasic(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + public void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + TestEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "/fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "*/*" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "enum_query_string_array", enumQueryStringArray); // query parameter + requestParameters.AddQuery("", "enum_query_string", enumQueryString); // query parameter + requestParameters.AddQuery("", "enum_query_integer", enumQueryInteger); // query parameter + requestParameters.AddHeader("enum_header_string_array", enumHeaderStringArray); // header parameter + requestParameters.AddHeader("enum_header_string", enumHeaderString); // header parameter + requestParameters.AddForm("enum_form_string_array", enumFormStringArray); // form parameter + requestParameters.AddForm("enum_form_string", enumFormString); // form parameter + requestParameters.AddForm("enum_query_double", enumQueryDouble); // form parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + await TestEnumParametersAsyncWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "/fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "*/*" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "enum_query_string_array", enumQueryStringArray); // query parameter + requestParameters.AddQuery("", "enum_query_string", enumQueryString); // query parameter + requestParameters.AddQuery("", "enum_query_integer", enumQueryInteger); // query parameter + requestParameters.AddHeader("enum_header_string_array", enumHeaderStringArray); // header parameter + requestParameters.AddHeader("enum_header_string", enumHeaderString); // header parameter + requestParameters.AddForm("enum_form_string_array", enumFormStringArray); // form parameter + requestParameters.AddForm("enum_form_string", enumFormString); // form parameter + requestParameters.AddForm("enum_query_double", enumQueryDouble); // form parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestInlineAdditionalProperties (Object param) + { + TestInlineAdditionalPropertiesWithHttpInfo(param); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Object param) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + + var localVarPath = "/fake/inline-additionalProperties"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(param); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Task of void + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Object param) + { + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Object param) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + + var localVarPath = "/fake/inline-additionalProperties"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(param); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + public void TestJsonFormData (string param, string param2) + { + TestJsonFormDataWithHttpInfo(param, param2); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + public ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + // verify the required parameter 'param2' is set + if (param2 == null) + throw new ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + var localVarPath = "/fake/jsonFormData"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("param", param); // form parameter + requestParameters.AddForm("param2", param2); // form parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestJsonFormData", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of void + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + { + await TestJsonFormDataAsyncWithHttpInfo(param, param2); + + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + // verify the required parameter 'param2' is set + if (param2 == null) + throw new ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + var localVarPath = "/fake/jsonFormData"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("param", param); // form parameter + requestParameters.AddForm("param2", param2); // form parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestJsonFormData", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..0b9b3214f73 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,291 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApiAccessor + { + #region Synchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClassname (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClassnameWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeClassnameTags123Api(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClassname (ModelClient body) + { + ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "/fake_classname_test"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + // authentication (api_key_query) required + requestParameters.AddAuthKeyInQuery("api_key_query"); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "/fake_classname_test"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + // authentication (api_key_query) required + requestParameters.AddAuthKeyInQuery("api_key_query"); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/PetApi.cs new file mode 100644 index 00000000000..868cc39ca29 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/PetApi.cs @@ -0,0 +1,1484 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void AddPet (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse AddPetWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + void DeletePet (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// List<Pet> + List FindPetsByStatus (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByStatusWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + List FindPetsByTags (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByTagsWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + Pet GetPetById (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + ApiResponse GetPetByIdWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void UpdatePet (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + void UpdatePetWithForm (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task AddPetAsync (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task UpdatePetAsync (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public PetApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void AddPet (Pet body) + { + AddPetWithHttpInfo(body); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public ApiResponse AddPetWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "/pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task AddPetAsync (Pet body) + { + await AddPetAsyncWithHttpInfo(body); + + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "/pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + public void DeletePet (long? petId, string apiKey = null) + { + DeletePetWithHttpInfo(petId, apiKey); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "/pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddHeader("api_key", apiKey); // header parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + { + await DeletePetAsyncWithHttpInfo(petId, apiKey); + + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "/pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddHeader("api_key", apiKey); // header parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// List<Pet> + public List FindPetsByStatus (List status) + { + ApiResponse> localVarResponse = FindPetsByStatusWithHttpInfo(status); + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "/pet/findByStatus"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "status", status); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + { + ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "/pet/findByStatus"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "status", status); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + public List FindPetsByTags (List tags) + { + ApiResponse> localVarResponse = FindPetsByTagsWithHttpInfo(tags); + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "/pet/findByTags"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "tags", tags); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + { + ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "/pet/findByTags"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "tags", tags); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + public Pet GetPetById (long? petId) + { + ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "/pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + { + ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + return localVarResponse.Data; + + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "/pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void UpdatePet (Pet body) + { + UpdatePetWithHttpInfo(body); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public ApiResponse UpdatePetWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "/pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + { + await UpdatePetAsyncWithHttpInfo(body); + + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "/pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + public void UpdatePetWithForm (long? petId, string name = null, string status = null) + { + UpdatePetWithFormWithHttpInfo(petId, name, status); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "/pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("name", name); // form parameter + requestParameters.AddForm("status", status); // form parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + { + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "/pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("name", name); // form parameter + requestParameters.AddForm("status", status); // form parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "/pet/{petId}/uploadImage"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("additionalMetadata", additionalMetadata); // form parameter + //if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.Data; + + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "/pet/{petId}/uploadImage"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("additionalMetadata", additionalMetadata); // form parameter + //if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs new file mode 100644 index 00000000000..50c490c1afc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/StoreApi.cs @@ -0,0 +1,742 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + 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 + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteOrderWithHttpInfo (string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int?> + Dictionary GetInventory (); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int?> + ApiResponse> GetInventoryWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + Order GetOrderById (long? orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + Order PlaceOrder (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + ApiResponse PlaceOrderWithHttpInfo (Order body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of Dictionary<string, int?> + System.Threading.Tasks.Task> GetInventoryAsync (); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (Dictionary<string, int?>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of Order + System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StoreApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + public void DeleteOrder (string orderId) + { + DeleteOrderWithHttpInfo(orderId); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + public ApiResponse DeleteOrderWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "/store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + { + await DeleteOrderAsyncWithHttpInfo(orderId); + + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "/store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int?> + public Dictionary GetInventory () + { + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int?> + public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + { + + var localVarPath = "/store/inventory"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of Dictionary<string, int?> + public async System.Threading.Tasks.Task> GetInventoryAsync () + { + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (Dictionary<string, int?>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + { + + var localVarPath = "/store/inventory"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + public Order GetOrderById (long? orderId) + { + ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "/store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of Order + public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + { + ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + return localVarResponse.Data; + + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "/store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + public Order PlaceOrder (Order body) + { + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "/store/order"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + { + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "/store/order"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/UserApi.cs new file mode 100644 index 00000000000..1cb7f5ccddf --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Api/UserApi.cs @@ -0,0 +1,1390 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + void CreateUser (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + ApiResponse CreateUserWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithArrayInput (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithListInput (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + void DeleteUser (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteUserWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + User GetUserByName (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + ApiResponse GetUserByNameWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + string LoginUser (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + ApiResponse LoginUserWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + void LogoutUser (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + ApiResponse LogoutUserWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + void UpdateUser (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + ApiResponse UpdateUserWithHttpInfo (string username, User body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + System.Threading.Tasks.Task CreateUserAsync (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteUserAsync (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + System.Threading.Tasks.Task GetUserByNameAsync (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + System.Threading.Tasks.Task LoginUserAsync (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of void + System.Threading.Tasks.Task LogoutUserAsync (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public UserApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + public void CreateUser (User body) + { + CreateUserWithHttpInfo(body); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + public ApiResponse CreateUserWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "/user"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + public async System.Threading.Tasks.Task CreateUserAsync (User body) + { + await CreateUserAsyncWithHttpInfo(body); + + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "/user"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithArrayInput (List body) + { + CreateUsersWithArrayInputWithHttpInfo(body); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "/user/createWithArray"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + { + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "/user/createWithArray"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithListInput (List body) + { + CreateUsersWithListInputWithHttpInfo(body); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "/user/createWithList"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + { + await CreateUsersWithListInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "/user/createWithList"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + public void DeleteUser (string username) + { + DeleteUserWithHttpInfo(username); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + public ApiResponse DeleteUserWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "/user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteUserAsync (string username) + { + await DeleteUserAsyncWithHttpInfo(username); + + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "/user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + public User GetUserByName (string username) + { + ApiResponse localVarResponse = GetUserByNameWithHttpInfo(username); + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "/user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + { + ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + return localVarResponse.Data; + + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "/user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + public string LoginUser (string username, string password) + { + ApiResponse localVarResponse = LoginUserWithHttpInfo(username, password); + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "/user/login"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "username", username); // query parameter + requestParameters.AddQuery("", "password", password); // query parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + { + ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + return localVarResponse.Data; + + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "/user/login"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "username", username); // query parameter + requestParameters.AddQuery("", "password", password); // query parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// + public void LogoutUser () + { + LogoutUserWithHttpInfo(); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + public ApiResponse LogoutUserWithHttpInfo () + { + + var localVarPath = "/user/logout"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of void + public async System.Threading.Tasks.Task LogoutUserAsync () + { + await LogoutUserAsyncWithHttpInfo(); + + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + { + + var localVarPath = "/user/logout"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + public void UpdateUser (string username, User body) + { + UpdateUserWithHttpInfo(username, body); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + public ApiResponse UpdateUserWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "/user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + { + await UpdateUserAsyncWithHttpInfo(username, body); + + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "/user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs new file mode 100644 index 00000000000..c9a547926f4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs @@ -0,0 +1,429 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.IO; +using System.Web; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using System.Net.Http; + +namespace IO.Swagger.Client +{ + /// + /// API client is mainly responsible for making the HTTP call to the API backend. + /// + public partial class ApiClient : IDisposable + { + private JsonSerializerSettings serializerSettings = new JsonSerializerSettings + { + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(HttpRequestMessage request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(HttpRequestMessage request, HttpResponseMessage response, InterceptResult res); + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + public ApiClient() + : this((string)null) + {} + + /// + /// Initializes a new instance of the class + /// with default base path (http://petstore.swagger.io:80/v2). + /// + /// An instance of Configuration. + public ApiClient(Configuration config) + { + Configuration = config ?? IO.Swagger.Client.Configuration.Default; + + RestClient = ClientFactory(Configuration); + } + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + /// The base path. + public ApiClient(String basePath = "http://petstore.swagger.io:80/v2") + { + if (String.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + RestClient = ClientFactory(Configuration); + Configuration = Client.Configuration.Default; + } + + /// + /// may be overriden to customize client initialization + /// + public static Func ClientFactory = ClientFactoryDefault; + + static HttpClient ClientFactoryDefault(IReadableConfiguration config) + { + var res = new HttpClient + { + BaseAddress = new Uri(config.BasePath), + Timeout = TimeSpan.FromMilliseconds(config.Timeout), + }; + res.DefaultRequestHeaders.Add("User-Agent", config.UserAgent); + return res; + } + + /// + /// Gets or sets the default API client for making HTTP calls. + /// + /// The default API client. + [Obsolete("ApiClient.Default is deprecated, please use 'Configuration.Default.ApiClient' instead.")] + public static ApiClient Default; + + private bool disposedValue; + + /// + /// Gets or sets an instance of the IReadableConfiguration. + /// + /// An instance of the IReadableConfiguration. + /// + /// helps us to avoid modifying possibly global + /// configuration values from within a given client. It does not guarantee thread-safety + /// of the instance in any way. + /// + public IReadableConfiguration Configuration { get; set; } + + /// + /// Gets or sets the RestClient. + /// + /// An instance of the RestClient + public HttpClient RestClient { get; set; } + + // Creates and sets up a RestRequest prior to a call. + private HttpRequestMessage PrepareRequest(String path, HttpMethod method, RequestParameters parameters) + { + foreach (var pathParameter in parameters.pathParams) + path = path.Replace(string.Concat("{", pathParameter.Key, "}"), pathParameter.Value); + + var builder = new UriBuilder($"{Configuration.BasePath}/"); + builder.Path = builder.Path + path.TrimStart('/'); + builder.Query = parameters.GetQuery(); + + var address = builder.ToString(); + + var request = new HttpRequestMessage(method, address); + + // add header parameter, if any + foreach(var param in parameters.headerParams) + request.Headers.Add(param.Key, param.Value); + + // add form parameter, if any + foreach(var param in parameters.formParams) + request.Headers.Add(param.Key, param.Value); + + long contentLength = 0; + + if (parameters.postBody != null) // http body (model or byte[]) parameter + { + var stringBody = parameters.postBody as string; + var contentValue = stringBody != null + ? stringBody + : JsonConvert.SerializeObject(parameters.postBody); + var content = new StringContent(contentValue, Encoding.UTF8, parameters.contentType); + request.Content = content; //.(contentType, postBody, ParameterType.RequestBody); + + contentLength = contentValue.Length; + } + + return request; + } + + /// + /// Makes the HTTP request (Sync). + /// + /// URL path. + /// HTTP method. + /// Object + public HttpResponseMessage CallApi( + String path, HttpMethod method, RequestParameters parameters) + { + var request = PrepareRequest(path, method, parameters); + + InterceptRequest(request); + var res = new InterceptResult(); + var response = RestClient.SendAsync(request).Result; + InterceptResponse(request, response, res); + if (res.Retry) + { + request = PrepareRequest(path, method, parameters); //HttpClient requires to create new request message + response = RestClient.SendAsync(request).Result; + InterceptResponse(request, response, res); + } + + return response; + } + /// + /// Makes the asynchronous HTTP request. + /// + /// URL path. + /// HTTP method. + /// The Task instance. + public async System.Threading.Tasks.Task CallApiAsync( + String path, HttpMethod method, RequestParameters parameters) + { + var request = PrepareRequest(path, method, parameters); + InterceptRequest(request); + var res = new InterceptResult(); + var response = await RestClient.SendAsync(request); + InterceptResponse(request, response, res); + if (res.Retry) + { + request = PrepareRequest(path, method, parameters); //HttpClient requires to create new request message + response = await RestClient.SendAsync(request); + InterceptResponse(request, response, res); + } + return response; + } + + /// + /// Escape string (url-encoded). + /// + /// String to be escaped. + /// Escaped string. + public string EscapeString(string str) + { + return UrlEncode(str); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// + /// + /// + public T Deserialize(HttpResponseMessage response) + { + return (T)Deserialize(response, typeof(T)); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + public object Deserialize(HttpResponseMessage response, Type type) + { + var headers = response.Headers; + if (type == typeof(byte[])) // return byte array + { + return response.Content.ReadAsByteArrayAsync().Result; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + if (headers != null) + { + var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) + ? Path.GetTempPath() + : Configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) + { + var match = regex.Match(header.Value.First()); + if (match.Success) + { + string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, response.Content.ReadAsByteArrayAsync().Result); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(response.Content.ReadAsByteArrayAsync().Result); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content.ReadAsStringAsync().Result, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return ConvertType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result, type, serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + /// Encode string in base64 format. + /// + /// String to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Dynamically cast the object into target type. + /// + /// Object to be casted + /// Target type + /// Casted object + public static dynamic ConvertType(dynamic fromObject, Type toObject) + { + return Convert.ChangeType(fromObject, toObject); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + byte[] buf = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int count; + while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) + { + ms.Write(buf, 0, count); + } + return ms.ToArray(); + } + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// String to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + + if (match.Success) + { + return match.Groups[1].Value; + } + else + { + return filename; + } + } + + /// + /// disposing + /// + /// + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + RestClient.Dispose(); + } + + // TODO: free unmanaged resources (unmanaged objects) and override finalizer + // TODO: set large fields to null + disposedValue = true; + } + } + + /// + /// IDisposable implementation + /// + public void Dispose() + { + // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiException.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiException.cs new file mode 100644 index 00000000000..ce8ebad1d75 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiException.cs @@ -0,0 +1,62 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; + +namespace IO.Swagger.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public dynamic ErrorContent { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() {} + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base($"message ({errorCode})") + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + public ApiException(int errorCode, string message, dynamic errorContent = null) : base($"{message} ({errorCode})") + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + } + + public string Path { get; set; } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs new file mode 100644 index 00000000000..b21347aa408 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ApiResponse.cs @@ -0,0 +1,54 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; + +namespace IO.Swagger.Client +{ + /// + /// API Response + /// + public class ApiResponse + { + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public int StatusCode { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public IDictionary Headers { get; private set; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(int statusCode, IDictionary headers, T data) + { + this.StatusCode= statusCode; + this.Headers = headers; + this.Data = data; + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/Configuration.cs new file mode 100644 index 00000000000..a5b32549cd0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/Configuration.cs @@ -0,0 +1,452 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Reflection; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace IO.Swagger.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + private static readonly object GlobalConfigSync = new { }; + private static Configuration _globalConfiguration; + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + var message = response.Content?.ReadAsStringAsync()?.Result; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}", methodName), + message) + { Path = response.RequestMessage.RequestUri.ToString() }; + } + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, message), message) + { Path = response.RequestMessage.RequestUri.ToString() }; + } + return null; + }; + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static Configuration Default + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + + #endregion Static Members + + #region Private Members + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + private IDictionary _apiKey = null; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix = null; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + #endregion Private Members + + #region Constructors + + static Configuration() + { + _globalConfiguration = new GlobalConfiguration(); + } + + const string userAgentDefault = "Swagger-Codegen/1.0.0 csharp"; // space before csharp + + /// + /// Initializes a new instance of the class + /// + public Configuration() + { + UserAgent = userAgentDefault; + BasePath = "http://petstore.swagger.io:80/v2"; + DefaultHeader = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + public Configuration( + IDictionary defaultHeader, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://petstore.swagger.io:80/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeader == null) + throw new ArgumentNullException("defaultHeader"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeader) + { + DefaultHeader.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + /// + /// Initializes a new instance of the class with different settings + /// + /// Api client + /// Dictionary of default HTTP header + /// Username + /// Password + /// accessToken + /// Dictionary of API key + /// Dictionary of API key prefix + /// Temp folder path + /// DateTime format string + /// HTTP connection timeout (in milliseconds) + /// HTTP user agent + [Obsolete("Use explicit object construction and setting of properties.", true)] + public Configuration( + // ReSharper disable UnusedParameter.Local + ApiClient apiClient = null, + IDictionary defaultHeader = null, + string username = null, + string password = null, + string accessToken = null, + IDictionary apiKey = null, + IDictionary apiKeyPrefix = null, + string tempFolderPath = null, + string dateTimeFormat = null, + int timeout = 100000, + string userAgent = userAgentDefault + // ReSharper restore UnusedParameter.Local + ) + { + + } + + /// + /// Initializes a new instance of the Configuration class. + /// + /// Api client. + [Obsolete("This constructor caused unexpected sharing of static data. It is no longer supported.", true)] + // ReSharper disable once UnusedParameter.Local + public Configuration(ApiClient apiClient) + { + + } + + #endregion Constructors + + + #region Properties + + private ApiClient _apiClient = null; + /// + /// Gets an instance of an ApiClient for this configuration + /// + public virtual ApiClient ApiClient + { + get + { + if (_apiClient == null) _apiClient = CreateApiClient(); + return _apiClient; + } + } + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { get; set; } + + /// + /// Gets or sets the default header. + /// + public virtual IDictionary DefaultHeader { get; set; } + + int timeout; + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout + { + get { return timeout; } + set + { + timeout = System.Convert.ToInt32(value); + if (_apiClient != null) + ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(value); + } + } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + var apiKeyValue = ""; + ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) + return apiKeyPrefix + " " + apiKeyValue; + else + return apiKeyValue; + } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + // Possible breaking change since swagger-codegen 2.2.1, enforce a valid temporary path on set. + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + #endregion Properties + + #region Methods + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + public void AddDefaultHeader(string key, string value) + { + DefaultHeader[key] = value; + } + + /// + /// Creates a new based on this instance. + /// + /// + public ApiClient CreateApiClient() + { + return new ApiClient(this); + } + + /// + /// Returns a string with essential information for debugging. + /// + public static String ToDebugReport() + { + String report = "C# SDK (IO.Swagger) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ExceptionFactory.cs new file mode 100644 index 00000000000..ca3ad82e3fc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ExceptionFactory.cs @@ -0,0 +1,24 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Net.Http; + +namespace IO.Swagger.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, HttpResponseMessage response); +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/GlobalConfiguration.cs new file mode 100644 index 00000000000..d8b196fc3e8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/GlobalConfiguration.cs @@ -0,0 +1,34 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Reflection; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; + +namespace IO.Swagger.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .swagger-codegen-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs new file mode 100644 index 00000000000..395c6f14600 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/IApiAccessor.cs @@ -0,0 +1,41 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; + +namespace IO.Swagger.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + Configuration Configuration {get; set;} + + /// + /// Gets the base path of the API client. + /// + /// The base path + String GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/IReadableConfiguration.cs new file mode 100644 index 00000000000..32e87d6bd9a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/IReadableConfiguration.cs @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System.Collections.Generic; + +namespace IO.Swagger.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time foramt. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + IDictionary DefaultHeader { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/InterceptResult.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/InterceptResult.cs new file mode 100644 index 00000000000..29c4262c476 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/InterceptResult.cs @@ -0,0 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; + +namespace IO.Swagger.Client +{ + /// + /// allows interceptor to return some data to the + /// + class InterceptResult + { + /// + /// should it retry to send the request + /// + public bool Retry; + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/RequestParameters.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/RequestParameters.cs new file mode 100644 index 00000000000..79dd747f503 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/RequestParameters.cs @@ -0,0 +1,356 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Text.RegularExpressions; + +namespace IO.Swagger.Client +{ + /// + /// request parameters helper + /// + public class RequestParameters + { + private readonly IReadableConfiguration config; + + public List> queryParams { get; } + public Object postBody { get; set; } + public Dictionary headerParams { get; } + public Dictionary formParams { get; } + //public Dictionary fileParams; + public Dictionary pathParams { get; } + public String contentType { get; set; } + + ///// + ///// 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, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name)); + // else + // return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided"); + //} + + /// + /// initialized object instance + /// + /// configuration instance + /// allowed content types + /// accepted formats + public RequestParameters(IReadableConfiguration config, string[] contentTypes = null, string[] accepts = null) + { + this.pathParams = new Dictionary(); + this.formParams = new Dictionary(); + this.pathParams = new Dictionary(); + this.headerParams = new Dictionary(); + this.queryParams = new List>(); + this.config = config; + + // order matters + if (contentTypes != null) + this.contentType = SelectHeaderContentType(contentTypes); + if (accepts != null) + { + var localVarHttpHeaderAccept = SelectHeaderAccept(accepts); + if (localVarHttpHeaderAccept != null) + + AddHeader("Accept", localVarHttpHeaderAccept); + } + } + + /// + /// add path parameter value + /// + /// + /// + public void AddPath(string name, object value) + { + if (value != null) + pathParams.Add(name, ParameterToString(value)); + } + + /// + /// add header parameter value + /// + /// + /// + public void AddHeader(string name, object value) + { + if (value != null) + headerParams.Add(name, ParameterToString(value)); + } + + /// + /// add body parameter value + /// + /// + public void AddBody(object value) + { + if (value != null && value.GetType() != typeof(byte[])) + { + postBody = Serialize(value); // http body (model) parameter + } + else + { + postBody = value; // byte array + } + + } + + /// + /// add query parameter value + /// + /// + /// + /// + public void AddQuery(string format, string name, object value) + { + if (value != null) + queryParams.AddRange(ParameterToKeyValuePairs(format, name, value)); + } + + /// + /// add query parameter value + /// + /// + /// + public void AddQuery(string name, object value) + { + if (value != null) + queryParams.AddRange(ParameterToKeyValuePairs("", name, value)); + } + + /// + /// add form parameter value + /// + /// parameter name + /// parameter value + public void AddForm(string name, object value) + { + if (value != null) + formParams.Add(name, ParameterToString(value)); + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// "multi" of causes collection from to be set multiple times + /// Key name. + /// Value object. + /// A list of KeyValuePairs both key and value are encoded + public IEnumerable> ParameterToKeyValuePairs(string collectionFormat, string name, object value) + { + var parameters = new List>(); + + if (IsCollection(value) && collectionFormat == "multi") + { + var valueCollection = value as System.Collections.IEnumerable; + parameters.AddRange(from object item in valueCollection select new KeyValuePair(name, ParameterToString(item))); + } + else + { + parameters.Add(new KeyValuePair(name, ParameterToString(value))); + } + + return parameters; + } + + /// + /// Check if generic object is a collection. + /// + /// + /// True if object is a collection type + private static bool IsCollection(object value) + { + return value is System.Collections.IList || value is System.Collections.ICollection; + } + + /// + /// Serialize an input (model) 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); + } + } + + /// + /// concatenates query parameters from + /// + /// query string having encoded names and values + public string GetQuery() + { + var separator = "?"; + var sb = new StringBuilder(); // is it the best way on .Net Standard 1.6 ? + + foreach (var q in queryParams) + { + var key = Encode(q.Key); + var value = Encode(q.Value); + + sb.Append($"{separator}{key}={value}"); + separator = "&"; + } + return sb.ToString(); + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public String SelectHeaderContentType(String[] contentTypes) + { + if (contentTypes.Length == 0) + return "application/json"; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType.ToLower())) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// Formatted and encoded string. + public string ParameterToString(object obj) + { + if (obj is DateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTime)obj).ToString(config.DateTimeFormat); + else if (obj is DateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTimeOffset)obj).ToString(config.DateTimeFormat); + else if (obj is System.Collections.IList) + { + var flattenedString = new StringBuilder(); + foreach (var param in (System.Collections.IList)obj) + { + if (flattenedString.Length > 0) + flattenedString.Append(","); + flattenedString.Append(Convert.ToString(param, neutral)); + } + return flattenedString.ToString(); + } + else + return Convert.ToString(obj, neutral); + } + + static IFormatProvider neutral = System.Globalization.CultureInfo.InvariantCulture; + + string Encode(string value) + { + return System.Net.WebUtility.UrlEncode(value); + } + + public void AddAuthKeyInHeader(string keyParamName) + { + if (!String.IsNullOrEmpty(config.GetApiKeyWithPrefix(keyParamName))) + { + AddHeader(keyParamName, config.GetApiKeyWithPrefix(keyParamName)); + } + } + + public void AddAuthKeyInQuery(string keyParamName) + { + if (!String.IsNullOrEmpty(config.GetApiKeyWithPrefix(keyParamName))) + { + AddQuery("", keyParamName, config.GetApiKeyWithPrefix(keyParamName)); + } + } + + public void AddAuthBasic() + { + // http basic authentication required + if (!String.IsNullOrEmpty(config.Username) || !String.IsNullOrEmpty(config.Password)) + { + AddHeader("Authorization", "Basic " + ApiClient.Base64Encode(config.Username + ":" + config.Password)); + } + } + + public void AddAuthAccessToken() + { + // oauth required + if (!String.IsNullOrEmpty(config.AccessToken)) + { + AddHeader("Authorization", "Bearer " + config.AccessToken); + } + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ResponseExtension.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ResponseExtension.cs new file mode 100644 index 00000000000..9f542be0258 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/ResponseExtension.cs @@ -0,0 +1,33 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; + +namespace IO.Swagger.Client +{ + /// + /// HttpResponseMessage helper + /// + public static class ResponseExtension + { + /// + /// HttpResponseMessage headers to IDictionary convertion + /// + public static IDictionary ToHeaders(this HttpResponseMessage value) + { + return value.Headers.ToDictionary(x => x.Key, x => string.Join("", x.Value)); + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/SwaggerDateConverter.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/SwaggerDateConverter.cs new file mode 100644 index 00000000000..82b825423dc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Client/SwaggerDateConverter.cs @@ -0,0 +1,30 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Client +{ + /// + /// Formatter for 'date' swagger formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types + /// + public class SwaggerDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public SwaggerDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 00000000000..fa782ff6d69 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,73 @@ + + + + + + Debug + AnyCPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C} + Library + Properties + IO.Swagger + IO.Swagger + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/IO.Swagger.nuspec b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/IO.Swagger.nuspec new file mode 100644 index 00000000000..6e1d37c08b0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/IO.Swagger.nuspec @@ -0,0 +1,42 @@ + + + + + $id$ + Swagger Library + + + $version$ + + + $author$ + + + $author$ + false + false + + + A library generated from a Swagger doc + http://swagger.io/terms/ + http://www.apache.org/licenses/LICENSE-2.0.html + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..c9a5dbc1f1d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,140 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract] + public partial class AdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesClass); + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + if (input == null) + return false; + + return + ( + this.MapProperty == input.MapProperty || + this.MapProperty != null && + this.MapProperty.SequenceEqual(input.MapProperty) + ) && + ( + this.MapOfMapProperty == input.MapOfMapProperty || + this.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Animal.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Animal.cs new file mode 100644 index 00000000000..3c2f0134e36 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Animal.cs @@ -0,0 +1,175 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using JsonSubTypes; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Animal + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "className")] + [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + public partial class Animal : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() { } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = "red") + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new InvalidDataException("className is a required property for Animal and cannot be null"); + } + else + { + this.ClassName = className; + } + // use default value if no "color" provided + if (color == null) + { + this.Color = "red"; + } + else + { + this.Color = color; + } + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Animal); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + if (input == null) + return false; + + return + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ) && + ( + this.Color == input.Color || + (this.Color != null && + this.Color.Equals(input.Color)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + if (this.Color != null) + hashCode = hashCode * 59 + this.Color.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs new file mode 100644 index 00000000000..50767b53ec2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/AnimalFarm.cs @@ -0,0 +1,110 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// AnimalFarm + /// + [DataContract] + public partial class AnimalFarm : List, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public AnimalFarm() : base() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AnimalFarm {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AnimalFarm); + } + + /// + /// Returns true if AnimalFarm instances are equal + /// + /// Instance of AnimalFarm to be compared + /// Boolean + public bool Equals(AnimalFarm input) + { + if (input == null) + return false; + + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs new file mode 100644 index 00000000000..32a2d8a7153 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ApiResponse.cs @@ -0,0 +1,156 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ApiResponse + /// + [DataContract] + public partial class ApiResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=false)] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ApiResponse); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + if (input == null) + return false; + + return + ( + this.Code == input.Code || + (this.Code != null && + this.Code.Equals(input.Code)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Code != null) + hashCode = hashCode * 59 + this.Code.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.Message != null) + hashCode = hashCode * 59 + this.Message.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..5d868983b5d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract] + public partial class ArrayOfArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + if (input == null) + return false; + + return + ( + this.ArrayArrayNumber == input.ArrayArrayNumber || + this.ArrayArrayNumber != null && + this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..6f265e2889c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayOfNumberOnly.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract] + public partial class ArrayOfNumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] + public List ArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + if (input == null) + return false; + + return + ( + this.ArrayNumber == input.ArrayNumber || + this.ArrayNumber != null && + this.ArrayNumber.SequenceEqual(input.ArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs new file mode 100644 index 00000000000..5c214054576 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs @@ -0,0 +1,156 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayTest + /// + [DataContract] + public partial class ArrayTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name="array_of_string", EmitDefaultValue=false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name="array_array_of_model", EmitDefaultValue=false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayTest); + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + if (input == null) + return false; + + return + ( + this.ArrayOfString == input.ArrayOfString || + this.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(input.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == input.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + if (this.ArrayArrayOfInteger != null) + hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + if (this.ArrayArrayOfModel != null) + hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..cfe22cdee40 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,50 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Capitalization.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Capitalization.cs new file mode 100644 index 00000000000..f2512000b6d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Capitalization.cs @@ -0,0 +1,205 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Capitalization + /// + [DataContract] + public partial class Capitalization : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name="smallCamel", EmitDefaultValue=false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name="CapitalCamel", EmitDefaultValue=false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name="small_Snake", EmitDefaultValue=false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name="Capital_Snake", EmitDefaultValue=false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name="SCA_ETH_Flow_Points", EmitDefaultValue=false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name="ATT_NAME", EmitDefaultValue=false)] + public string ATT_NAME { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Capitalization); + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + if (input == null) + return false; + + return + ( + this.SmallCamel == input.SmallCamel || + (this.SmallCamel != null && + this.SmallCamel.Equals(input.SmallCamel)) + ) && + ( + this.CapitalCamel == input.CapitalCamel || + (this.CapitalCamel != null && + this.CapitalCamel.Equals(input.CapitalCamel)) + ) && + ( + this.SmallSnake == input.SmallSnake || + (this.SmallSnake != null && + this.SmallSnake.Equals(input.SmallSnake)) + ) && + ( + this.CapitalSnake == input.CapitalSnake || + (this.CapitalSnake != null && + this.CapitalSnake.Equals(input.CapitalSnake)) + ) && + ( + this.SCAETHFlowPoints == input.SCAETHFlowPoints || + (this.SCAETHFlowPoints != null && + this.SCAETHFlowPoints.Equals(input.SCAETHFlowPoints)) + ) && + ( + this.ATT_NAME == input.ATT_NAME || + (this.ATT_NAME != null && + this.ATT_NAME.Equals(input.ATT_NAME)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + if (this.CapitalCamel != null) + hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + if (this.SmallSnake != null) + hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + if (this.CapitalSnake != null) + hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + if (this.SCAETHFlowPoints != null) + hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + if (this.ATT_NAME != null) + hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Cat.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Cat.cs new file mode 100644 index 00000000000..bf0aedbb4eb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Cat.cs @@ -0,0 +1,131 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Cat + /// + [DataContract] + public partial class Cat : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() { } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public Cat(bool? declawed = default(bool?), string className = "Cat", string color = "red") : base(className, color) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Cat); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Category.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Category.cs new file mode 100644 index 00000000000..0e82265da50 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Category.cs @@ -0,0 +1,140 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Category + /// + [DataContract] + public partial class Category : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Category(long? id = default(long?), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Category); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs new file mode 100644 index 00000000000..aea6930a2c6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract] + public partial class ClassModel : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="_class", EmitDefaultValue=false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ClassModel); + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + if (input == null) + return false; + + return + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Dog.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Dog.cs new file mode 100644 index 00000000000..4705f66264d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Dog.cs @@ -0,0 +1,131 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Dog + /// + [DataContract] + public partial class Dog : Animal, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() { } + /// + /// Initializes a new instance of the class. + /// + /// breed. + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Dog); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumArrays.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumArrays.cs new file mode 100644 index 00000000000..2d5b4c88421 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumArrays.cs @@ -0,0 +1,181 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// EnumArrays + /// + [DataContract] + public partial class EnumArrays : IEquatable, IValidatableObject + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + } + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name="just_symbol", EmitDefaultValue=false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + } + + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name="array_enum", EmitDefaultValue=false)] + public List ArrayEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumArrays); + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + if (input == null) + return false; + + return + ( + this.JustSymbol == input.JustSymbol || + (this.JustSymbol != null && + this.JustSymbol.Equals(input.JustSymbol)) + ) && + ( + this.ArrayEnum == input.ArrayEnum || + this.ArrayEnum != null && + this.ArrayEnum.SequenceEqual(input.ArrayEnum) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.JustSymbol != null) + hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); + if (this.ArrayEnum != null) + hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs new file mode 100644 index 00000000000..6a3aab3d8c6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumClass.cs @@ -0,0 +1,55 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Defines EnumClass + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum EnumClass + { + + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs new file mode 100644 index 00000000000..0e0041b49e0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/EnumTest.cs @@ -0,0 +1,292 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// EnumTest + /// + [DataContract] + public partial class EnumTest : IEquatable, IValidatableObject + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + } + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name="enum_string", EmitDefaultValue=false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + } + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name="enum_string_required", EmitDefaultValue=false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + + /// + /// Enum NUMBER_1 for value: 1 + /// + + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + + NUMBER_MINUS_1 = -1 + } + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name="enum_integer", EmitDefaultValue=false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name="enum_number", EmitDefaultValue=false)] + public EnumNumberEnum? EnumNumber { get; set; } + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name="outerEnum", EmitDefaultValue=false)] + public OuterEnum? OuterEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() { } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumNumber. + /// outerEnum. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + { + // to ensure "enumStringRequired" is required (not null) + if (enumStringRequired == null) + { + throw new InvalidDataException("enumStringRequired is a required property for EnumTest and cannot be null"); + } + else + { + this.EnumStringRequired = enumStringRequired; + } + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + } + + + + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumTest); + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + if (input == null) + return false; + + return + ( + this.EnumString == input.EnumString || + (this.EnumString != null && + this.EnumString.Equals(input.EnumString)) + ) && + ( + this.EnumStringRequired == input.EnumStringRequired || + (this.EnumStringRequired != null && + this.EnumStringRequired.Equals(input.EnumStringRequired)) + ) && + ( + this.EnumInteger == input.EnumInteger || + (this.EnumInteger != null && + this.EnumInteger.Equals(input.EnumInteger)) + ) && + ( + this.EnumNumber == input.EnumNumber || + (this.EnumNumber != null && + this.EnumNumber.Equals(input.EnumNumber)) + ) && + ( + this.OuterEnum == input.OuterEnum || + (this.OuterEnum != null && + this.OuterEnum.Equals(input.OuterEnum)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnumString != null) + hashCode = hashCode * 59 + this.EnumString.GetHashCode(); + if (this.EnumStringRequired != null) + hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); + if (this.EnumInteger != null) + hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); + if (this.EnumNumber != null) + hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); + if (this.OuterEnum != null) + hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs new file mode 100644 index 00000000000..129677abb0f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs @@ -0,0 +1,433 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// FormatTest + /// + [DataContract] + public partial class FormatTest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() { } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// int64. + /// number (required). + /// _float. + /// _double. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), byte[] binary = default(byte[]), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + { + // to ensure "number" is required (not null) + if (number == null) + { + throw new InvalidDataException("number is a required property for FormatTest and cannot be null"); + } + else + { + this.Number = number; + } + // to ensure "_byte" is required (not null) + if (_byte == null) + { + throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null"); + } + else + { + this.Byte = _byte; + } + // to ensure "date" is required (not null) + if (date == null) + { + throw new InvalidDataException("date is a required property for FormatTest and cannot be null"); + } + else + { + this.Date = date; + } + // to ensure "password" is required (not null) + if (password == null) + { + throw new InvalidDataException("password is a required property for FormatTest and cannot be null"); + } + else + { + this.Password = password; + } + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.Double = _double; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name="integer", EmitDefaultValue=false)] + public int? Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name="int32", EmitDefaultValue=false)] + public int? Int32 { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name="int64", EmitDefaultValue=false)] + public long? Int64 { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name="number", EmitDefaultValue=false)] + public decimal? Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name="float", EmitDefaultValue=false)] + public float? Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name="double", EmitDefaultValue=false)] + public double? Double { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name="string", EmitDefaultValue=false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name="byte", EmitDefaultValue=false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name="binary", EmitDefaultValue=false)] + public byte[] Binary { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name="date", EmitDefaultValue=false)] + [JsonConverter(typeof(SwaggerDateConverter))] + public DateTime? Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime? DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid", EmitDefaultValue=false)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FormatTest); + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + if (input == null) + return false; + + return + ( + this.Integer == input.Integer || + (this.Integer != null && + this.Integer.Equals(input.Integer)) + ) && + ( + this.Int32 == input.Int32 || + (this.Int32 != null && + this.Int32.Equals(input.Int32)) + ) && + ( + this.Int64 == input.Int64 || + (this.Int64 != null && + this.Int64.Equals(input.Int64)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) + ) && + ( + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) + ) && + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ) && + ( + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) + ) && + ( + this.Binary == input.Binary || + (this.Binary != null && + this.Binary.Equals(input.Binary)) + ) && + ( + this.Date == input.Date || + (this.Date != null && + this.Date.Equals(input.Date)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Integer != null) + hashCode = hashCode * 59 + this.Integer.GetHashCode(); + if (this.Int32 != null) + hashCode = hashCode * 59 + this.Int32.GetHashCode(); + if (this.Int64 != null) + hashCode = hashCode * 59 + this.Int64.GetHashCode(); + if (this.Number != null) + hashCode = hashCode * 59 + this.Number.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); + if (this.Binary != null) + hashCode = hashCode * 59 + this.Binary.GetHashCode(); + if (this.Date != null) + hashCode = hashCode * 59 + this.Date.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Uuid != null) + hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Integer (int?) maximum + if(this.Integer > (int?)100) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int?) minimum + if(this.Integer < (int?)10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + // Int32 (int?) maximum + if(this.Int32 > (int?)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int?) minimum + if(this.Int32 < (int?)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Number (decimal?) maximum + if(this.Number > (decimal?)543.2) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal?) minimum + if(this.Number < (decimal?)32.1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Float (float?) maximum + if(this.Float > (float?)987.6) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float?) minimum + if(this.Float < (float?)54.3) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Double (double?) maximum + if(this.Double > (double?)123.4) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double?) minimum + if(this.Double < (double?)67.8) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + + // Password (string) maxLength + if(this.Password != null && this.Password.Length > 64) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if(this.Password != null && this.Password.Length < 10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..e0510de72db --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/HasOnlyReadOnly.cs @@ -0,0 +1,137 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract] + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { get; private set; } + + /// + /// Gets or Sets Foo + /// + [DataMember(Name="foo", EmitDefaultValue=false)] + public string Foo { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as HasOnlyReadOnly); + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Foo == input.Foo || + (this.Foo != null && + this.Foo.Equals(input.Foo)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + if (this.Foo != null) + hashCode = hashCode * 59 + this.Foo.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..e200097d011 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/List.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/List.cs new file mode 100644 index 00000000000..eb3f6dacfe2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/List.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// List + /// + [DataContract] + public partial class List : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _123List. + public List(string _123List = default(string)) + { + this._123List = _123List; + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name="123-list", EmitDefaultValue=false)] + public string _123List { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as List); + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + if (input == null) + return false; + + return + ( + this._123List == input._123List || + (this._123List != null && + this._123List.Equals(input._123List)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + hashCode = hashCode * 59 + this._123List.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/MapTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/MapTest.cs new file mode 100644 index 00000000000..6eb0ef0ee34 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/MapTest.cs @@ -0,0 +1,161 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// MapTest + /// + [DataContract] + public partial class MapTest : IEquatable, IValidatableObject + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + } + + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name="map_of_enum_string", EmitDefaultValue=false)] + public Dictionary MapOfEnumString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name="map_map_of_string", EmitDefaultValue=false)] + public Dictionary> MapMapOfString { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MapTest); + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + if (input == null) + return false; + + return + ( + this.MapMapOfString == input.MapMapOfString || + this.MapMapOfString != null && + this.MapMapOfString.SequenceEqual(input.MapMapOfString) + ) && + ( + this.MapOfEnumString == input.MapOfEnumString || + this.MapOfEnumString != null && + this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); + if (this.MapOfEnumString != null) + hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..9c84755b622 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,156 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + { + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid", EmitDefaultValue=false)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime? DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name="map", EmitDefaultValue=false)] + public Dictionary Map { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MixedPropertiesAndAdditionalPropertiesClass); + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + if (input == null) + return false; + + return + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Map == input.Map || + this.Map != null && + this.Map.SequenceEqual(input.Map) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Map != null) + hashCode = hashCode * 59 + this.Map.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs new file mode 100644 index 00000000000..7fccbdc1fce --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs @@ -0,0 +1,140 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract] + public partial class Model200Response : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int? name = default(int?), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public int? Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="class", EmitDefaultValue=false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Model200Response); + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs new file mode 100644 index 00000000000..aa02d34addc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ModelClient + /// + [DataContract] + public partial class ModelClient : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this.__Client = _client; + } + + /// + /// Gets or Sets __Client + /// + [DataMember(Name="client", EmitDefaultValue=false)] + public string __Client { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ModelClient); + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + if (input == null) + return false; + + return + ( + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Name.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Name.cs new file mode 100644 index 00000000000..1658622043b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Name.cs @@ -0,0 +1,181 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract] + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int? name = default(int?), string property = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Name and cannot be null"); + } + else + { + this._Name = name; + } + this.Property = property; + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public int? _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name="snake_case", EmitDefaultValue=false)] + public int? SnakeCase { get; private set; } + + /// + /// Gets or Sets Property + /// + [DataMember(Name="property", EmitDefaultValue=false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name="123Number", EmitDefaultValue=false)] + public int? _123Number { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Name); + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + if (input == null) + return false; + + return + ( + this._Name == input._Name || + (this._Name != null && + this._Name.Equals(input._Name)) + ) && + ( + this.SnakeCase == input.SnakeCase || + (this.SnakeCase != null && + this.SnakeCase.Equals(input.SnakeCase)) + ) && + ( + this.Property == input.Property || + (this.Property != null && + this.Property.Equals(input.Property)) + ) && + ( + this._123Number == input._123Number || + (this._123Number != null && + this._123Number.Equals(input._123Number)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Name != null) + hashCode = hashCode * 59 + this._Name.GetHashCode(); + if (this.SnakeCase != null) + hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + if (this.Property != null) + hashCode = hashCode * 59 + this.Property.GetHashCode(); + if (this._123Number != null) + hashCode = hashCode * 59 + this._123Number.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/NumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/NumberOnly.cs new file mode 100644 index 00000000000..33158907b92 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/NumberOnly.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// NumberOnly + /// + [DataContract] + public partial class NumberOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal? justNumber = default(decimal?)) + { + this.JustNumber = justNumber; + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name="JustNumber", EmitDefaultValue=false)] + public decimal? JustNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NumberOnly); + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + if (input == null) + return false; + + return + ( + this.JustNumber == input.JustNumber || + (this.JustNumber != null && + this.JustNumber.Equals(input.JustNumber)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.JustNumber != null) + hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..0f06cb4f9a8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,62 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Order.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Order.cs new file mode 100644 index 00000000000..2461d92147b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Order.cs @@ -0,0 +1,240 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Order + /// + [DataContract] + public partial class Order : IEquatable, IValidatableObject + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + // use default value if no "complete" provided + if (complete == null) + { + this.Complete = false; + } + else + { + this.Complete = complete; + } + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=false)] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=false)] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=false)] + public DateTime? ShipDate { get; set; } + + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=false)] + public bool? Complete { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Order); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.PetId == input.PetId || + (this.PetId != null && + this.PetId.Equals(input.PetId)) + ) && + ( + this.Quantity == input.Quantity || + (this.Quantity != null && + this.Quantity.Equals(input.Quantity)) + ) && + ( + this.ShipDate == input.ShipDate || + (this.ShipDate != null && + this.ShipDate.Equals(input.ShipDate)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ) && + ( + this.Complete == input.Complete || + (this.Complete != null && + this.Complete.Equals(input.Complete)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.PetId != null) + hashCode = hashCode * 59 + this.PetId.GetHashCode(); + if (this.Quantity != null) + hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + if (this.Complete != null) + hashCode = hashCode * 59 + this.Complete.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs new file mode 100644 index 00000000000..a848353fcde --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs @@ -0,0 +1,109 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterBoolean + /// + [DataContract] + public partial class OuterBoolean : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterBoolean() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterBoolean {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterBoolean); + } + + /// + /// Returns true if OuterBoolean instances are equal + /// + /// Instance of OuterBoolean to be compared + /// Boolean + public bool Equals(OuterBoolean input) + { + if (input == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs new file mode 100644 index 00000000000..e92aee48d81 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs @@ -0,0 +1,156 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterComposite + /// + [DataContract] + public partial class OuterComposite : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name="my_number", EmitDefaultValue=false)] + public decimal? MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name="my_string", EmitDefaultValue=false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name="my_boolean", EmitDefaultValue=false)] + public bool? MyBoolean { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + if (input == null) + return false; + + return + ( + this.MyNumber == input.MyNumber || + (this.MyNumber != null && + this.MyNumber.Equals(input.MyNumber)) + ) && + ( + this.MyString == input.MyString || + (this.MyString != null && + this.MyString.Equals(input.MyString)) + ) && + ( + this.MyBoolean == input.MyBoolean || + (this.MyBoolean != null && + this.MyBoolean.Equals(input.MyBoolean)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MyNumber != null) + hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + if (this.MyString != null) + hashCode = hashCode * 59 + this.MyString.GetHashCode(); + if (this.MyBoolean != null) + hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterEnum.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterEnum.cs new file mode 100644 index 00000000000..c18a44dab0c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterEnum.cs @@ -0,0 +1,55 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Defines OuterEnum + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnum + { + + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs new file mode 100644 index 00000000000..5b52454df7d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs @@ -0,0 +1,109 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterNumber + /// + [DataContract] + public partial class OuterNumber : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterNumber() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterNumber {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterNumber); + } + + /// + /// Returns true if OuterNumber instances are equal + /// + /// Instance of OuterNumber to be compared + /// Boolean + public bool Equals(OuterNumber input) + { + if (input == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterString.cs new file mode 100644 index 00000000000..9c025c0d38b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/OuterString.cs @@ -0,0 +1,109 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterString + /// + [DataContract] + public partial class OuterString : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterString() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterString {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterString); + } + + /// + /// Returns true if OuterString instances are equal + /// + /// Instance of OuterString to be compared + /// Boolean + public bool Equals(OuterString input) + { + if (input == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Pet.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Pet.cs new file mode 100644 index 00000000000..8cbe466db8f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Pet.cs @@ -0,0 +1,253 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Pet + /// + [DataContract] + public partial class Pet : IEquatable, IValidatableObject + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Pet and cannot be null"); + } + else + { + this.Name = name; + } + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) + { + throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null"); + } + else + { + this.PhotoUrls = photoUrls; + } + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Pet); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PhotoUrls == input.PhotoUrls || + this.PhotoUrls != null && + this.PhotoUrls.SequenceEqual(input.PhotoUrls) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Category != null) + hashCode = hashCode * 59 + this.Category.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.PhotoUrls != null) + hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..7dd0d142586 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/ReadOnlyFirst.cs @@ -0,0 +1,138 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract] + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { get; private set; } + + /// + /// Gets or Sets Baz + /// + [DataMember(Name="baz", EmitDefaultValue=false)] + public string Baz { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ReadOnlyFirst); + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Baz == input.Baz || + (this.Baz != null && + this.Baz.Equals(input.Baz)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + if (this.Baz != null) + hashCode = hashCode * 59 + this.Baz.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..0c2b3129633 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int? _return = default(int?)) + { + this._Return = _return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs new file mode 100644 index 00000000000..c8355cf7871 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/SpecialModelName.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// SpecialModelName + /// + [DataContract] + public partial class SpecialModelName : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + public SpecialModelName(long? specialPropertyName = default(long?)) + { + this.SpecialPropertyName = specialPropertyName; + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] + public long? SpecialPropertyName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SpecialModelName); + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + if (input == null) + return false; + + return + ( + this.SpecialPropertyName == input.SpecialPropertyName || + (this.SpecialPropertyName != null && + this.SpecialPropertyName.Equals(input.SpecialPropertyName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SpecialPropertyName != null) + hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Tag.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Tag.cs new file mode 100644 index 00000000000..535477cd98e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/Tag.cs @@ -0,0 +1,140 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Tag + /// + [DataContract] + public partial class Tag : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long? id = default(long?), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Tag); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/User.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/User.cs new file mode 100644 index 00000000000..a74e2de7260 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Model/User.cs @@ -0,0 +1,237 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// User + /// + [DataContract] + public partial class User : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=false)] + public int? UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as User); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Username == input.Username || + (this.Username != null && + this.Username.Equals(input.Username)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.Email == input.Email || + (this.Email != null && + this.Email.Equals(input.Email)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Phone == input.Phone || + (this.Phone != null && + this.Phone.Equals(input.Phone)) + ) && + ( + this.UserStatus == input.UserStatus || + (this.UserStatus != null && + this.UserStatus.Equals(input.UserStatus)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Username != null) + hashCode = hashCode * 59 + this.Username.GetHashCode(); + if (this.FirstName != null) + hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + if (this.LastName != null) + hashCode = hashCode * 59 + this.LastName.GetHashCode(); + if (this.Email != null) + hashCode = hashCode * 59 + this.Email.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Phone != null) + hashCode = hashCode * 59 + this.Phone.GetHashCode(); + if (this.UserStatus != null) + hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Properties/AssemblyInfo.cs b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..f3b9f7d1d14 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Swagger Library")] +[assembly: AssemblyDescription("A library generated from a Swagger doc")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Swagger")] +[assembly: AssemblyProduct("SwaggerLibrary")] +[assembly: AssemblyCopyright("No Copyright")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/packages.config b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/packages.config new file mode 100644 index 00000000000..9bad32ec00e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClient/src/IO.Swagger/packages.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.gitignore b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.gitignore new file mode 100644 index 00000000000..17302c93bf0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.gitignore @@ -0,0 +1,186 @@ +# Ref: https://gist.github.com/kmorcinek/2710267 +# Download this file using PowerShell v3 under Windows with the following comand +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore + +# User-specific files +*.suo +*.user +*.sln.docstates +./nuget + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# svn +.svn + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.swagger-codegen-ignore b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.swagger-codegen/VERSION b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.swagger-codegen/VERSION new file mode 100644 index 00000000000..0b155951995 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/IO.Swagger.sln b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/IO.Swagger.sln new file mode 100644 index 00000000000..c9af62874d3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/IO.Swagger.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30621.155 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{67035B31-F8E5-41A4-9673-954035084F7D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {67035B31-F8E5-41A4-9673-954035084F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67035B31-F8E5-41A4-9673-954035084F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67035B31-F8E5-41A4-9673-954035084F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67035B31-F8E5-41A4-9673-954035084F7D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5B3A8CD4-AF12-4E97-AD60-255350A57D6E} + EndGlobalSection +EndGlobal diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/README.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/README.md new file mode 100644 index 00000000000..69fc7849ebe --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/README.md @@ -0,0 +1,183 @@ +# IO.Swagger - the C# library for the Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: io.swagger.codegen.languages.CSharpClientCodegen + + +## Frameworks supported +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext +- UWP >=10.0 + + +## Dependencies +- FubarCoder.RestSharp.Portable.Core >=4.0.7 +- FubarCoder.RestSharp.Portable.HttpClient >=4.0.7 +- Newtonsoft.Json >=10.0.3 + + +## Installation +Generate the DLL using your preferred tool + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; +``` + +## Getting Started + +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class Example + { + public void main() + { + + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Model.Animal](docs/Animal.md) + - [Model.AnimalFarm](docs/AnimalFarm.md) + - [Model.ApiResponse](docs/ApiResponse.md) + - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) + - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) + - [Model.Category](docs/Category.md) + - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) + - [Model.EnumArrays](docs/EnumArrays.md) + - [Model.EnumClass](docs/EnumClass.md) + - [Model.EnumTest](docs/EnumTest.md) + - [Model.FormatTest](docs/FormatTest.md) + - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) + - [Model.List](docs/List.md) + - [Model.MapTest](docs/MapTest.md) + - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.Model200Response](docs/Model200Response.md) + - [Model.ModelClient](docs/ModelClient.md) + - [Model.Name](docs/Name.md) + - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) + - [Model.Order](docs/Order.md) + - [Model.OuterComposite](docs/OuterComposite.md) + - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.Pet](docs/Pet.md) + - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) + - [Model.SpecialModelName](docs/SpecialModelName.md) + - [Model.Tag](docs/Tag.md) + - [Model.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..ac4f9d10798 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AdditionalPropertiesClass.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.AdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Animal.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Animal.md new file mode 100644 index 00000000000..f461176159c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Animal.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Animal +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AnimalFarm.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AnimalFarm.md new file mode 100644 index 00000000000..4d1cccb0cef --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AnimalFarm.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.AnimalFarm +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..89bc406754a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/AnotherFakeApi.md @@ -0,0 +1,70 @@ +# IO.Swagger.Api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **TestSpecialTags** +> ModelClient TestSpecialTags (ModelClient body) + +To test special tags + +To test special tags + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestSpecialTagsExample + { + public void main() + { + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ApiResponse.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ApiResponse.md new file mode 100644 index 00000000000..3e4b4c5e9cb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ApiResponse.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ApiResponse +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int?** | | [optional] +**Type** | **string** | | [optional] +**Message** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..3431d89edd0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ArrayOfArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..9dc573663d6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal?>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayTest.md new file mode 100644 index 00000000000..37fb2788b77 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ArrayTest.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ArrayTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Boolean.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Capitalization.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Capitalization.md new file mode 100644 index 00000000000..87d14f03e0d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Capitalization.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Capitalization +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Cat.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Cat.md new file mode 100644 index 00000000000..a88425f4307 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Cat.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.Cat +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Category.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Category.md new file mode 100644 index 00000000000..20b56b1728c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Category.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Category +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ClassModel.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ClassModel.md new file mode 100644 index 00000000000..9bfd15db501 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ClassModel.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ClassModel +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Dog.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Dog.md new file mode 100644 index 00000000000..c3ee6d927b4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Dog.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.Dog +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumArrays.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumArrays.md new file mode 100644 index 00000000000..86fd208f8f8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumArrays.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.EnumArrays +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | **string** | | [optional] +**ArrayEnum** | **List<string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumClass.md new file mode 100644 index 00000000000..d936aad6f0b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumClass.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.EnumClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumTest.md new file mode 100644 index 00000000000..f3278be4cf3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/EnumTest.md @@ -0,0 +1,13 @@ +# IO.Swagger.Model.EnumTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int?** | | [optional] +**EnumNumber** | **double?** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FakeApi.md new file mode 100644 index 00000000000..490521457a0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FakeApi.md @@ -0,0 +1,660 @@ +# IO.Swagger.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data + + + +# **FakeOuterBooleanSerialize** +> bool? FakeOuterBooleanSerialize (OuterBoolean body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + + try + { + bool? result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +**bool?** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterNumberSerialize** +> decimal? FakeOuterNumberSerialize (OuterNumber body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + + try + { + decimal? result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +**decimal?** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (OuterString body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterString(); // OuterString | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User body, string query) + + + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new User(); // User | + var query = query_example; // string | + + try + { + apiInstance.TestBodyWithQueryParams(body, query); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| | + **query** | **string**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient body) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClientModelExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public void main() + { + // Configure HTTP basic authorization: http_basic_test + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(); + var number = 8.14; // decimal? | None + var _double = 1.2; // double? | None + var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None + var _byte = B; // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789; // long? | None (optional) + var _float = 3.4; // float? | None (optional) + var _string = _string_example; // string | None (optional) + var binary = B; // byte[] | None (optional) + var date = 2013-10-20; // DateTime? | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var password = password_example; // string | None (optional) + var callback = callback_example; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **decimal?**| None | + **_double** | **double?**| None | + **patternWithoutDelimiter** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **_string** | **string**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] + **password** | **string**| None | [optional] + **callback** | **string**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public void main() + { + var apiInstance = new FakeApi(); + var enumFormStringArray = enumFormStringArray_example; // List | Form parameter enum test (string array) (optional) + var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) + var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) + var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumFormStringArray** | **List<string>**| Form parameter enum test (string array) | [optional] + **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] + **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] + **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] + **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] + **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Object param) + +test inline additionalProperties + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public void main() + { + var apiInstance = new FakeApi(); + var param = ; // Object | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(param); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public void main() + { + var apiInstance = new FakeApi(); + var param = param_example; // string | field1 + var param2 = param2_example; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **string**| field1 | + **param2** | **string**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..0c972a86431 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FakeClassnameTags123Api.md @@ -0,0 +1,75 @@ +# IO.Swagger.Api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **TestClassname** +> ModelClient TestClassname (ModelClient body) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClassnameExample + { + public void main() + { + // Configure API key authorization: api_key_query + Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FormatTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FormatTest.md new file mode 100644 index 00000000000..1108a1af428 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/FormatTest.md @@ -0,0 +1,21 @@ +# IO.Swagger.Model.FormatTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int?** | | [optional] +**Int32** | **int?** | | [optional] +**Int64** | **long?** | | [optional] +**Number** | **decimal?** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **byte[]** | | [optional] +**Date** | **DateTime?** | | +**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid?** | | [optional] +**Password** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..cf0190498b9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/HasOnlyReadOnly.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.HasOnlyReadOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] +**Foo** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Ints.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/List.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/List.md new file mode 100644 index 00000000000..d7555b7e7ac --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/List.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.List +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/MapTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/MapTest.md new file mode 100644 index 00000000000..5c202aa336a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/MapTest.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.MapTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..e2c978f9ab1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.MixedPropertiesAndAdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid?** | | [optional] +**DateTime** | **DateTime?** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Model200Response.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Model200Response.md new file mode 100644 index 00000000000..62db21288f2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Model200Response.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Model200Response +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **int?** | | [optional] +**Class** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ModelClient.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ModelClient.md new file mode 100644 index 00000000000..c3817230640 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ModelClient.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ModelClient +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**__Client** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Name.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Name.md new file mode 100644 index 00000000000..678132c8e4e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Name.md @@ -0,0 +1,12 @@ +# IO.Swagger.Model.Name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int?** | | +**SnakeCase** | **int?** | | [optional] +**Property** | **string** | | [optional] +**_123Number** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/NumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/NumberOnly.md new file mode 100644 index 00000000000..a156dc4e2fc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/NumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.NumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Numbers.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Order.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Order.md new file mode 100644 index 00000000000..32aeab388e5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Order.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Order +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**PetId** | **long?** | | [optional] +**Quantity** | **int?** | | [optional] +**ShipDate** | **DateTime?** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool?** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/OuterComposite.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/OuterComposite.md new file mode 100644 index 00000000000..84714b7759e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/OuterComposite.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.OuterComposite +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/OuterEnum.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/OuterEnum.md new file mode 100644 index 00000000000..55eb118a349 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/OuterEnum.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterEnum +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Pet.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Pet.md new file mode 100644 index 00000000000..e83933d1c60 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Pet.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Pet +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Tags** | [**List<Tag>**](Tag.md) | | [optional] +**Status** | **string** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/PetApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/PetApi.md new file mode 100644 index 00000000000..4ba479f81d1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/PetApi.md @@ -0,0 +1,526 @@ +# IO.Swagger.Api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **AddPet** +> void AddPet (Pet body) + +Add a new pet to the store + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class AddPetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var body = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeletePet** +> void DeletePet (long? petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeletePetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | Pet id to delete + var apiKey = apiKey_example; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| Pet id to delete | + **apiKey** | **string**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByStatus** +> List FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var status = status_example; // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List<Pet> result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **List<string>**| Status values that need to be considered for filter | + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByTags** +> List FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List<Pet> result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetPetById** +> Pet GetPetById (long? petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public void main() + { + // Configure API key authorization: api_key + Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet body) + +Update an existing pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdatePetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var body = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long? petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet that needs to be updated + var name = name_example; // string | Updated name of the pet (optional) + var status = status_example; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet that needs to be updated | + **name** | **string**| Updated name of the pet | [optional] + **status** | **string**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + +uploads an image + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UploadFileExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet to update + var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to update | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..b5f8d484869 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/ReadOnlyFirst.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.ReadOnlyFirst +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] +**Baz** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Return.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/SpecialModelName.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/SpecialModelName.md new file mode 100644 index 00000000000..ee1bc316835 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/SpecialModelName.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.SpecialModelName +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/StoreApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/StoreApi.md new file mode 100644 index 00000000000..28e3fe59067 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/StoreApi.md @@ -0,0 +1,254 @@ +# IO.Swagger.Api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + + +# **DeleteOrder** +> 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 + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public void main() + { + var apiInstance = new StoreApi(); + var orderId = orderId_example; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **string**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetInventory** +> Dictionary GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetInventoryExample + { + public void main() + { + // Configure API key authorization: api_key + Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(); + + try + { + // Returns pet inventories by status + Dictionary<string, int?> result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetOrderById** +> Order GetOrderById (long? orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public void main() + { + var apiInstance = new StoreApi(); + var orderId = 789; // long? | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long?**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order body) + +Place an order for a pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public void main() + { + var apiInstance = new StoreApi(); + var body = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Tag.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Tag.md new file mode 100644 index 00000000000..64c5e6bdc72 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/Tag.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Tag +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/User.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/User.md new file mode 100644 index 00000000000..fbea33c48b9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/User.md @@ -0,0 +1,16 @@ +# IO.Swagger.Model.User +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int?** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/UserApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/UserApi.md new file mode 100644 index 00000000000..dfe89c60ab9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/docs/UserApi.md @@ -0,0 +1,488 @@ +# IO.Swagger.Api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user +[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +# **CreateUser** +> void CreateUser (User body) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List body) + +Creates list of users with given input array + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List body) + +Creates list of users with given input array + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeleteUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class LoginUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The user name for login + var password = password_example; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The user name for login | + **password** | **string**| The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class LogoutUserExample + { + public void main() + { + var apiInstance = new UserApi(); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateUser** +> void UpdateUser (string username, User body) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdateUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | name that need to be deleted + var body = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/git_push.sh b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/git_push.sh new file mode 100644 index 00000000000..160f6f21399 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..1aa18489fc3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/AnotherFakeApi.cs @@ -0,0 +1,287 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestSpecialTags (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestSpecialTagsWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public AnotherFakeApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestSpecialTags (ModelClient body) + { + ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "./another-fake/dummy"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "./another-fake/dummy"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs new file mode 100644 index 00000000000..ac868b8e03b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs @@ -0,0 +1,1898 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool? + bool? FakeOuterBooleanSerialize (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal? + decimal? FakeOuterNumberSerialize (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// string + string FakeOuterStringSerialize (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void TestBodyWithQueryParams (User body, string query); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithQueryParamsWithHttpInfo (User body, string query); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClientModel (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClientModelWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// ApiResponse of Object(void) + ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// + void TestInlineAdditionalProperties (Object param); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Object param); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + void TestJsonFormData (string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of bool? + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (bool?) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of decimal? + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (decimal?) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (User body, string query); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (User body, string query); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Task of void + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Object param); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Object param); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of void + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of ApiResponse + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool? + public bool? FakeOuterBooleanSerialize (OuterBoolean body = null) + { + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "./fake/outer/boolean"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of bool? + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + { + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (bool?) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "./fake/outer/boolean"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + { + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "./fake/outer/composite"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + { + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "./fake/outer/composite"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal? + public decimal? FakeOuterNumberSerialize (OuterNumber body = null) + { + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "./fake/outer/number"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of decimal? + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + { + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (decimal?) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "./fake/outer/number"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// string + public string FakeOuterStringSerialize (OuterString body = null) + { + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + { + + var localVarPath = "./fake/outer/string"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + { + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + { + + var localVarPath = "./fake/outer/string"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + public void TestBodyWithQueryParams (User body, string query) + { + TestBodyWithQueryParamsWithHttpInfo(body, query); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (User body, string query) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'query' is set + if (query == null) + throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + var localVarPath = "./fake/body-with-query-params"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "query", query); // query parameter + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (User body, string query) + { + await TestBodyWithQueryParamsAsyncWithHttpInfo(body, query); + + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (User body, string query) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'query' is set + if (query == null) + throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + var localVarPath = "./fake/body-with-query-params"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "query", query); // query parameter + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClientModel (ModelClient body) + { + ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "./fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "./fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "./fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("integer", integer); // form parameter + requestParameters.AddForm("int32", int32); // form parameter + requestParameters.AddForm("int64", int64); // form parameter + requestParameters.AddForm("number", number); // form parameter + requestParameters.AddForm("float", _float); // form parameter + requestParameters.AddForm("double", _double); // form parameter + requestParameters.AddForm("string", _string); // form parameter + requestParameters.AddForm("pattern_without_delimiter", patternWithoutDelimiter); // form parameter + requestParameters.AddForm("byte", _byte); // form parameter + requestParameters.AddForm("binary", binary); // form parameter + requestParameters.AddForm("date", date); // form parameter + requestParameters.AddForm("dateTime", dateTime); // form parameter + requestParameters.AddForm("password", password); // form parameter + requestParameters.AddForm("callback", callback); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + requestParameters.AddAuthBasic(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "./fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("integer", integer); // form parameter + requestParameters.AddForm("int32", int32); // form parameter + requestParameters.AddForm("int64", int64); // form parameter + requestParameters.AddForm("number", number); // form parameter + requestParameters.AddForm("float", _float); // form parameter + requestParameters.AddForm("double", _double); // form parameter + requestParameters.AddForm("string", _string); // form parameter + requestParameters.AddForm("pattern_without_delimiter", patternWithoutDelimiter); // form parameter + requestParameters.AddForm("byte", _byte); // form parameter + requestParameters.AddForm("binary", binary); // form parameter + requestParameters.AddForm("date", date); // form parameter + requestParameters.AddForm("dateTime", dateTime); // form parameter + requestParameters.AddForm("password", password); // form parameter + requestParameters.AddForm("callback", callback); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + requestParameters.AddAuthBasic(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + public void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + TestEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "./fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "*/*" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "enum_query_string_array", enumQueryStringArray); // query parameter + requestParameters.AddQuery("", "enum_query_string", enumQueryString); // query parameter + requestParameters.AddQuery("", "enum_query_integer", enumQueryInteger); // query parameter + requestParameters.AddHeader("enum_header_string_array", enumHeaderStringArray); // header parameter + requestParameters.AddHeader("enum_header_string", enumHeaderString); // header parameter + requestParameters.AddForm("enum_form_string_array", enumFormStringArray); // form parameter + requestParameters.AddForm("enum_form_string", enumFormString); // form parameter + requestParameters.AddForm("enum_query_double", enumQueryDouble); // form parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + await TestEnumParametersAsyncWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "./fake"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "*/*" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "enum_query_string_array", enumQueryStringArray); // query parameter + requestParameters.AddQuery("", "enum_query_string", enumQueryString); // query parameter + requestParameters.AddQuery("", "enum_query_integer", enumQueryInteger); // query parameter + requestParameters.AddHeader("enum_header_string_array", enumHeaderStringArray); // header parameter + requestParameters.AddHeader("enum_header_string", enumHeaderString); // header parameter + requestParameters.AddForm("enum_form_string_array", enumFormStringArray); // form parameter + requestParameters.AddForm("enum_form_string", enumFormString); // form parameter + requestParameters.AddForm("enum_query_double", enumQueryDouble); // form parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestInlineAdditionalProperties (Object param) + { + TestInlineAdditionalPropertiesWithHttpInfo(param); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Object param) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + + var localVarPath = "./fake/inline-additionalProperties"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(param); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Task of void + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Object param) + { + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Object param) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + + var localVarPath = "./fake/inline-additionalProperties"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(param); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + public void TestJsonFormData (string param, string param2) + { + TestJsonFormDataWithHttpInfo(param, param2); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + public ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + // verify the required parameter 'param2' is set + if (param2 == null) + throw new ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + var localVarPath = "./fake/jsonFormData"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("param", param); // form parameter + requestParameters.AddForm("param2", param2); // form parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestJsonFormData", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of void + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + { + await TestJsonFormDataAsyncWithHttpInfo(param, param2); + + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + // verify the required parameter 'param2' is set + if (param2 == null) + throw new ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + var localVarPath = "./fake/jsonFormData"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddForm("param", param); // form parameter + requestParameters.AddForm("param2", param2); // form parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestJsonFormData", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..f989dd664ee --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,291 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApiAccessor + { + #region Synchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClassname (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClassnameWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeClassnameTags123Api(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClassname (ModelClient body) + { + ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "./fake_classname_test"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + // authentication (api_key_query) required + requestParameters.AddAuthKeyInQuery("api_key_query"); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "./fake_classname_test"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + // authentication (api_key_query) required + requestParameters.AddAuthKeyInQuery("api_key_query"); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PATCH"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs new file mode 100644 index 00000000000..0a9f3b278a1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs @@ -0,0 +1,1484 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void AddPet (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse AddPetWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + void DeletePet (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// List<Pet> + List FindPetsByStatus (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByStatusWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + List FindPetsByTags (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByTagsWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + Pet GetPetById (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + ApiResponse GetPetByIdWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void UpdatePet (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + void UpdatePetWithForm (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task AddPetAsync (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task UpdatePetAsync (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public PetApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void AddPet (Pet body) + { + AddPetWithHttpInfo(body); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public ApiResponse AddPetWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "./pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task AddPetAsync (Pet body) + { + await AddPetAsyncWithHttpInfo(body); + + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "./pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + public void DeletePet (long? petId, string apiKey = null) + { + DeletePetWithHttpInfo(petId, apiKey); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "./pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddHeader("api_key", apiKey); // header parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + { + await DeletePetAsyncWithHttpInfo(petId, apiKey); + + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "./pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddHeader("api_key", apiKey); // header parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// List<Pet> + public List FindPetsByStatus (List status) + { + ApiResponse> localVarResponse = FindPetsByStatusWithHttpInfo(status); + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "./pet/findByStatus"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "status", status); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + { + ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "./pet/findByStatus"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "status", status); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + public List FindPetsByTags (List tags) + { + ApiResponse> localVarResponse = FindPetsByTagsWithHttpInfo(tags); + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "./pet/findByTags"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "tags", tags); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + { + ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "./pet/findByTags"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("csv", "tags", tags); // query parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + public Pet GetPetById (long? petId) + { + ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "./pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + { + ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + return localVarResponse.Data; + + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "./pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void UpdatePet (Pet body) + { + UpdatePetWithHttpInfo(body); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public ApiResponse UpdatePetWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "./pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + { + await UpdatePetAsyncWithHttpInfo(body); + + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "./pet"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + public void UpdatePetWithForm (long? petId, string name = null, string status = null) + { + UpdatePetWithFormWithHttpInfo(petId, name, status); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "./pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("name", name); // form parameter + requestParameters.AddForm("status", status); // form parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + { + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "./pet/{petId}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("name", name); // form parameter + requestParameters.AddForm("status", status); // form parameter + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "./pet/{petId}/uploadImage"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("additionalMetadata", additionalMetadata); // form parameter + //if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.Data; + + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "./pet/{petId}/uploadImage"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("petId", petId); // path parameter + requestParameters.AddForm("additionalMetadata", additionalMetadata); // form parameter + //if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); + + // authentication (petstore_auth) required + // oauth required + requestParameters.AddAuthAccessToken(); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs new file mode 100644 index 00000000000..29e48525ef9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs @@ -0,0 +1,742 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + 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 + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteOrderWithHttpInfo (string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int?> + Dictionary GetInventory (); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int?> + ApiResponse> GetInventoryWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + Order GetOrderById (long? orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + Order PlaceOrder (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + ApiResponse PlaceOrderWithHttpInfo (Order body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of Dictionary<string, int?> + System.Threading.Tasks.Task> GetInventoryAsync (); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (Dictionary<string, int?>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of Order + System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StoreApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + public void DeleteOrder (string orderId) + { + DeleteOrderWithHttpInfo(orderId); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + public ApiResponse DeleteOrderWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "./store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + { + await DeleteOrderAsyncWithHttpInfo(orderId); + + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "./store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int?> + public Dictionary GetInventory () + { + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int?> + public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + { + + var localVarPath = "./store/inventory"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of Dictionary<string, int?> + public async System.Threading.Tasks.Task> GetInventoryAsync () + { + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (Dictionary<string, int?>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + { + + var localVarPath = "./store/inventory"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + // authentication (api_key) required + requestParameters.AddAuthKeyInHeader("api_key"); + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize>(localVarResponse)); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + public Order GetOrderById (long? orderId) + { + ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "./store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of Order + public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + { + ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + return localVarResponse.Data; + + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "./store/order/{order_id}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("order_id", orderId); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + public Order PlaceOrder (Order body) + { + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "./store/order"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + { + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "./store/order"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs new file mode 100644 index 00000000000..7580f55be2b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs @@ -0,0 +1,1390 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net.Http; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + void CreateUser (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + ApiResponse CreateUserWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithArrayInput (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithListInput (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + void DeleteUser (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteUserWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + User GetUserByName (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + ApiResponse GetUserByNameWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + string LoginUser (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + ApiResponse LoginUserWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + void LogoutUser (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + ApiResponse LogoutUserWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + void UpdateUser (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + ApiResponse UpdateUserWithHttpInfo (string username, User body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + System.Threading.Tasks.Task CreateUserAsync (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteUserAsync (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + System.Threading.Tasks.Task GetUserByNameAsync (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + System.Threading.Tasks.Task LoginUserAsync (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of void + System.Threading.Tasks.Task LogoutUserAsync (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public UserApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + public void CreateUser (User body) + { + CreateUserWithHttpInfo(body); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + public ApiResponse CreateUserWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "./user"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + public async System.Threading.Tasks.Task CreateUserAsync (User body) + { + await CreateUserAsyncWithHttpInfo(body); + + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "./user"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithArrayInput (List body) + { + CreateUsersWithArrayInputWithHttpInfo(body); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "./user/createWithArray"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + { + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "./user/createWithArray"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithListInput (List body) + { + CreateUsersWithListInputWithHttpInfo(body); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "./user/createWithList"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + { + await CreateUsersWithListInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "./user/createWithList"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("POST"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + public void DeleteUser (string username) + { + DeleteUserWithHttpInfo(username); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + public ApiResponse DeleteUserWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "./user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteUserAsync (string username) + { + await DeleteUserAsyncWithHttpInfo(username); + + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "./user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("DELETE"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + public User GetUserByName (string username) + { + ApiResponse localVarResponse = GetUserByNameWithHttpInfo(username); + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "./user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + { + ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + return localVarResponse.Data; + + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "./user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + public string LoginUser (string username, string password) + { + ApiResponse localVarResponse = LoginUserWithHttpInfo(username, password); + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "./user/login"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "username", username); // query parameter + requestParameters.AddQuery("", "password", password); // query parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + { + ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + return localVarResponse.Data; + + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "./user/login"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddQuery("", "username", username); // query parameter + requestParameters.AddQuery("", "password", password); // query parameter + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + this.Configuration.ApiClient.Deserialize(localVarResponse)); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// + public void LogoutUser () + { + LogoutUserWithHttpInfo(); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + public ApiResponse LogoutUserWithHttpInfo () + { + + var localVarPath = "./user/logout"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of void + public async System.Threading.Tasks.Task LogoutUserAsync () + { + await LogoutUserAsyncWithHttpInfo(); + + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + { + + var localVarPath = "./user/logout"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("GET"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + public void UpdateUser (string username, User body) + { + UpdateUserWithHttpInfo(username, body); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + public ApiResponse UpdateUserWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "./user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + requestParameters.AddBody(body); // body parameter + + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + { + await UpdateUserAsyncWithHttpInfo(username, body); + + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "./user/{username}"; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + var requestParameters = new RequestParameters(Configuration, contentTypes: localVarHttpContentTypes, accepts: localVarHttpHeaderAccepts); + + requestParameters.AddPath("username", username); // path parameter + requestParameters.AddBody(body); + + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + new HttpMethod("PUT"), requestParameters); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.ToHeaders(), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs new file mode 100644 index 00000000000..a78dd8c42a4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs @@ -0,0 +1,431 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.IO; +using System.Linq; +using System.Text; +using Newtonsoft.Json; +using System.Net.Http; + +namespace IO.Swagger.Client +{ + /// + /// API client is mainly responsible for making the HTTP call to the API backend. + /// + public partial class ApiClient : IDisposable + { + private JsonSerializerSettings serializerSettings = new JsonSerializerSettings + { + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(HttpRequestMessage request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(HttpRequestMessage request, HttpResponseMessage response, InterceptResult res); + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + public ApiClient() + : this((string)null) + {} + + /// + /// Initializes a new instance of the class + /// with default base path (http://petstore.swagger.io:80/v2). + /// + /// An instance of Configuration. + public ApiClient(Configuration config) + { + Configuration = config ?? IO.Swagger.Client.Configuration.Default; + + RestClient = ClientFactory(Configuration); + //special http client adjustments + } + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + /// The base path. + public ApiClient(String basePath = "http://petstore.swagger.io:80/v2") + { + if (String.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + RestClient = ClientFactory(Configuration); + //special http client adjustments + Configuration = Client.Configuration.Default; + } + + /// + /// may be overriden to customize client initialization + /// + public static Func ClientFactory = ClientFactoryDefault; + + static HttpClient ClientFactoryDefault(IReadableConfiguration config) + { + var res = new HttpClient + { + BaseAddress = new Uri(config.BasePath), + Timeout = TimeSpan.FromMilliseconds(config.Timeout), + }; + res.DefaultRequestHeaders.Add("User-Agent", config.UserAgent); + return res; + } + + /// + /// Gets or sets the default API client for making HTTP calls. + /// + /// The default API client. + [Obsolete("ApiClient.Default is deprecated, please use 'Configuration.Default.ApiClient' instead.")] + public static ApiClient Default; + + private bool disposedValue; + + /// + /// Gets or sets an instance of the IReadableConfiguration. + /// + /// An instance of the IReadableConfiguration. + /// + /// helps us to avoid modifying possibly global + /// configuration values from within a given client. It does not guarantee thread-safety + /// of the instance in any way. + /// + public IReadableConfiguration Configuration { get; set; } + + /// + /// Gets or sets the RestClient. + /// + /// An instance of the RestClient + public HttpClient RestClient { get; set; } + + // Creates and sets up a RestRequest prior to a call. + private HttpRequestMessage PrepareRequest(String path, HttpMethod method, RequestParameters parameters) + { + foreach (var pathParameter in parameters.pathParams) + path = path.Replace(string.Concat("{", pathParameter.Key, "}"), pathParameter.Value); + + var builder = new UriBuilder($"{Configuration.BasePath}/"); + builder.Path = builder.Path + path.TrimStart('/'); + builder.Query = parameters.GetQuery(); + + var address = builder.ToString(); + + var request = new HttpRequestMessage(method, address); + //special http client adjustments + + // add header parameter, if any + foreach(var param in parameters.headerParams) + request.Headers.Add(param.Key, param.Value); + + // add form parameter, if any + foreach(var param in parameters.formParams) + request.Headers.Add(param.Key, param.Value); + + long contentLength = 0; + + if (parameters.postBody != null) // http body (model or byte[]) parameter + { + var stringBody = parameters.postBody as string; + var contentValue = stringBody != null + ? stringBody + : JsonConvert.SerializeObject(parameters.postBody); + var content = new StringContent(contentValue, Encoding.UTF8, parameters.contentType); + request.Content = content; //.(contentType, postBody, ParameterType.RequestBody); + + contentLength = contentValue.Length; + } + + return request; + } + + /// + /// Makes the HTTP request (Sync). + /// + /// URL path. + /// HTTP method. + /// Object + public HttpResponseMessage CallApi( + String path, HttpMethod method, RequestParameters parameters) + { + var request = PrepareRequest(path, method, parameters); + + InterceptRequest(request); + var res = new InterceptResult(); + var response = RestClient.SendAsync(request).Result; + InterceptResponse(request, response, res); + if (res.Retry) + { + request = PrepareRequest(path, method, parameters); //HttpClient requires to create new request message + response = RestClient.SendAsync(request).Result; + InterceptResponse(request, response, res); + } + + return response; + } + /// + /// Makes the asynchronous HTTP request. + /// + /// URL path. + /// HTTP method. + /// The Task instance. + public async System.Threading.Tasks.Task CallApiAsync( + String path, HttpMethod method, RequestParameters parameters) + { + var request = PrepareRequest(path, method, parameters); + InterceptRequest(request); + var res = new InterceptResult(); + var response = await RestClient.SendAsync(request); + InterceptResponse(request, response, res); + if (res.Retry) + { + request = PrepareRequest(path, method, parameters); //HttpClient requires to create new request message + response = await RestClient.SendAsync(request); + InterceptResponse(request, response, res); + } + return response; + } + + /// + /// Escape string (url-encoded). + /// + /// String to be escaped. + /// Escaped string. + public string EscapeString(string str) + { + return UrlEncode(str); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// + /// + /// + public T Deserialize(HttpResponseMessage response) + { + return (T)Deserialize(response, typeof(T)); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + public object Deserialize(HttpResponseMessage response, Type type) + { + var headers = response.Headers; + if (type == typeof(byte[])) // return byte array + { + return response.Content.ReadAsByteArrayAsync().Result; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + if (headers != null) + { + var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) + ? Path.GetTempPath() + : Configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) + { + var match = regex.Match(header.Value.First()); + if (match.Success) + { + string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, response.Content.ReadAsByteArrayAsync().Result); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(response.Content.ReadAsByteArrayAsync().Result); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content.ReadAsStringAsync().Result, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return ConvertType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result, type, serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + /// Encode string in base64 format. + /// + /// String to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Dynamically cast the object into target type. + /// + /// Object to be casted + /// Target type + /// Casted object + public static dynamic ConvertType(dynamic fromObject, Type toObject) + { + return Convert.ChangeType(fromObject, toObject); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + byte[] buf = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int count; + while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) + { + ms.Write(buf, 0, count); + } + return ms.ToArray(); + } + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// String to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + + if (match.Success) + { + return match.Groups[1].Value; + } + else + { + return filename; + } + } + + /// + /// disposing + /// + /// + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + RestClient.Dispose(); + } + + // TODO: free unmanaged resources (unmanaged objects) and override finalizer + // TODO: set large fields to null + disposedValue = true; + } + } + + /// + /// IDisposable implementation + /// + public void Dispose() + { + // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiException.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiException.cs new file mode 100644 index 00000000000..ce8ebad1d75 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiException.cs @@ -0,0 +1,62 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; + +namespace IO.Swagger.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public dynamic ErrorContent { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() {} + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base($"message ({errorCode})") + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + public ApiException(int errorCode, string message, dynamic errorContent = null) : base($"{message} ({errorCode})") + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + } + + public string Path { get; set; } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiResponse.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiResponse.cs new file mode 100644 index 00000000000..b21347aa408 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiResponse.cs @@ -0,0 +1,54 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; + +namespace IO.Swagger.Client +{ + /// + /// API Response + /// + public class ApiResponse + { + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public int StatusCode { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public IDictionary Headers { get; private set; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(int statusCode, IDictionary headers, T data) + { + this.StatusCode= statusCode; + this.Headers = headers; + this.Data = data; + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs new file mode 100644 index 00000000000..3d78b2e47f7 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs @@ -0,0 +1,446 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Reflection; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace IO.Swagger.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + private static readonly object GlobalConfigSync = new { }; + private static Configuration _globalConfiguration; + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + var message = response.Content?.ReadAsStringAsync()?.Result; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}", methodName), + message) + { Path = response.RequestMessage.RequestUri.ToString() }; + } + + return null; + }; + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static Configuration Default + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + + #endregion Static Members + + #region Private Members + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + private IDictionary _apiKey = null; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix = null; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + #endregion Private Members + + #region Constructors + + static Configuration() + { + _globalConfiguration = new GlobalConfiguration(); + } + + const string userAgentDefault = "Swagger-Codegen/1.0.0 csharp"; // space before csharp + + /// + /// Initializes a new instance of the class + /// + public Configuration() + { + UserAgent = userAgentDefault; + BasePath = "http://petstore.swagger.io:80/v2"; + DefaultHeader = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + public Configuration( + IDictionary defaultHeader, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://petstore.swagger.io:80/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeader == null) + throw new ArgumentNullException("defaultHeader"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeader) + { + DefaultHeader.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + /// + /// Initializes a new instance of the class with different settings + /// + /// Api client + /// Dictionary of default HTTP header + /// Username + /// Password + /// accessToken + /// Dictionary of API key + /// Dictionary of API key prefix + /// Temp folder path + /// DateTime format string + /// HTTP connection timeout (in milliseconds) + /// HTTP user agent + [Obsolete("Use explicit object construction and setting of properties.", true)] + public Configuration( + // ReSharper disable UnusedParameter.Local + ApiClient apiClient = null, + IDictionary defaultHeader = null, + string username = null, + string password = null, + string accessToken = null, + IDictionary apiKey = null, + IDictionary apiKeyPrefix = null, + string tempFolderPath = null, + string dateTimeFormat = null, + int timeout = 100000, + string userAgent = userAgentDefault + // ReSharper restore UnusedParameter.Local + ) + { + + } + + /// + /// Initializes a new instance of the Configuration class. + /// + /// Api client. + [Obsolete("This constructor caused unexpected sharing of static data. It is no longer supported.", true)] + // ReSharper disable once UnusedParameter.Local + public Configuration(ApiClient apiClient) + { + + } + + #endregion Constructors + + + #region Properties + + private ApiClient _apiClient = null; + /// + /// Gets an instance of an ApiClient for this configuration + /// + public virtual ApiClient ApiClient + { + get + { + if (_apiClient == null) _apiClient = CreateApiClient(); + return _apiClient; + } + } + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { get; set; } + + /// + /// Gets or sets the default header. + /// + public virtual IDictionary DefaultHeader { get; set; } + + int timeout; + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout + { + get { return timeout; } + set + { + timeout = System.Convert.ToInt32(value); + if (_apiClient != null) + ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(value); + } + } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + var apiKeyValue = ""; + ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) + return apiKeyPrefix + " " + apiKeyValue; + else + return apiKeyValue; + } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + // Possible breaking change since swagger-codegen 2.2.1, enforce a valid temporary path on set. + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + #endregion Properties + + #region Methods + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + public void AddDefaultHeader(string key, string value) + { + DefaultHeader[key] = value; + } + + /// + /// Creates a new based on this instance. + /// + /// + public ApiClient CreateApiClient() + { + return new ApiClient(this); + } + + /// + /// Returns a string with essential information for debugging. + /// + public static String ToDebugReport() + { + String report = "C# SDK (IO.Swagger) Debug Report:\n"; + report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ExceptionFactory.cs new file mode 100644 index 00000000000..ca3ad82e3fc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ExceptionFactory.cs @@ -0,0 +1,24 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Net.Http; + +namespace IO.Swagger.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, HttpResponseMessage response); +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/GlobalConfiguration.cs new file mode 100644 index 00000000000..d8b196fc3e8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/GlobalConfiguration.cs @@ -0,0 +1,34 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Reflection; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; + +namespace IO.Swagger.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .swagger-codegen-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/IApiAccessor.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/IApiAccessor.cs new file mode 100644 index 00000000000..395c6f14600 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/IApiAccessor.cs @@ -0,0 +1,41 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; + +namespace IO.Swagger.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + Configuration Configuration {get; set;} + + /// + /// Gets the base path of the API client. + /// + /// The base path + String GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/IReadableConfiguration.cs new file mode 100644 index 00000000000..32e87d6bd9a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/IReadableConfiguration.cs @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System.Collections.Generic; + +namespace IO.Swagger.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time foramt. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + IDictionary DefaultHeader { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/InterceptResult.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/InterceptResult.cs new file mode 100644 index 00000000000..29c4262c476 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/InterceptResult.cs @@ -0,0 +1,25 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; + +namespace IO.Swagger.Client +{ + /// + /// allows interceptor to return some data to the + /// + class InterceptResult + { + /// + /// should it retry to send the request + /// + public bool Retry; + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/RequestParameters.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/RequestParameters.cs new file mode 100644 index 00000000000..79dd747f503 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/RequestParameters.cs @@ -0,0 +1,356 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Text.RegularExpressions; + +namespace IO.Swagger.Client +{ + /// + /// request parameters helper + /// + public class RequestParameters + { + private readonly IReadableConfiguration config; + + public List> queryParams { get; } + public Object postBody { get; set; } + public Dictionary headerParams { get; } + public Dictionary formParams { get; } + //public Dictionary fileParams; + public Dictionary pathParams { get; } + public String contentType { get; set; } + + ///// + ///// 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, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name)); + // else + // return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided"); + //} + + /// + /// initialized object instance + /// + /// configuration instance + /// allowed content types + /// accepted formats + public RequestParameters(IReadableConfiguration config, string[] contentTypes = null, string[] accepts = null) + { + this.pathParams = new Dictionary(); + this.formParams = new Dictionary(); + this.pathParams = new Dictionary(); + this.headerParams = new Dictionary(); + this.queryParams = new List>(); + this.config = config; + + // order matters + if (contentTypes != null) + this.contentType = SelectHeaderContentType(contentTypes); + if (accepts != null) + { + var localVarHttpHeaderAccept = SelectHeaderAccept(accepts); + if (localVarHttpHeaderAccept != null) + + AddHeader("Accept", localVarHttpHeaderAccept); + } + } + + /// + /// add path parameter value + /// + /// + /// + public void AddPath(string name, object value) + { + if (value != null) + pathParams.Add(name, ParameterToString(value)); + } + + /// + /// add header parameter value + /// + /// + /// + public void AddHeader(string name, object value) + { + if (value != null) + headerParams.Add(name, ParameterToString(value)); + } + + /// + /// add body parameter value + /// + /// + public void AddBody(object value) + { + if (value != null && value.GetType() != typeof(byte[])) + { + postBody = Serialize(value); // http body (model) parameter + } + else + { + postBody = value; // byte array + } + + } + + /// + /// add query parameter value + /// + /// + /// + /// + public void AddQuery(string format, string name, object value) + { + if (value != null) + queryParams.AddRange(ParameterToKeyValuePairs(format, name, value)); + } + + /// + /// add query parameter value + /// + /// + /// + public void AddQuery(string name, object value) + { + if (value != null) + queryParams.AddRange(ParameterToKeyValuePairs("", name, value)); + } + + /// + /// add form parameter value + /// + /// parameter name + /// parameter value + public void AddForm(string name, object value) + { + if (value != null) + formParams.Add(name, ParameterToString(value)); + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// "multi" of causes collection from to be set multiple times + /// Key name. + /// Value object. + /// A list of KeyValuePairs both key and value are encoded + public IEnumerable> ParameterToKeyValuePairs(string collectionFormat, string name, object value) + { + var parameters = new List>(); + + if (IsCollection(value) && collectionFormat == "multi") + { + var valueCollection = value as System.Collections.IEnumerable; + parameters.AddRange(from object item in valueCollection select new KeyValuePair(name, ParameterToString(item))); + } + else + { + parameters.Add(new KeyValuePair(name, ParameterToString(value))); + } + + return parameters; + } + + /// + /// Check if generic object is a collection. + /// + /// + /// True if object is a collection type + private static bool IsCollection(object value) + { + return value is System.Collections.IList || value is System.Collections.ICollection; + } + + /// + /// Serialize an input (model) 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); + } + } + + /// + /// concatenates query parameters from + /// + /// query string having encoded names and values + public string GetQuery() + { + var separator = "?"; + var sb = new StringBuilder(); // is it the best way on .Net Standard 1.6 ? + + foreach (var q in queryParams) + { + var key = Encode(q.Key); + var value = Encode(q.Value); + + sb.Append($"{separator}{key}={value}"); + separator = "&"; + } + return sb.ToString(); + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public String SelectHeaderContentType(String[] contentTypes) + { + if (contentTypes.Length == 0) + return "application/json"; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType.ToLower())) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// Formatted and encoded string. + public string ParameterToString(object obj) + { + if (obj is DateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTime)obj).ToString(config.DateTimeFormat); + else if (obj is DateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTimeOffset)obj).ToString(config.DateTimeFormat); + else if (obj is System.Collections.IList) + { + var flattenedString = new StringBuilder(); + foreach (var param in (System.Collections.IList)obj) + { + if (flattenedString.Length > 0) + flattenedString.Append(","); + flattenedString.Append(Convert.ToString(param, neutral)); + } + return flattenedString.ToString(); + } + else + return Convert.ToString(obj, neutral); + } + + static IFormatProvider neutral = System.Globalization.CultureInfo.InvariantCulture; + + string Encode(string value) + { + return System.Net.WebUtility.UrlEncode(value); + } + + public void AddAuthKeyInHeader(string keyParamName) + { + if (!String.IsNullOrEmpty(config.GetApiKeyWithPrefix(keyParamName))) + { + AddHeader(keyParamName, config.GetApiKeyWithPrefix(keyParamName)); + } + } + + public void AddAuthKeyInQuery(string keyParamName) + { + if (!String.IsNullOrEmpty(config.GetApiKeyWithPrefix(keyParamName))) + { + AddQuery("", keyParamName, config.GetApiKeyWithPrefix(keyParamName)); + } + } + + public void AddAuthBasic() + { + // http basic authentication required + if (!String.IsNullOrEmpty(config.Username) || !String.IsNullOrEmpty(config.Password)) + { + AddHeader("Authorization", "Basic " + ApiClient.Base64Encode(config.Username + ":" + config.Password)); + } + } + + public void AddAuthAccessToken() + { + // oauth required + if (!String.IsNullOrEmpty(config.AccessToken)) + { + AddHeader("Authorization", "Bearer " + config.AccessToken); + } + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ResponseExtension.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ResponseExtension.cs new file mode 100644 index 00000000000..9f542be0258 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ResponseExtension.cs @@ -0,0 +1,33 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; + +namespace IO.Swagger.Client +{ + /// + /// HttpResponseMessage helper + /// + public static class ResponseExtension + { + /// + /// HttpResponseMessage headers to IDictionary convertion + /// + public static IDictionary ToHeaders(this HttpResponseMessage value) + { + return value.Headers.ToDictionary(x => x.Key, x => string.Join("", x.Value)); + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/SwaggerDateConverter.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/SwaggerDateConverter.cs new file mode 100644 index 00000000000..82b825423dc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Client/SwaggerDateConverter.cs @@ -0,0 +1,30 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Client +{ + /// + /// Formatter for 'date' swagger formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types + /// + public class SwaggerDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public SwaggerDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 00000000000..3c29973e67d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,28 @@ + + + + netstandard1.3 + IO.Swagger + IO.Swagger + Library + Swagger + Swagger + Swagger Library + A library generated from a Swagger doc + No Copyright + true + true + true + IO.Swagger + 1.0.0 + + + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..1a3bb3d1f69 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract] + public partial class AdditionalPropertiesClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesClass); + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + if (input == null) + return false; + + return + ( + this.MapProperty == input.MapProperty || + this.MapProperty != null && + this.MapProperty.SequenceEqual(input.MapProperty) + ) && + ( + this.MapOfMapProperty == input.MapOfMapProperty || + this.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Animal.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Animal.cs new file mode 100644 index 00000000000..7e3b397d2d5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Animal.cs @@ -0,0 +1,153 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using JsonSubTypes; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Animal + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "className")] + [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + public partial class Animal : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() { } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = "red") + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new InvalidDataException("className is a required property for Animal and cannot be null"); + } + else + { + this.ClassName = className; + } + // use default value if no "color" provided + if (color == null) + { + this.Color = "red"; + } + else + { + this.Color = color; + } + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Animal); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + if (input == null) + return false; + + return + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ) && + ( + this.Color == input.Color || + (this.Color != null && + this.Color.Equals(input.Color)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + if (this.Color != null) + hashCode = hashCode * 59 + this.Color.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/AnimalFarm.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/AnimalFarm.cs new file mode 100644 index 00000000000..29b66e92d25 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/AnimalFarm.cs @@ -0,0 +1,98 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// AnimalFarm + /// + [DataContract] + public partial class AnimalFarm : List, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public AnimalFarm() : base() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AnimalFarm {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AnimalFarm); + } + + /// + /// Returns true if AnimalFarm instances are equal + /// + /// Instance of AnimalFarm to be compared + /// Boolean + public bool Equals(AnimalFarm input) + { + if (input == null) + return false; + + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ApiResponse.cs new file mode 100644 index 00000000000..86a24a4b711 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ApiResponse.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ApiResponse + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=false)] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ApiResponse); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + if (input == null) + return false; + + return + ( + this.Code == input.Code || + (this.Code != null && + this.Code.Equals(input.Code)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Code != null) + hashCode = hashCode * 59 + this.Code.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.Message != null) + hashCode = hashCode * 59 + this.Message.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..d5f390edca7 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract] + public partial class ArrayOfArrayOfNumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + if (input == null) + return false; + + return + ( + this.ArrayArrayNumber == input.ArrayArrayNumber || + this.ArrayArrayNumber != null && + this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..2a19536618d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayOfNumberOnly.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract] + public partial class ArrayOfNumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] + public List ArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + if (input == null) + return false; + + return + ( + this.ArrayNumber == input.ArrayNumber || + this.ArrayNumber != null && + this.ArrayNumber.SequenceEqual(input.ArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayTest.cs new file mode 100644 index 00000000000..b3705a7d770 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ArrayTest.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayTest + /// + [DataContract] + public partial class ArrayTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name="array_of_string", EmitDefaultValue=false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name="array_array_of_model", EmitDefaultValue=false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayTest); + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + if (input == null) + return false; + + return + ( + this.ArrayOfString == input.ArrayOfString || + this.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(input.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == input.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + if (this.ArrayArrayOfInteger != null) + hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + if (this.ArrayArrayOfModel != null) + hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..d404aa0365d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,48 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Capitalization.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Capitalization.cs new file mode 100644 index 00000000000..7529b2a80c5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Capitalization.cs @@ -0,0 +1,193 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Capitalization + /// + [DataContract] + public partial class Capitalization : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name="smallCamel", EmitDefaultValue=false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name="CapitalCamel", EmitDefaultValue=false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name="small_Snake", EmitDefaultValue=false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name="Capital_Snake", EmitDefaultValue=false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name="SCA_ETH_Flow_Points", EmitDefaultValue=false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name="ATT_NAME", EmitDefaultValue=false)] + public string ATT_NAME { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Capitalization); + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + if (input == null) + return false; + + return + ( + this.SmallCamel == input.SmallCamel || + (this.SmallCamel != null && + this.SmallCamel.Equals(input.SmallCamel)) + ) && + ( + this.CapitalCamel == input.CapitalCamel || + (this.CapitalCamel != null && + this.CapitalCamel.Equals(input.CapitalCamel)) + ) && + ( + this.SmallSnake == input.SmallSnake || + (this.SmallSnake != null && + this.SmallSnake.Equals(input.SmallSnake)) + ) && + ( + this.CapitalSnake == input.CapitalSnake || + (this.CapitalSnake != null && + this.CapitalSnake.Equals(input.CapitalSnake)) + ) && + ( + this.SCAETHFlowPoints == input.SCAETHFlowPoints || + (this.SCAETHFlowPoints != null && + this.SCAETHFlowPoints.Equals(input.SCAETHFlowPoints)) + ) && + ( + this.ATT_NAME == input.ATT_NAME || + (this.ATT_NAME != null && + this.ATT_NAME.Equals(input.ATT_NAME)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + if (this.CapitalCamel != null) + hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + if (this.SmallSnake != null) + hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + if (this.CapitalSnake != null) + hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + if (this.SCAETHFlowPoints != null) + hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + if (this.ATT_NAME != null) + hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Cat.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Cat.cs new file mode 100644 index 00000000000..015746e47c4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Cat.cs @@ -0,0 +1,118 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Cat + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() { } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public Cat(bool? declawed = default(bool?), string className = "Cat", string color = "red") : base(className, color) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Cat); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Category.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Category.cs new file mode 100644 index 00000000000..bd820603f5c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Category.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Category + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Category(long? id = default(long?), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Category); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ClassModel.cs new file mode 100644 index 00000000000..9c01449fd88 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ClassModel.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract] + public partial class ClassModel : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="_class", EmitDefaultValue=false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ClassModel); + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + if (input == null) + return false; + + return + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Dog.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Dog.cs new file mode 100644 index 00000000000..07cb7d55fa1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Dog.cs @@ -0,0 +1,118 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Dog + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() { } + /// + /// Initializes a new instance of the class. + /// + /// breed. + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Dog); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumArrays.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumArrays.cs new file mode 100644 index 00000000000..0642bfe93ba --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumArrays.cs @@ -0,0 +1,169 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// EnumArrays + /// + [DataContract] + public partial class EnumArrays : IEquatable + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + } + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name="just_symbol", EmitDefaultValue=false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + } + + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name="array_enum", EmitDefaultValue=false)] + public List ArrayEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumArrays); + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + if (input == null) + return false; + + return + ( + this.JustSymbol == input.JustSymbol || + (this.JustSymbol != null && + this.JustSymbol.Equals(input.JustSymbol)) + ) && + ( + this.ArrayEnum == input.ArrayEnum || + this.ArrayEnum != null && + this.ArrayEnum.SequenceEqual(input.ArrayEnum) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.JustSymbol != null) + hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); + if (this.ArrayEnum != null) + hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumClass.cs new file mode 100644 index 00000000000..0b01aac7d4a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumClass.cs @@ -0,0 +1,53 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Defines EnumClass + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum EnumClass + { + + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumTest.cs new file mode 100644 index 00000000000..9669d139018 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/EnumTest.cs @@ -0,0 +1,280 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// EnumTest + /// + [DataContract] + public partial class EnumTest : IEquatable + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + } + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name="enum_string", EmitDefaultValue=false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + } + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name="enum_string_required", EmitDefaultValue=false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + + /// + /// Enum NUMBER_1 for value: 1 + /// + + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + + NUMBER_MINUS_1 = -1 + } + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name="enum_integer", EmitDefaultValue=false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name="enum_number", EmitDefaultValue=false)] + public EnumNumberEnum? EnumNumber { get; set; } + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name="outerEnum", EmitDefaultValue=false)] + public OuterEnum? OuterEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() { } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumNumber. + /// outerEnum. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + { + // to ensure "enumStringRequired" is required (not null) + if (enumStringRequired == null) + { + throw new InvalidDataException("enumStringRequired is a required property for EnumTest and cannot be null"); + } + else + { + this.EnumStringRequired = enumStringRequired; + } + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + } + + + + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumTest); + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + if (input == null) + return false; + + return + ( + this.EnumString == input.EnumString || + (this.EnumString != null && + this.EnumString.Equals(input.EnumString)) + ) && + ( + this.EnumStringRequired == input.EnumStringRequired || + (this.EnumStringRequired != null && + this.EnumStringRequired.Equals(input.EnumStringRequired)) + ) && + ( + this.EnumInteger == input.EnumInteger || + (this.EnumInteger != null && + this.EnumInteger.Equals(input.EnumInteger)) + ) && + ( + this.EnumNumber == input.EnumNumber || + (this.EnumNumber != null && + this.EnumNumber.Equals(input.EnumNumber)) + ) && + ( + this.OuterEnum == input.OuterEnum || + (this.OuterEnum != null && + this.OuterEnum.Equals(input.OuterEnum)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnumString != null) + hashCode = hashCode * 59 + this.EnumString.GetHashCode(); + if (this.EnumStringRequired != null) + hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); + if (this.EnumInteger != null) + hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); + if (this.EnumNumber != null) + hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); + if (this.OuterEnum != null) + hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/FormatTest.cs new file mode 100644 index 00000000000..d7af9916a9f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/FormatTest.cs @@ -0,0 +1,342 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// FormatTest + /// + [DataContract] + public partial class FormatTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() { } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// int64. + /// number (required). + /// _float. + /// _double. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), byte[] binary = default(byte[]), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + { + // to ensure "number" is required (not null) + if (number == null) + { + throw new InvalidDataException("number is a required property for FormatTest and cannot be null"); + } + else + { + this.Number = number; + } + // to ensure "_byte" is required (not null) + if (_byte == null) + { + throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null"); + } + else + { + this.Byte = _byte; + } + // to ensure "date" is required (not null) + if (date == null) + { + throw new InvalidDataException("date is a required property for FormatTest and cannot be null"); + } + else + { + this.Date = date; + } + // to ensure "password" is required (not null) + if (password == null) + { + throw new InvalidDataException("password is a required property for FormatTest and cannot be null"); + } + else + { + this.Password = password; + } + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.Double = _double; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name="integer", EmitDefaultValue=false)] + public int? Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name="int32", EmitDefaultValue=false)] + public int? Int32 { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name="int64", EmitDefaultValue=false)] + public long? Int64 { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name="number", EmitDefaultValue=false)] + public decimal? Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name="float", EmitDefaultValue=false)] + public float? Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name="double", EmitDefaultValue=false)] + public double? Double { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name="string", EmitDefaultValue=false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name="byte", EmitDefaultValue=false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name="binary", EmitDefaultValue=false)] + public byte[] Binary { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name="date", EmitDefaultValue=false)] + [JsonConverter(typeof(SwaggerDateConverter))] + public DateTime? Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime? DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid", EmitDefaultValue=false)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FormatTest); + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + if (input == null) + return false; + + return + ( + this.Integer == input.Integer || + (this.Integer != null && + this.Integer.Equals(input.Integer)) + ) && + ( + this.Int32 == input.Int32 || + (this.Int32 != null && + this.Int32.Equals(input.Int32)) + ) && + ( + this.Int64 == input.Int64 || + (this.Int64 != null && + this.Int64.Equals(input.Int64)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) + ) && + ( + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) + ) && + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ) && + ( + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) + ) && + ( + this.Binary == input.Binary || + (this.Binary != null && + this.Binary.Equals(input.Binary)) + ) && + ( + this.Date == input.Date || + (this.Date != null && + this.Date.Equals(input.Date)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Integer != null) + hashCode = hashCode * 59 + this.Integer.GetHashCode(); + if (this.Int32 != null) + hashCode = hashCode * 59 + this.Int32.GetHashCode(); + if (this.Int64 != null) + hashCode = hashCode * 59 + this.Int64.GetHashCode(); + if (this.Number != null) + hashCode = hashCode * 59 + this.Number.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); + if (this.Binary != null) + hashCode = hashCode * 59 + this.Binary.GetHashCode(); + if (this.Date != null) + hashCode = hashCode * 59 + this.Date.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Uuid != null) + hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..e19333c9aff --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/HasOnlyReadOnly.cs @@ -0,0 +1,125 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract] + public partial class HasOnlyReadOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { get; private set; } + + /// + /// Gets or Sets Foo + /// + [DataMember(Name="foo", EmitDefaultValue=false)] + public string Foo { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as HasOnlyReadOnly); + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Foo == input.Foo || + (this.Foo != null && + this.Foo.Equals(input.Foo)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + if (this.Foo != null) + hashCode = hashCode * 59 + this.Foo.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..701fd9030b2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/List.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/List.cs new file mode 100644 index 00000000000..8e584d1d945 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/List.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// List + /// + [DataContract] + public partial class List : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _123List. + public List(string _123List = default(string)) + { + this._123List = _123List; + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name="123-list", EmitDefaultValue=false)] + public string _123List { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as List); + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + if (input == null) + return false; + + return + ( + this._123List == input._123List || + (this._123List != null && + this._123List.Equals(input._123List)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + hashCode = hashCode * 59 + this._123List.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/MapTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/MapTest.cs new file mode 100644 index 00000000000..598f2309c81 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/MapTest.cs @@ -0,0 +1,149 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// MapTest + /// + [DataContract] + public partial class MapTest : IEquatable + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + } + + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name="map_of_enum_string", EmitDefaultValue=false)] + public Dictionary MapOfEnumString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name="map_map_of_string", EmitDefaultValue=false)] + public Dictionary> MapMapOfString { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MapTest); + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + if (input == null) + return false; + + return + ( + this.MapMapOfString == input.MapMapOfString || + this.MapMapOfString != null && + this.MapMapOfString.SequenceEqual(input.MapMapOfString) + ) && + ( + this.MapOfEnumString == input.MapOfEnumString || + this.MapOfEnumString != null && + this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); + if (this.MapOfEnumString != null) + hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..b3ee6f35e6c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + { + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid", EmitDefaultValue=false)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime? DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name="map", EmitDefaultValue=false)] + public Dictionary Map { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MixedPropertiesAndAdditionalPropertiesClass); + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + if (input == null) + return false; + + return + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Map == input.Map || + this.Map != null && + this.Map.SequenceEqual(input.Map) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Map != null) + hashCode = hashCode * 59 + this.Map.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Model200Response.cs new file mode 100644 index 00000000000..3bf31b5e40f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Model200Response.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract] + public partial class Model200Response : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int? name = default(int?), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public int? Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="class", EmitDefaultValue=false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Model200Response); + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ModelClient.cs new file mode 100644 index 00000000000..909c4ead55a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ModelClient.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ModelClient + /// + [DataContract] + public partial class ModelClient : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this.__Client = _client; + } + + /// + /// Gets or Sets __Client + /// + [DataMember(Name="client", EmitDefaultValue=false)] + public string __Client { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ModelClient); + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + if (input == null) + return false; + + return + ( + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Name.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Name.cs new file mode 100644 index 00000000000..414ed11b7a3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Name.cs @@ -0,0 +1,169 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract] + public partial class Name : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int? name = default(int?), string property = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Name and cannot be null"); + } + else + { + this._Name = name; + } + this.Property = property; + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public int? _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name="snake_case", EmitDefaultValue=false)] + public int? SnakeCase { get; private set; } + + /// + /// Gets or Sets Property + /// + [DataMember(Name="property", EmitDefaultValue=false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name="123Number", EmitDefaultValue=false)] + public int? _123Number { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Name); + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + if (input == null) + return false; + + return + ( + this._Name == input._Name || + (this._Name != null && + this._Name.Equals(input._Name)) + ) && + ( + this.SnakeCase == input.SnakeCase || + (this.SnakeCase != null && + this.SnakeCase.Equals(input.SnakeCase)) + ) && + ( + this.Property == input.Property || + (this.Property != null && + this.Property.Equals(input.Property)) + ) && + ( + this._123Number == input._123Number || + (this._123Number != null && + this._123Number.Equals(input._123Number)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Name != null) + hashCode = hashCode * 59 + this._Name.GetHashCode(); + if (this.SnakeCase != null) + hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + if (this.Property != null) + hashCode = hashCode * 59 + this.Property.GetHashCode(); + if (this._123Number != null) + hashCode = hashCode * 59 + this._123Number.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/NumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/NumberOnly.cs new file mode 100644 index 00000000000..05958dc3fd4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/NumberOnly.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// NumberOnly + /// + [DataContract] + public partial class NumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal? justNumber = default(decimal?)) + { + this.JustNumber = justNumber; + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name="JustNumber", EmitDefaultValue=false)] + public decimal? JustNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NumberOnly); + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + if (input == null) + return false; + + return + ( + this.JustNumber == input.JustNumber || + (this.JustNumber != null && + this.JustNumber.Equals(input.JustNumber)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.JustNumber != null) + hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..b5167fbd27e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Order.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Order.cs new file mode 100644 index 00000000000..7f0ae101aa4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Order.cs @@ -0,0 +1,228 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Order + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + // use default value if no "complete" provided + if (complete == null) + { + this.Complete = false; + } + else + { + this.Complete = complete; + } + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=false)] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=false)] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=false)] + public DateTime? ShipDate { get; set; } + + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=false)] + public bool? Complete { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Order); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.PetId == input.PetId || + (this.PetId != null && + this.PetId.Equals(input.PetId)) + ) && + ( + this.Quantity == input.Quantity || + (this.Quantity != null && + this.Quantity.Equals(input.Quantity)) + ) && + ( + this.ShipDate == input.ShipDate || + (this.ShipDate != null && + this.ShipDate.Equals(input.ShipDate)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ) && + ( + this.Complete == input.Complete || + (this.Complete != null && + this.Complete.Equals(input.Complete)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.PetId != null) + hashCode = hashCode * 59 + this.PetId.GetHashCode(); + if (this.Quantity != null) + hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + if (this.Complete != null) + hashCode = hashCode * 59 + this.Complete.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterBoolean.cs new file mode 100644 index 00000000000..a848353fcde --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterBoolean.cs @@ -0,0 +1,109 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterBoolean + /// + [DataContract] + public partial class OuterBoolean : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterBoolean() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterBoolean {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterBoolean); + } + + /// + /// Returns true if OuterBoolean instances are equal + /// + /// Instance of OuterBoolean to be compared + /// Boolean + public bool Equals(OuterBoolean input) + { + if (input == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs new file mode 100644 index 00000000000..824de8cf988 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterComposite + /// + [DataContract] + public partial class OuterComposite : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name="my_number", EmitDefaultValue=false)] + public decimal? MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name="my_string", EmitDefaultValue=false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name="my_boolean", EmitDefaultValue=false)] + public bool? MyBoolean { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + if (input == null) + return false; + + return + ( + this.MyNumber == input.MyNumber || + (this.MyNumber != null && + this.MyNumber.Equals(input.MyNumber)) + ) && + ( + this.MyString == input.MyString || + (this.MyString != null && + this.MyString.Equals(input.MyString)) + ) && + ( + this.MyBoolean == input.MyBoolean || + (this.MyBoolean != null && + this.MyBoolean.Equals(input.MyBoolean)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MyNumber != null) + hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + if (this.MyString != null) + hashCode = hashCode * 59 + this.MyString.GetHashCode(); + if (this.MyBoolean != null) + hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterEnum.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterEnum.cs new file mode 100644 index 00000000000..44466ce5ba0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterEnum.cs @@ -0,0 +1,53 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Defines OuterEnum + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnum + { + + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterNumber.cs new file mode 100644 index 00000000000..5b52454df7d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterNumber.cs @@ -0,0 +1,109 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterNumber + /// + [DataContract] + public partial class OuterNumber : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterNumber() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterNumber {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterNumber); + } + + /// + /// Returns true if OuterNumber instances are equal + /// + /// Instance of OuterNumber to be compared + /// Boolean + public bool Equals(OuterNumber input) + { + if (input == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterString.cs new file mode 100644 index 00000000000..9c025c0d38b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterString.cs @@ -0,0 +1,109 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterString + /// + [DataContract] + public partial class OuterString : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterString() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterString {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterString); + } + + /// + /// Returns true if OuterString instances are equal + /// + /// Instance of OuterString to be compared + /// Boolean + public bool Equals(OuterString input) + { + if (input == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Pet.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Pet.cs new file mode 100644 index 00000000000..4d41431009a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Pet.cs @@ -0,0 +1,241 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Pet + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Pet and cannot be null"); + } + else + { + this.Name = name; + } + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) + { + throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null"); + } + else + { + this.PhotoUrls = photoUrls; + } + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Pet); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PhotoUrls == input.PhotoUrls || + this.PhotoUrls != null && + this.PhotoUrls.SequenceEqual(input.PhotoUrls) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Category != null) + hashCode = hashCode * 59 + this.Category.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.PhotoUrls != null) + hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..e2e49cce78f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ReadOnlyFirst.cs @@ -0,0 +1,126 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract] + public partial class ReadOnlyFirst : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { get; private set; } + + /// + /// Gets or Sets Baz + /// + [DataMember(Name="baz", EmitDefaultValue=false)] + public string Baz { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ReadOnlyFirst); + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Baz == input.Baz || + (this.Baz != null && + this.Baz.Equals(input.Baz)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + if (this.Baz != null) + hashCode = hashCode * 59 + this.Baz.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..e2a3377dd3b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int? _return = default(int?)) + { + this._Return = _return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/SpecialModelName.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/SpecialModelName.cs new file mode 100644 index 00000000000..d18791b0f91 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/SpecialModelName.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// SpecialModelName + /// + [DataContract] + public partial class SpecialModelName : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + public SpecialModelName(long? specialPropertyName = default(long?)) + { + this.SpecialPropertyName = specialPropertyName; + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] + public long? SpecialPropertyName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SpecialModelName); + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + if (input == null) + return false; + + return + ( + this.SpecialPropertyName == input.SpecialPropertyName || + (this.SpecialPropertyName != null && + this.SpecialPropertyName.Equals(input.SpecialPropertyName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SpecialPropertyName != null) + hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Tag.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Tag.cs new file mode 100644 index 00000000000..0c25af135a7 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Tag.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Tag + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long? id = default(long?), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Tag); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/User.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/User.cs new file mode 100644 index 00000000000..6c5fb9fb311 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetCoreProject/src/IO.Swagger/Model/User.cs @@ -0,0 +1,225 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// User + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=false)] + public int? UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as User); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Username == input.Username || + (this.Username != null && + this.Username.Equals(input.Username)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.Email == input.Email || + (this.Email != null && + this.Email.Equals(input.Email)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Phone == input.Phone || + (this.Phone != null && + this.Phone.Equals(input.Phone)) + ) && + ( + this.UserStatus == input.UserStatus || + (this.UserStatus != null && + this.UserStatus.Equals(input.UserStatus)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Username != null) + hashCode = hashCode * 59 + this.Username.GetHashCode(); + if (this.FirstName != null) + hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + if (this.LastName != null) + hashCode = hashCode * 59 + this.LastName.GetHashCode(); + if (this.Email != null) + hashCode = hashCode * 59 + this.Email.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Phone != null) + hashCode = hashCode * 59 + this.Phone.GetHashCode(); + if (this.UserStatus != null) + hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.gitignore b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.gitignore new file mode 100644 index 00000000000..17302c93bf0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.gitignore @@ -0,0 +1,186 @@ +# Ref: https://gist.github.com/kmorcinek/2710267 +# Download this file using PowerShell v3 under Windows with the following comand +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore + +# User-specific files +*.suo +*.user +*.sln.docstates +./nuget + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# svn +.svn + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.swagger-codegen-ignore b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.swagger-codegen/VERSION b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.swagger-codegen/VERSION new file mode 100644 index 00000000000..0b155951995 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/IO.Swagger.sln b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/IO.Swagger.sln new file mode 100644 index 00000000000..0280476fafc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/IO.Swagger.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{3AB1F259-1769-484B-9411-84505FCCBD55}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3AB1F259-1769-484B-9411-84505FCCBD55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3AB1F259-1769-484B-9411-84505FCCBD55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3AB1F259-1769-484B-9411-84505FCCBD55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3AB1F259-1769-484B-9411-84505FCCBD55}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/README.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/README.md new file mode 100644 index 00000000000..69fc7849ebe --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/README.md @@ -0,0 +1,183 @@ +# IO.Swagger - the C# library for the Swagger Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: io.swagger.codegen.languages.CSharpClientCodegen + + +## Frameworks supported +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext +- UWP >=10.0 + + +## Dependencies +- FubarCoder.RestSharp.Portable.Core >=4.0.7 +- FubarCoder.RestSharp.Portable.HttpClient >=4.0.7 +- Newtonsoft.Json >=10.0.3 + + +## Installation +Generate the DLL using your preferred tool + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; +``` + +## Getting Started + +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class Example + { + public void main() + { + + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Model.Animal](docs/Animal.md) + - [Model.AnimalFarm](docs/AnimalFarm.md) + - [Model.ApiResponse](docs/ApiResponse.md) + - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) + - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) + - [Model.Category](docs/Category.md) + - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) + - [Model.EnumArrays](docs/EnumArrays.md) + - [Model.EnumClass](docs/EnumClass.md) + - [Model.EnumTest](docs/EnumTest.md) + - [Model.FormatTest](docs/FormatTest.md) + - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) + - [Model.List](docs/List.md) + - [Model.MapTest](docs/MapTest.md) + - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.Model200Response](docs/Model200Response.md) + - [Model.ModelClient](docs/ModelClient.md) + - [Model.Name](docs/Name.md) + - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) + - [Model.Order](docs/Order.md) + - [Model.OuterComposite](docs/OuterComposite.md) + - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.Pet](docs/Pet.md) + - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) + - [Model.SpecialModelName](docs/SpecialModelName.md) + - [Model.Tag](docs/Tag.md) + - [Model.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..ac4f9d10798 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AdditionalPropertiesClass.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.AdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Animal.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Animal.md new file mode 100644 index 00000000000..f461176159c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Animal.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Animal +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AnimalFarm.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AnimalFarm.md new file mode 100644 index 00000000000..4d1cccb0cef --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AnimalFarm.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.AnimalFarm +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..89bc406754a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/AnotherFakeApi.md @@ -0,0 +1,70 @@ +# IO.Swagger.Api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **TestSpecialTags** +> ModelClient TestSpecialTags (ModelClient body) + +To test special tags + +To test special tags + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestSpecialTagsExample + { + public void main() + { + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ApiResponse.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ApiResponse.md new file mode 100644 index 00000000000..3e4b4c5e9cb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ApiResponse.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ApiResponse +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int?** | | [optional] +**Type** | **string** | | [optional] +**Message** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..3431d89edd0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ArrayOfArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..9dc573663d6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ArrayOfNumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal?>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayTest.md new file mode 100644 index 00000000000..37fb2788b77 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ArrayTest.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.ArrayTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Boolean.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Capitalization.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Capitalization.md new file mode 100644 index 00000000000..87d14f03e0d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Capitalization.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Capitalization +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Cat.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Cat.md new file mode 100644 index 00000000000..a88425f4307 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Cat.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.Cat +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Category.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Category.md new file mode 100644 index 00000000000..20b56b1728c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Category.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Category +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ClassModel.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ClassModel.md new file mode 100644 index 00000000000..9bfd15db501 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ClassModel.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ClassModel +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Dog.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Dog.md new file mode 100644 index 00000000000..c3ee6d927b4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Dog.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.Dog +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumArrays.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumArrays.md new file mode 100644 index 00000000000..86fd208f8f8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumArrays.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.EnumArrays +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | **string** | | [optional] +**ArrayEnum** | **List<string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumClass.md new file mode 100644 index 00000000000..d936aad6f0b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumClass.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.EnumClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumTest.md new file mode 100644 index 00000000000..f3278be4cf3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/EnumTest.md @@ -0,0 +1,13 @@ +# IO.Swagger.Model.EnumTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int?** | | [optional] +**EnumNumber** | **double?** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FakeApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FakeApi.md new file mode 100644 index 00000000000..490521457a0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FakeApi.md @@ -0,0 +1,660 @@ +# IO.Swagger.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data + + + +# **FakeOuterBooleanSerialize** +> bool? FakeOuterBooleanSerialize (OuterBoolean body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + + try + { + bool? result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +**bool?** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterNumberSerialize** +> decimal? FakeOuterNumberSerialize (OuterNumber body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + + try + { + decimal? result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +**decimal?** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (OuterString body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new OuterString(); // OuterString | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User body, string query) + + + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new User(); // User | + var query = query_example; // string | + + try + { + apiInstance.TestBodyWithQueryParams(body, query); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| | + **query** | **string**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient body) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClientModelExample + { + public void main() + { + var apiInstance = new FakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public void main() + { + // Configure HTTP basic authorization: http_basic_test + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(); + var number = 8.14; // decimal? | None + var _double = 1.2; // double? | None + var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None + var _byte = B; // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789; // long? | None (optional) + var _float = 3.4; // float? | None (optional) + var _string = _string_example; // string | None (optional) + var binary = B; // byte[] | None (optional) + var date = 2013-10-20; // DateTime? | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var password = password_example; // string | None (optional) + var callback = callback_example; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **decimal?**| None | + **_double** | **double?**| None | + **patternWithoutDelimiter** | **string**| None | + **_byte** | **byte[]**| None | + **integer** | **int?**| None | [optional] + **int32** | **int?**| None | [optional] + **int64** | **long?**| None | [optional] + **_float** | **float?**| None | [optional] + **_string** | **string**| None | [optional] + **binary** | **byte[]**| None | [optional] + **date** | **DateTime?**| None | [optional] + **dateTime** | **DateTime?**| None | [optional] + **password** | **string**| None | [optional] + **callback** | **string**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public void main() + { + var apiInstance = new FakeApi(); + var enumFormStringArray = enumFormStringArray_example; // List | Form parameter enum test (string array) (optional) + var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) + var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) + var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumFormStringArray** | **List<string>**| Form parameter enum test (string array) | [optional] + **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] + **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] + **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] + **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] + **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Object param) + +test inline additionalProperties + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public void main() + { + var apiInstance = new FakeApi(); + var param = ; // Object | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(param); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public void main() + { + var apiInstance = new FakeApi(); + var param = param_example; // string | field1 + var param2 = param2_example; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **string**| field1 | + **param2** | **string**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..0c972a86431 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FakeClassnameTags123Api.md @@ -0,0 +1,75 @@ +# IO.Swagger.Api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **TestClassname** +> ModelClient TestClassname (ModelClient body) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClassnameExample + { + public void main() + { + // Configure API key authorization: api_key_query + Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FormatTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FormatTest.md new file mode 100644 index 00000000000..1108a1af428 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/FormatTest.md @@ -0,0 +1,21 @@ +# IO.Swagger.Model.FormatTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int?** | | [optional] +**Int32** | **int?** | | [optional] +**Int64** | **long?** | | [optional] +**Number** | **decimal?** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **byte[]** | | [optional] +**Date** | **DateTime?** | | +**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid?** | | [optional] +**Password** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..cf0190498b9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/HasOnlyReadOnly.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.HasOnlyReadOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] +**Foo** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Ints.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/List.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/List.md new file mode 100644 index 00000000000..d7555b7e7ac --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/List.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.List +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/MapTest.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/MapTest.md new file mode 100644 index 00000000000..5c202aa336a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/MapTest.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.MapTest +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, string>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..e2c978f9ab1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.MixedPropertiesAndAdditionalPropertiesClass +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid?** | | [optional] +**DateTime** | **DateTime?** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Model200Response.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Model200Response.md new file mode 100644 index 00000000000..62db21288f2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Model200Response.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Model200Response +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **int?** | | [optional] +**Class** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ModelClient.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ModelClient.md new file mode 100644 index 00000000000..c3817230640 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ModelClient.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.ModelClient +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**__Client** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Name.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Name.md new file mode 100644 index 00000000000..678132c8e4e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Name.md @@ -0,0 +1,12 @@ +# IO.Swagger.Model.Name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int?** | | +**SnakeCase** | **int?** | | [optional] +**Property** | **string** | | [optional] +**_123Number** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/NumberOnly.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/NumberOnly.md new file mode 100644 index 00000000000..a156dc4e2fc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/NumberOnly.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.NumberOnly +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Numbers.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Order.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Order.md new file mode 100644 index 00000000000..32aeab388e5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Order.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Order +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**PetId** | **long?** | | [optional] +**Quantity** | **int?** | | [optional] +**ShipDate** | **DateTime?** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool?** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/OuterComposite.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/OuterComposite.md new file mode 100644 index 00000000000..84714b7759e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/OuterComposite.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.OuterComposite +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/OuterEnum.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/OuterEnum.md new file mode 100644 index 00000000000..55eb118a349 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/OuterEnum.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterEnum +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Pet.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Pet.md new file mode 100644 index 00000000000..e83933d1c60 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Pet.md @@ -0,0 +1,14 @@ +# IO.Swagger.Model.Pet +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Tags** | [**List<Tag>**](Tag.md) | | [optional] +**Status** | **string** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/PetApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/PetApi.md new file mode 100644 index 00000000000..4ba479f81d1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/PetApi.md @@ -0,0 +1,526 @@ +# IO.Swagger.Api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **AddPet** +> void AddPet (Pet body) + +Add a new pet to the store + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class AddPetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var body = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeletePet** +> void DeletePet (long? petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeletePetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | Pet id to delete + var apiKey = apiKey_example; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| Pet id to delete | + **apiKey** | **string**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByStatus** +> List FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var status = status_example; // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List<Pet> result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **List<string>**| Status values that need to be considered for filter | + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByTags** +> List FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List<Pet> result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetPetById** +> Pet GetPetById (long? petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public void main() + { + // Configure API key authorization: api_key + Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet body) + +Update an existing pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdatePetExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var body = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long? petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet that needs to be updated + var name = name_example; // string | Updated name of the pet (optional) + var status = status_example; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet that needs to be updated | + **name** | **string**| Updated name of the pet | [optional] + **status** | **string**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + +uploads an image + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UploadFileExample + { + public void main() + { + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(); + var petId = 789; // long? | ID of pet to update + var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to update | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..b5f8d484869 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/ReadOnlyFirst.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.ReadOnlyFirst +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] +**Baz** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Return.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Return.md new file mode 100644 index 00000000000..9a9559907c1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/SpecialModelName.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/SpecialModelName.md new file mode 100644 index 00000000000..ee1bc316835 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/SpecialModelName.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.SpecialModelName +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/StoreApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/StoreApi.md new file mode 100644 index 00000000000..28e3fe59067 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/StoreApi.md @@ -0,0 +1,254 @@ +# IO.Swagger.Api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + + +# **DeleteOrder** +> 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 + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public void main() + { + var apiInstance = new StoreApi(); + var orderId = orderId_example; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **string**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetInventory** +> Dictionary GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetInventoryExample + { + public void main() + { + // Configure API key authorization: api_key + Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(); + + try + { + // Returns pet inventories by status + Dictionary<string, int?> result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetOrderById** +> Order GetOrderById (long? orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public void main() + { + var apiInstance = new StoreApi(); + var orderId = 789; // long? | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long?**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order body) + +Place an order for a pet + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public void main() + { + var apiInstance = new StoreApi(); + var body = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Tag.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Tag.md new file mode 100644 index 00000000000..64c5e6bdc72 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/Tag.md @@ -0,0 +1,10 @@ +# IO.Swagger.Model.Tag +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/User.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/User.md new file mode 100644 index 00000000000..fbea33c48b9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/User.md @@ -0,0 +1,16 @@ +# IO.Swagger.Model.User +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long?** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int?** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/UserApi.md b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/UserApi.md new file mode 100644 index 00000000000..dfe89c60ab9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/docs/UserApi.md @@ -0,0 +1,488 @@ +# IO.Swagger.Api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user +[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +# **CreateUser** +> void CreateUser (User body) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List body) + +Creates list of users with given input array + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List body) + +Creates list of users with given input array + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public void main() + { + var apiInstance = new UserApi(); + var body = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class DeleteUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class LoginUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | The user name for login + var password = password_example; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The user name for login | + **password** | **string**| The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class LogoutUserExample + { + public void main() + { + var apiInstance = new UserApi(); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateUser** +> void UpdateUser (string username, User body) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class UpdateUserExample + { + public void main() + { + var apiInstance = new UserApi(); + var username = username_example; // string | name that need to be deleted + var body = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, body); + } + catch (Exception e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/git_push.sh b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/git_push.sh new file mode 100644 index 00000000000..160f6f21399 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..1f5f6920192 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/AnotherFakeApi.cs @@ -0,0 +1,321 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestSpecialTags (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestSpecialTagsWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public AnotherFakeApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestSpecialTags (ModelClient body) + { + ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "./another-fake/dummy"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "./another-fake/dummy"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs new file mode 100644 index 00000000000..f6b18148e31 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeApi.cs @@ -0,0 +1,2202 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool? + bool? FakeOuterBooleanSerialize (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal? + decimal? FakeOuterNumberSerialize (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// string + string FakeOuterStringSerialize (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void TestBodyWithQueryParams (User body, string query); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithQueryParamsWithHttpInfo (User body, string query); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClientModel (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClientModelWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// ApiResponse of Object(void) + ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// + void TestInlineAdditionalProperties (Object param); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Object param); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + void TestJsonFormData (string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of bool? + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (bool?) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of decimal? + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (decimal?) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (User body, string query); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (User body, string query); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Task of void + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Object param); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Object param); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of void + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of ApiResponse + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool? + public bool? FakeOuterBooleanSerialize (OuterBoolean body = null) + { + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "./fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of bool? + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + { + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (bool?) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "./fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + { + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "./fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterComposite) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + { + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "./fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterComposite) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal? + public decimal? FakeOuterNumberSerialize (OuterNumber body = null) + { + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "./fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of decimal? + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + { + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (decimal?) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "./fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// string + public string FakeOuterStringSerialize (OuterString body = null) + { + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + { + + var localVarPath = "./fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + { + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + { + + var localVarPath = "./fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + public void TestBodyWithQueryParams (User body, string query) + { + TestBodyWithQueryParamsWithHttpInfo(body, query); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (User body, string query) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'query' is set + if (query == null) + throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + var localVarPath = "./fake/body-with-query-params"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (User body, string query) + { + await TestBodyWithQueryParamsAsyncWithHttpInfo(body, query); + + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (User body, string query) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'query' is set + if (query == null) + throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + var localVarPath = "./fake/body-with-query-params"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClientModel (ModelClient body) + { + ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClientModel", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// + public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integer != null) localVarFormParams.Add("integer", this.Configuration.ApiClient.ParameterToString(integer)); // form parameter + if (int32 != null) localVarFormParams.Add("int32", this.Configuration.ApiClient.ParameterToString(int32)); // form parameter + if (int64 != null) localVarFormParams.Add("int64", this.Configuration.ApiClient.ParameterToString(int64)); // form parameter + if (number != null) localVarFormParams.Add("number", this.Configuration.ApiClient.ParameterToString(number)); // form parameter + if (_float != null) localVarFormParams.Add("float", this.Configuration.ApiClient.ParameterToString(_float)); // form parameter + if (_double != null) localVarFormParams.Add("double", this.Configuration.ApiClient.ParameterToString(_double)); // form parameter + if (_string != null) localVarFormParams.Add("string", this.Configuration.ApiClient.ParameterToString(_string)); // form parameter + if (patternWithoutDelimiter != null) localVarFormParams.Add("pattern_without_delimiter", this.Configuration.ApiClient.ParameterToString(patternWithoutDelimiter)); // form parameter + if (_byte != null) localVarFormParams.Add("byte", this.Configuration.ApiClient.ParameterToString(_byte)); // form parameter + if (binary != null) localVarFormParams.Add("binary", this.Configuration.ApiClient.ParameterToString(binary)); // form parameter + if (date != null) localVarFormParams.Add("date", this.Configuration.ApiClient.ParameterToString(date)); // form parameter + if (dateTime != null) localVarFormParams.Add("dateTime", this.Configuration.ApiClient.ParameterToString(dateTime)); // form parameter + if (password != null) localVarFormParams.Add("password", this.Configuration.ApiClient.ParameterToString(password)); // form parameter + if (callback != null) localVarFormParams.Add("callback", this.Configuration.ApiClient.ParameterToString(callback)); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + { + // verify the required parameter 'number' is set + if (number == null) + throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_double' is set + if (_double == null) + throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + // verify the required parameter '_byte' is set + if (_byte == null) + throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml; charset=utf-8", + "application/json; charset=utf-8" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (integer != null) localVarFormParams.Add("integer", this.Configuration.ApiClient.ParameterToString(integer)); // form parameter + if (int32 != null) localVarFormParams.Add("int32", this.Configuration.ApiClient.ParameterToString(int32)); // form parameter + if (int64 != null) localVarFormParams.Add("int64", this.Configuration.ApiClient.ParameterToString(int64)); // form parameter + if (number != null) localVarFormParams.Add("number", this.Configuration.ApiClient.ParameterToString(number)); // form parameter + if (_float != null) localVarFormParams.Add("float", this.Configuration.ApiClient.ParameterToString(_float)); // form parameter + if (_double != null) localVarFormParams.Add("double", this.Configuration.ApiClient.ParameterToString(_double)); // form parameter + if (_string != null) localVarFormParams.Add("string", this.Configuration.ApiClient.ParameterToString(_string)); // form parameter + if (patternWithoutDelimiter != null) localVarFormParams.Add("pattern_without_delimiter", this.Configuration.ApiClient.ParameterToString(patternWithoutDelimiter)); // form parameter + if (_byte != null) localVarFormParams.Add("byte", this.Configuration.ApiClient.ParameterToString(_byte)); // form parameter + if (binary != null) localVarFormParams.Add("binary", this.Configuration.ApiClient.ParameterToString(binary)); // form parameter + if (date != null) localVarFormParams.Add("date", this.Configuration.ApiClient.ParameterToString(date)); // form parameter + if (dateTime != null) localVarFormParams.Add("dateTime", this.Configuration.ApiClient.ParameterToString(dateTime)); // form parameter + if (password != null) localVarFormParams.Add("password", this.Configuration.ApiClient.ParameterToString(password)); // form parameter + if (callback != null) localVarFormParams.Add("callback", this.Configuration.ApiClient.ParameterToString(callback)); // form parameter + + // authentication (http_basic_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// + public void TestEnumParameters (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + TestEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// ApiResponse of Object(void) + public ApiResponse TestEnumParametersWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "*/*" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter + if (enumQueryString != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter + if (enumQueryInteger != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter + if (enumHeaderStringArray != null) localVarHeaderParams.Add("enum_header_string_array", this.Configuration.ApiClient.ParameterToString(enumHeaderStringArray)); // header parameter + if (enumHeaderString != null) localVarHeaderParams.Add("enum_header_string", this.Configuration.ApiClient.ParameterToString(enumHeaderString)); // header parameter + if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", this.Configuration.ApiClient.ParameterToString(enumFormStringArray)); // form parameter + if (enumFormString != null) localVarFormParams.Add("enum_form_string", this.Configuration.ApiClient.ParameterToString(enumFormString)); // form parameter + if (enumQueryDouble != null) localVarFormParams.Add("enum_query_double", this.Configuration.ApiClient.ParameterToString(enumQueryDouble)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of void + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + await TestEnumParametersAsyncWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Form parameter enum test (string array) (optional) + /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumFormStringArray = null, string enumFormString = null, List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null) + { + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "*/*" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "*/*" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter + if (enumQueryString != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter + if (enumQueryInteger != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter + if (enumHeaderStringArray != null) localVarHeaderParams.Add("enum_header_string_array", this.Configuration.ApiClient.ParameterToString(enumHeaderStringArray)); // header parameter + if (enumHeaderString != null) localVarHeaderParams.Add("enum_header_string", this.Configuration.ApiClient.ParameterToString(enumHeaderString)); // header parameter + if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", this.Configuration.ApiClient.ParameterToString(enumFormStringArray)); // form parameter + if (enumFormString != null) localVarFormParams.Add("enum_form_string", this.Configuration.ApiClient.ParameterToString(enumFormString)); // form parameter + if (enumQueryDouble != null) localVarFormParams.Add("enum_query_double", this.Configuration.ApiClient.ParameterToString(enumQueryDouble)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestInlineAdditionalProperties (Object param) + { + TestInlineAdditionalPropertiesWithHttpInfo(param); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Object param) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + + var localVarPath = "./fake/inline-additionalProperties"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (param != null && param.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter + } + else + { + localVarPostBody = param; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Task of void + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Object param) + { + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Object param) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + + var localVarPath = "./fake/inline-additionalProperties"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (param != null && param.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter + } + else + { + localVarPostBody = param; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + public void TestJsonFormData (string param, string param2) + { + TestJsonFormDataWithHttpInfo(param, param2); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + public ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + // verify the required parameter 'param2' is set + if (param2 == null) + throw new ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + var localVarPath = "./fake/jsonFormData"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (param != null) localVarFormParams.Add("param", this.Configuration.ApiClient.ParameterToString(param)); // form parameter + if (param2 != null) localVarFormParams.Add("param2", this.Configuration.ApiClient.ParameterToString(param2)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestJsonFormData", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of void + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + { + await TestJsonFormDataAsyncWithHttpInfo(param, param2); + + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + // verify the required parameter 'param2' is set + if (param2 == null) + throw new ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + var localVarPath = "./fake/jsonFormData"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (param != null) localVarFormParams.Add("param", this.Configuration.ApiClient.ParameterToString(param)); // form parameter + if (param2 != null) localVarFormParams.Add("param2", this.Configuration.ApiClient.ParameterToString(param2)); // form parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestJsonFormData", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..911bca21714 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,331 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApiAccessor + { + #region Synchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClassname (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClassnameWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeClassnameTags123Api(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClassname (ModelClient body) + { + ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "./fake_classname_test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (api_key_query) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "./fake_classname_test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (api_key_query) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs new file mode 100644 index 00000000000..38fdf0ba871 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/PetApi.cs @@ -0,0 +1,1720 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void AddPet (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse AddPetWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + void DeletePet (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// List<Pet> + List FindPetsByStatus (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByStatusWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + List FindPetsByTags (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByTagsWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + Pet GetPetById (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + ApiResponse GetPetByIdWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void UpdatePet (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + void UpdatePetWithForm (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task AddPetAsync (Pet body); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + System.Threading.Tasks.Task UpdatePetAsync (Pet body); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IPetApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public PetApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void AddPet (Pet body) + { + AddPetWithHttpInfo(body); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public ApiResponse AddPetWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "./pet"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task AddPetAsync (Pet body) + { + await AddPetAsyncWithHttpInfo(body); + + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + + var localVarPath = "./pet"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("AddPet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + public void DeletePet (long? petId, string apiKey = null) + { + DeletePetWithHttpInfo(petId, apiKey); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (apiKey != null) localVarHeaderParams.Add("api_key", this.Configuration.ApiClient.ParameterToString(apiKey)); // header parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of void + public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + { + await DeletePetAsyncWithHttpInfo(petId, apiKey); + + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (apiKey != null) localVarHeaderParams.Add("api_key", this.Configuration.ApiClient.ParameterToString(apiKey)); // header parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeletePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// List<Pet> + public List FindPetsByStatus (List status) + { + ApiResponse> localVarResponse = FindPetsByStatusWithHttpInfo(status); + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// ApiResponse of List<Pet> + public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "./pet/findByStatus"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "status", status)); // query parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + { + ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + var localVarPath = "./pet/findByStatus"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "status", status)); // query parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + public List FindPetsByTags (List tags) + { + ApiResponse> localVarResponse = FindPetsByTagsWithHttpInfo(tags); + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "./pet/findByTags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (tags != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "tags", tags)); // query parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + { + ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + return localVarResponse.Data; + + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + var localVarPath = "./pet/findByTags"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (tags != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "tags", tags)); // query parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + public Pet GetPetById (long? petId) + { + ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarHeaderParams["api_key"] = this.Configuration.GetApiKeyWithPrefix("api_key"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Pet) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of Pet + public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + { + ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + return localVarResponse.Data; + + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarHeaderParams["api_key"] = this.Configuration.GetApiKeyWithPrefix("api_key"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetPetById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Pet) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void UpdatePet (Pet body) + { + UpdatePetWithHttpInfo(body); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public ApiResponse UpdatePetWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "./pet"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of void + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + { + await UpdatePetAsyncWithHttpInfo(body); + + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + + var localVarPath = "./pet"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json", + "application/xml" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePet", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + public void UpdatePetWithForm (long? petId, string name = null, string status = null) + { + UpdatePetWithFormWithHttpInfo(petId, name, status); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (name != null) localVarFormParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // form parameter + if (status != null) localVarFormParams.Add("status", this.Configuration.ApiClient.ParameterToString(status)); // form parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of void + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + { + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); + + var localVarPath = "./pet/{petId}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (name != null) localVarFormParams.Add("name", this.Configuration.ApiClient.ParameterToString(name)); // form parameter + if (status != null) localVarFormParams.Add("status", this.Configuration.ApiClient.ParameterToString(status)); // form parameter + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "./pet/{petId}/uploadImage"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.Data; + + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); + + var localVarPath = "./pet/{petId}/uploadImage"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs new file mode 100644 index 00000000000..a62138a577f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/StoreApi.cs @@ -0,0 +1,842 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + 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 + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteOrderWithHttpInfo (string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int?> + Dictionary GetInventory (); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int?> + ApiResponse> GetInventoryWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + Order GetOrderById (long? orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + Order PlaceOrder (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + ApiResponse PlaceOrderWithHttpInfo (Order body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of Dictionary<string, int?> + System.Threading.Tasks.Task> GetInventoryAsync (); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (Dictionary<string, int?>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of Order + System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync (Order body); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IStoreApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public StoreApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + public void DeleteOrder (string orderId) + { + DeleteOrderWithHttpInfo(orderId); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + public ApiResponse DeleteOrderWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "./store/order/{order_id}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (orderId != null) localVarPathParams.Add("order_id", this.Configuration.ApiClient.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + { + await DeleteOrderAsyncWithHttpInfo(orderId); + + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + var localVarPath = "./store/order/{order_id}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (orderId != null) localVarPathParams.Add("order_id", this.Configuration.ApiClient.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int?> + public Dictionary GetInventory () + { + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int?> + public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + { + + var localVarPath = "./store/inventory"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarHeaderParams["api_key"] = this.Configuration.GetApiKeyWithPrefix("api_key"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of Dictionary<string, int?> + public async System.Threading.Tasks.Task> GetInventoryAsync () + { + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (Dictionary<string, int?>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + { + + var localVarPath = "./store/inventory"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + // authentication (api_key) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarHeaderParams["api_key"] = this.Configuration.GetApiKeyWithPrefix("api_key"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetInventory", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + public Order GetOrderById (long? orderId) + { + ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "./store/order/{order_id}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (orderId != null) localVarPathParams.Add("order_id", this.Configuration.ApiClient.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of Order + public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + { + ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + return localVarResponse.Data; + + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); + + var localVarPath = "./store/order/{order_id}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (orderId != null) localVarPathParams.Add("order_id", this.Configuration.ApiClient.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetOrderById", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + public Order PlaceOrder (Order body) + { + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "./store/order"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of Order + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + { + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + + var localVarPath = "./store/order"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("PlaceOrder", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs new file mode 100644 index 00000000000..95f090cfc55 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Api/UserApi.cs @@ -0,0 +1,1606 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IApiAccessor + { + #region Synchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + void CreateUser (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + ApiResponse CreateUserWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithArrayInput (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithListInput (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + void DeleteUser (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteUserWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + User GetUserByName (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + ApiResponse GetUserByNameWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + string LoginUser (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + ApiResponse LoginUserWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + void LogoutUser (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + ApiResponse LogoutUserWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + void UpdateUser (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + ApiResponse UpdateUserWithHttpInfo (string username, User body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + System.Threading.Tasks.Task CreateUserAsync (User body); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + System.Threading.Tasks.Task DeleteUserAsync (string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + System.Threading.Tasks.Task GetUserByNameAsync (string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + System.Threading.Tasks.Task LoginUserAsync (string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of void + System.Threading.Tasks.Task LogoutUserAsync (); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IUserApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(String basePath) + { + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public UserApi(IO.Swagger.Client.Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = IO.Swagger.Client.Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public IO.Swagger.Client.Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + public void CreateUser (User body) + { + CreateUserWithHttpInfo(body); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + public ApiResponse CreateUserWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "./user"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of void + public async System.Threading.Tasks.Task CreateUserAsync (User body) + { + await CreateUserAsyncWithHttpInfo(body); + + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + + var localVarPath = "./user"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithArrayInput (List body) + { + CreateUsersWithArrayInputWithHttpInfo(body); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "./user/createWithArray"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + { + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + + var localVarPath = "./user/createWithArray"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithListInput (List body) + { + CreateUsersWithListInputWithHttpInfo(body); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "./user/createWithList"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + { + await CreateUsersWithListInputAsyncWithHttpInfo(body); + + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + + var localVarPath = "./user/createWithList"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + public void DeleteUser (string username) + { + DeleteUserWithHttpInfo(username); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + public ApiResponse DeleteUserWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of void + public async System.Threading.Tasks.Task DeleteUserAsync (string username) + { + await DeleteUserAsyncWithHttpInfo(username); + + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("DeleteUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + public User GetUserByName (string username) + { + ApiResponse localVarResponse = GetUserByNameWithHttpInfo(username); + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (User) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of User + public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + { + ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + return localVarResponse.Data; + + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Task of ApiResponse (User) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("GetUserByName", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (User) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + public string LoginUser (string username, string password) + { + ApiResponse localVarResponse = LoginUserWithHttpInfo(username, password); + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "./user/login"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "username", username)); // query parameter + if (password != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "password", password)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of string + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + { + ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + return localVarResponse.Data; + + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + var localVarPath = "./user/login"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "username", username)); // query parameter + if (password != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "password", password)); // query parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LoginUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// + public void LogoutUser () + { + LogoutUserWithHttpInfo(); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + public ApiResponse LogoutUserWithHttpInfo () + { + + var localVarPath = "./user/logout"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of void + public async System.Threading.Tasks.Task LogoutUserAsync () + { + await LogoutUserAsyncWithHttpInfo(); + + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + { + + var localVarPath = "./user/logout"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("LogoutUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + public void UpdateUser (string username, User body) + { + UpdateUserWithHttpInfo(username, body); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + public ApiResponse UpdateUserWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of void + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + { + await UpdateUserAsyncWithHttpInfo(username, body); + + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + + var localVarPath = "./user/{username}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/xml", + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UpdateUser", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + null); + } + + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs new file mode 100644 index 00000000000..7fe1be712bb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiClient.cs @@ -0,0 +1,535 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text.RegularExpressions; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using Newtonsoft.Json; +using RestSharp.Portable; +using RestSharp.Portable.HttpClient; + +namespace IO.Swagger.Client +{ + /// + /// API client is mainly responsible for making the HTTP call to the API backend. + /// + public partial class ApiClient + { + private JsonSerializerSettings serializerSettings = new JsonSerializerSettings + { + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(IRestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(IRestRequest request, IRestResponse response); + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + public ApiClient() + { + Configuration = IO.Swagger.Client.Configuration.Default; + RestClient = new RestClient("http://petstore.swagger.io:80/v2"); + RestClient.IgnoreResponseStatusCode = true; + } + + /// + /// Initializes a new instance of the class + /// with default base path (http://petstore.swagger.io:80/v2). + /// + /// An instance of Configuration. + public ApiClient(Configuration config) + { + Configuration = config ?? IO.Swagger.Client.Configuration.Default; + + RestClient = new RestClient(Configuration.BasePath); + RestClient.IgnoreResponseStatusCode = true; + } + + /// + /// Initializes a new instance of the class + /// with default configuration. + /// + /// The base path. + public ApiClient(String basePath = "http://petstore.swagger.io:80/v2") + { + if (String.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + RestClient = new RestClient(basePath); + RestClient.IgnoreResponseStatusCode = true; + Configuration = Client.Configuration.Default; + } + + /// + /// Gets or sets the default API client for making HTTP calls. + /// + /// The default API client. + [Obsolete("ApiClient.Default is deprecated, please use 'Configuration.Default.ApiClient' instead.")] + public static ApiClient Default; + + /// + /// Gets or sets an instance of the IReadableConfiguration. + /// + /// An instance of the IReadableConfiguration. + /// + /// helps us to avoid modifying possibly global + /// configuration values from within a given client. It does not guarantee thread-safety + /// of the instance in any way. + /// + public IReadableConfiguration Configuration { get; set; } + + /// + /// Gets or sets the RestClient. + /// + /// An instance of the RestClient + public RestClient RestClient { get; set; } + + // Creates and sets up a RestRequest prior to a call. + private RestRequest PrepareRequest( + String path, Method method, List> queryParams, Object postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, Dictionary pathParams, + String contentType) + { + var request = new RestRequest(path, method); + // disable ResetSharp.Portable built-in serialization + request.Serializer = null; + + // add path parameter, if any + foreach(var param in pathParams) + request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment); + + // add header parameter, if any + foreach(var param in headerParams) + request.AddHeader(param.Key, param.Value); + + // add query parameter, if any + foreach(var param in queryParams) + request.AddQueryParameter(param.Key, param.Value); + + // add form parameter, if any + foreach(var param in formParams) + request.AddParameter(param.Key, param.Value); + + // add file parameter, if any + foreach(var param in fileParams) + { + request.AddFile(param.Value); + } + + if (postBody != null) // http body (model or byte[]) parameter + { + request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = contentType }); + } + + return request; + } + + /// + /// Makes the HTTP request (Sync). + /// + /// URL path. + /// HTTP method. + /// Query parameters. + /// HTTP body (POST request). + /// Header parameters. + /// Form parameters. + /// File parameters. + /// Path parameters. + /// Content Type of the request + /// Object + public Object CallApi( + String path, Method method, List> queryParams, Object postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, Dictionary pathParams, + String contentType) + { + var request = PrepareRequest( + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); + + // set timeout + RestClient.Timeout = TimeSpan.FromMilliseconds(Configuration.Timeout); + + // set user agent + RestClient.UserAgent = Configuration.UserAgent; + + InterceptRequest(request); + var response = RestClient.Execute(request).Result; + InterceptResponse(request, response); + + return (Object) response; + } + /// + /// Makes the asynchronous HTTP request. + /// + /// URL path. + /// HTTP method. + /// Query parameters. + /// HTTP body (POST request). + /// Header parameters. + /// Form parameters. + /// File parameters. + /// Path parameters. + /// Content type. + /// The Task instance. + public async System.Threading.Tasks.Task CallApiAsync( + String path, Method method, List> queryParams, Object postBody, + Dictionary headerParams, Dictionary formParams, + Dictionary fileParams, Dictionary pathParams, + String contentType) + { + var request = PrepareRequest( + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); + InterceptRequest(request); + var response = await RestClient.Execute(request); + InterceptResponse(request, response); + return (Object)response; + } + + /// + /// Escape string (url-encoded). + /// + /// String to be escaped. + /// Escaped string. + public string EscapeString(string str) + { + return UrlEncode(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, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name)); + else + return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided"); + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, 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 a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTime)obj).ToString (Configuration.DateTimeFormat); + else if (obj is DateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is IList) + { + var flattenedString = new StringBuilder(); + foreach (var param in (IList)obj) + { + if (flattenedString.Length > 0) + flattenedString.Append(","); + flattenedString.Append(param); + } + return flattenedString.ToString(); + } + else + return Convert.ToString (obj); + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + public object Deserialize(IRestResponse response, Type type) + { + IHttpHeaders headers = response.Headers; + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + if (headers != null) + { + var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) + ? Path.GetTempPath() + : Configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, response.RawBytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(response.RawBytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return ConvertType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + /// + /// Serialize an input (model) 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); + } + } + + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public String SelectHeaderContentType(String[] contentTypes) + { + if (contentTypes.Length == 0) + return "application/json"; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType.ToLower())) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public String SelectHeaderAccept(String[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return String.Join(",", accepts); + } + + /// + /// Encode string in base64 format. + /// + /// String to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Dynamically cast the object into target type. + /// + /// Object to be casted + /// Target type + /// Casted object + public static dynamic ConvertType(dynamic fromObject, Type toObject) + { + return Convert.ChangeType(fromObject, toObject); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + byte[] buf = new byte[16*1024]; + using (MemoryStream ms = new MemoryStream()) + { + int count; + while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) + { + ms.Write(buf, 0, count); + } + return ms.ToArray(); + } + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// String to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + + if (match.Success) + { + return match.Groups[1].Value; + } + else + { + return filename; + } + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// Key name. + /// Value object. + /// A list of KeyValuePairs + public IEnumerable> ParameterToKeyValuePairs(string collectionFormat, string name, object value) + { + var parameters = new List>(); + + if (IsCollection(value) && collectionFormat == "multi") + { + var valueCollection = value as IEnumerable; + parameters.AddRange(from object item in valueCollection select new KeyValuePair(name, ParameterToString(item))); + } + else + { + parameters.Add(new KeyValuePair(name, ParameterToString(value))); + } + + return parameters; + } + + /// + /// Check if generic object is a collection. + /// + /// + /// True if object is a collection type + private static bool IsCollection(object value) + { + return value is IList || value is ICollection; + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs new file mode 100644 index 00000000000..79c6432ffc6 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiException.cs @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; + +namespace IO.Swagger.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public dynamic ErrorContent { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() {} + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiResponse.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiResponse.cs new file mode 100644 index 00000000000..b21347aa408 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ApiResponse.cs @@ -0,0 +1,54 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; + +namespace IO.Swagger.Client +{ + /// + /// API Response + /// + public class ApiResponse + { + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public int StatusCode { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public IDictionary Headers { get; private set; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(int statusCode, IDictionary headers, T data) + { + this.StatusCode= statusCode; + this.Headers = headers; + this.Data = data; + } + + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs new file mode 100644 index 00000000000..364ce53fc06 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs @@ -0,0 +1,447 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Reflection; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace IO.Swagger.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + private static readonly object GlobalConfigSync = new { }; + private static Configuration _globalConfiguration; + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.Content), + response.Content); + } + + return null; + }; + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static Configuration Default + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + + #endregion Static Members + + #region Private Members + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + private IDictionary _apiKey = null; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix = null; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + #endregion Private Members + + #region Constructors + + static Configuration() + { + _globalConfiguration = new GlobalConfiguration(); + } + + /// + /// Initializes a new instance of the class + /// + public Configuration() + { + UserAgent = "Swagger-Codegen/1.0.0/csharp"; + BasePath = "http://petstore.swagger.io:80/v2"; + DefaultHeader = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + public Configuration( + IDictionary defaultHeader, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://petstore.swagger.io:80/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeader == null) + throw new ArgumentNullException("defaultHeader"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeader) + { + DefaultHeader.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + /// + /// Initializes a new instance of the class with different settings + /// + /// Api client + /// Dictionary of default HTTP header + /// Username + /// Password + /// accessToken + /// Dictionary of API key + /// Dictionary of API key prefix + /// Temp folder path + /// DateTime format string + /// HTTP connection timeout (in milliseconds) + /// HTTP user agent + [Obsolete("Use explicit object construction and setting of properties.", true)] + public Configuration( + // ReSharper disable UnusedParameter.Local + ApiClient apiClient = null, + IDictionary defaultHeader = null, + string username = null, + string password = null, + string accessToken = null, + IDictionary apiKey = null, + IDictionary apiKeyPrefix = null, + string tempFolderPath = null, + string dateTimeFormat = null, + int timeout = 100000, + string userAgent = "Swagger-Codegen/1.0.0/csharp" + // ReSharper restore UnusedParameter.Local + ) + { + + } + + /// + /// Initializes a new instance of the Configuration class. + /// + /// Api client. + [Obsolete("This constructor caused unexpected sharing of static data. It is no longer supported.", true)] + // ReSharper disable once UnusedParameter.Local + public Configuration(ApiClient apiClient) + { + + } + + #endregion Constructors + + + #region Properties + + private ApiClient _apiClient = null; + /// + /// Gets an instance of an ApiClient for this configuration + /// + public virtual ApiClient ApiClient + { + get + { + if (_apiClient == null) _apiClient = CreateApiClient(); + return _apiClient; + } + } + + private String _basePath = null; + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { + get { return _basePath; } + set { + _basePath = value; + // pass-through to ApiClient if it's set. + if(_apiClient != null) { + _apiClient.RestClient.BaseUrl = new Uri(_basePath); + } + } + } + + /// + /// Gets or sets the default header. + /// + public virtual IDictionary DefaultHeader { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout + { + get { return (int)ApiClient.RestClient.Timeout.GetValueOrDefault(TimeSpan.FromSeconds(0)).TotalMilliseconds; } + set { ApiClient.RestClient.Timeout = TimeSpan.FromMilliseconds(value); } + } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + var apiKeyValue = ""; + ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); + var apiKeyPrefix = ""; + if (ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) + return apiKeyPrefix + " " + apiKeyValue; + else + return apiKeyValue; + } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + // Possible breaking change since swagger-codegen 2.2.1, enforce a valid temporary path on set. + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + #endregion Properties + + #region Methods + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + public void AddDefaultHeader(string key, string value) + { + DefaultHeader[key] = value; + } + + /// + /// Creates a new based on this instance. + /// + /// + public ApiClient CreateApiClient() + { + return new ApiClient(BasePath) { Configuration = this }; + } + + + /// + /// Returns a string with essential information for debugging. + /// + public static String ToDebugReport() + { + String report = "C# SDK (IO.Swagger) Debug Report:\n"; + report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ExceptionFactory.cs new file mode 100644 index 00000000000..fd7e15d33eb --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/ExceptionFactory.cs @@ -0,0 +1,24 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using RestSharp.Portable; + +namespace IO.Swagger.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IRestResponse response); +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/GlobalConfiguration.cs new file mode 100644 index 00000000000..d8b196fc3e8 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/GlobalConfiguration.cs @@ -0,0 +1,34 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Reflection; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; + +namespace IO.Swagger.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .swagger-codegen-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/IApiAccessor.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/IApiAccessor.cs new file mode 100644 index 00000000000..054dd600ab2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/IApiAccessor.cs @@ -0,0 +1,42 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp.Portable; + +namespace IO.Swagger.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + Configuration Configuration {get; set;} + + /// + /// Gets the base path of the API client. + /// + /// The base path + String GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/IReadableConfiguration.cs new file mode 100644 index 00000000000..32e87d6bd9a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/IReadableConfiguration.cs @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using System.Collections.Generic; + +namespace IO.Swagger.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time foramt. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + IDictionary DefaultHeader { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/SwaggerDateConverter.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/SwaggerDateConverter.cs new file mode 100644 index 00000000000..82b825423dc --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Client/SwaggerDateConverter.cs @@ -0,0 +1,30 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Client +{ + /// + /// Formatter for 'date' swagger formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types + /// + public class SwaggerDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public SwaggerDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 00000000000..303c8daa0e9 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,52 @@ + + + + + 14.0 + Debug + AnyCPU + {3AB1F259-1769-484B-9411-84505FCCBD55} + Library + Properties + IO.Swagger + IO.Swagger + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + v5.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..1a3bb3d1f69 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract] + public partial class AdditionalPropertiesClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesClass); + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + if (input == null) + return false; + + return + ( + this.MapProperty == input.MapProperty || + this.MapProperty != null && + this.MapProperty.SequenceEqual(input.MapProperty) + ) && + ( + this.MapOfMapProperty == input.MapOfMapProperty || + this.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Animal.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Animal.cs new file mode 100644 index 00000000000..7e3b397d2d5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Animal.cs @@ -0,0 +1,153 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using JsonSubTypes; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Animal + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "className")] + [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + public partial class Animal : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() { } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = "red") + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new InvalidDataException("className is a required property for Animal and cannot be null"); + } + else + { + this.ClassName = className; + } + // use default value if no "color" provided + if (color == null) + { + this.Color = "red"; + } + else + { + this.Color = color; + } + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Animal); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + if (input == null) + return false; + + return + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ) && + ( + this.Color == input.Color || + (this.Color != null && + this.Color.Equals(input.Color)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + if (this.Color != null) + hashCode = hashCode * 59 + this.Color.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/AnimalFarm.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/AnimalFarm.cs new file mode 100644 index 00000000000..29b66e92d25 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/AnimalFarm.cs @@ -0,0 +1,98 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// AnimalFarm + /// + [DataContract] + public partial class AnimalFarm : List, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public AnimalFarm() : base() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AnimalFarm {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AnimalFarm); + } + + /// + /// Returns true if AnimalFarm instances are equal + /// + /// Instance of AnimalFarm to be compared + /// Boolean + public bool Equals(AnimalFarm input) + { + if (input == null) + return false; + + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ApiResponse.cs new file mode 100644 index 00000000000..86a24a4b711 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ApiResponse.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ApiResponse + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=false)] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ApiResponse); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + if (input == null) + return false; + + return + ( + this.Code == input.Code || + (this.Code != null && + this.Code.Equals(input.Code)) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Code != null) + hashCode = hashCode * 59 + this.Code.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.Message != null) + hashCode = hashCode * 59 + this.Message.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..d5f390edca7 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayOfArrayOfNumberOnly.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract] + public partial class ArrayOfArrayOfNumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + if (input == null) + return false; + + return + ( + this.ArrayArrayNumber == input.ArrayArrayNumber || + this.ArrayArrayNumber != null && + this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..2a19536618d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayOfNumberOnly.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract] + public partial class ArrayOfNumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] + public List ArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + if (input == null) + return false; + + return + ( + this.ArrayNumber == input.ArrayNumber || + this.ArrayNumber != null && + this.ArrayNumber.SequenceEqual(input.ArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayTest.cs new file mode 100644 index 00000000000..b3705a7d770 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ArrayTest.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ArrayTest + /// + [DataContract] + public partial class ArrayTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name="array_of_string", EmitDefaultValue=false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name="array_array_of_model", EmitDefaultValue=false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayTest); + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + if (input == null) + return false; + + return + ( + this.ArrayOfString == input.ArrayOfString || + this.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(input.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == input.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + if (this.ArrayArrayOfInteger != null) + hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + if (this.ArrayArrayOfModel != null) + hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..d404aa0365d --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,48 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Capitalization.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Capitalization.cs new file mode 100644 index 00000000000..7529b2a80c5 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Capitalization.cs @@ -0,0 +1,193 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Capitalization + /// + [DataContract] + public partial class Capitalization : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name="smallCamel", EmitDefaultValue=false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name="CapitalCamel", EmitDefaultValue=false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name="small_Snake", EmitDefaultValue=false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name="Capital_Snake", EmitDefaultValue=false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name="SCA_ETH_Flow_Points", EmitDefaultValue=false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name="ATT_NAME", EmitDefaultValue=false)] + public string ATT_NAME { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Capitalization); + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + if (input == null) + return false; + + return + ( + this.SmallCamel == input.SmallCamel || + (this.SmallCamel != null && + this.SmallCamel.Equals(input.SmallCamel)) + ) && + ( + this.CapitalCamel == input.CapitalCamel || + (this.CapitalCamel != null && + this.CapitalCamel.Equals(input.CapitalCamel)) + ) && + ( + this.SmallSnake == input.SmallSnake || + (this.SmallSnake != null && + this.SmallSnake.Equals(input.SmallSnake)) + ) && + ( + this.CapitalSnake == input.CapitalSnake || + (this.CapitalSnake != null && + this.CapitalSnake.Equals(input.CapitalSnake)) + ) && + ( + this.SCAETHFlowPoints == input.SCAETHFlowPoints || + (this.SCAETHFlowPoints != null && + this.SCAETHFlowPoints.Equals(input.SCAETHFlowPoints)) + ) && + ( + this.ATT_NAME == input.ATT_NAME || + (this.ATT_NAME != null && + this.ATT_NAME.Equals(input.ATT_NAME)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + if (this.CapitalCamel != null) + hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + if (this.SmallSnake != null) + hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + if (this.CapitalSnake != null) + hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + if (this.SCAETHFlowPoints != null) + hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + if (this.ATT_NAME != null) + hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Cat.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Cat.cs new file mode 100644 index 00000000000..015746e47c4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Cat.cs @@ -0,0 +1,118 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Cat + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() { } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public Cat(bool? declawed = default(bool?), string className = "Cat", string color = "red") : base(className, color) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Cat); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Category.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Category.cs new file mode 100644 index 00000000000..bd820603f5c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Category.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Category + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Category(long? id = default(long?), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Category); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs new file mode 100644 index 00000000000..9c01449fd88 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract] + public partial class ClassModel : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="_class", EmitDefaultValue=false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ClassModel); + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + if (input == null) + return false; + + return + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Dog.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Dog.cs new file mode 100644 index 00000000000..07cb7d55fa1 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Dog.cs @@ -0,0 +1,118 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Dog + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() { } + /// + /// Initializes a new instance of the class. + /// + /// breed. + public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Dog); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumArrays.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumArrays.cs new file mode 100644 index 00000000000..0642bfe93ba --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumArrays.cs @@ -0,0 +1,169 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// EnumArrays + /// + [DataContract] + public partial class EnumArrays : IEquatable + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + } + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name="just_symbol", EmitDefaultValue=false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + } + + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name="array_enum", EmitDefaultValue=false)] + public List ArrayEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + } + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumArrays); + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + if (input == null) + return false; + + return + ( + this.JustSymbol == input.JustSymbol || + (this.JustSymbol != null && + this.JustSymbol.Equals(input.JustSymbol)) + ) && + ( + this.ArrayEnum == input.ArrayEnum || + this.ArrayEnum != null && + this.ArrayEnum.SequenceEqual(input.ArrayEnum) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.JustSymbol != null) + hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); + if (this.ArrayEnum != null) + hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumClass.cs new file mode 100644 index 00000000000..0b01aac7d4a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumClass.cs @@ -0,0 +1,53 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Defines EnumClass + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum EnumClass + { + + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumTest.cs new file mode 100644 index 00000000000..9669d139018 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/EnumTest.cs @@ -0,0 +1,280 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// EnumTest + /// + [DataContract] + public partial class EnumTest : IEquatable + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + } + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name="enum_string", EmitDefaultValue=false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + } + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name="enum_string_required", EmitDefaultValue=false)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + + /// + /// Enum NUMBER_1 for value: 1 + /// + + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + + NUMBER_MINUS_1 = -1 + } + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name="enum_integer", EmitDefaultValue=false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name="enum_number", EmitDefaultValue=false)] + public EnumNumberEnum? EnumNumber { get; set; } + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name="outerEnum", EmitDefaultValue=false)] + public OuterEnum? OuterEnum { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() { } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumNumber. + /// outerEnum. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + { + // to ensure "enumStringRequired" is required (not null) + if (enumStringRequired == null) + { + throw new InvalidDataException("enumStringRequired is a required property for EnumTest and cannot be null"); + } + else + { + this.EnumStringRequired = enumStringRequired; + } + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + } + + + + + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumTest); + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + if (input == null) + return false; + + return + ( + this.EnumString == input.EnumString || + (this.EnumString != null && + this.EnumString.Equals(input.EnumString)) + ) && + ( + this.EnumStringRequired == input.EnumStringRequired || + (this.EnumStringRequired != null && + this.EnumStringRequired.Equals(input.EnumStringRequired)) + ) && + ( + this.EnumInteger == input.EnumInteger || + (this.EnumInteger != null && + this.EnumInteger.Equals(input.EnumInteger)) + ) && + ( + this.EnumNumber == input.EnumNumber || + (this.EnumNumber != null && + this.EnumNumber.Equals(input.EnumNumber)) + ) && + ( + this.OuterEnum == input.OuterEnum || + (this.OuterEnum != null && + this.OuterEnum.Equals(input.OuterEnum)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EnumString != null) + hashCode = hashCode * 59 + this.EnumString.GetHashCode(); + if (this.EnumStringRequired != null) + hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); + if (this.EnumInteger != null) + hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); + if (this.EnumNumber != null) + hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); + if (this.OuterEnum != null) + hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs new file mode 100644 index 00000000000..d7af9916a9f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs @@ -0,0 +1,342 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// FormatTest + /// + [DataContract] + public partial class FormatTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() { } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// int64. + /// number (required). + /// _float. + /// _double. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), byte[] binary = default(byte[]), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + { + // to ensure "number" is required (not null) + if (number == null) + { + throw new InvalidDataException("number is a required property for FormatTest and cannot be null"); + } + else + { + this.Number = number; + } + // to ensure "_byte" is required (not null) + if (_byte == null) + { + throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null"); + } + else + { + this.Byte = _byte; + } + // to ensure "date" is required (not null) + if (date == null) + { + throw new InvalidDataException("date is a required property for FormatTest and cannot be null"); + } + else + { + this.Date = date; + } + // to ensure "password" is required (not null) + if (password == null) + { + throw new InvalidDataException("password is a required property for FormatTest and cannot be null"); + } + else + { + this.Password = password; + } + this.Integer = integer; + this.Int32 = int32; + this.Int64 = int64; + this.Float = _float; + this.Double = _double; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name="integer", EmitDefaultValue=false)] + public int? Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name="int32", EmitDefaultValue=false)] + public int? Int32 { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name="int64", EmitDefaultValue=false)] + public long? Int64 { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name="number", EmitDefaultValue=false)] + public decimal? Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name="float", EmitDefaultValue=false)] + public float? Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name="double", EmitDefaultValue=false)] + public double? Double { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name="string", EmitDefaultValue=false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name="byte", EmitDefaultValue=false)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name="binary", EmitDefaultValue=false)] + public byte[] Binary { get; set; } + + /// + /// Gets or Sets Date + /// + [DataMember(Name="date", EmitDefaultValue=false)] + [JsonConverter(typeof(SwaggerDateConverter))] + public DateTime? Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime? DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid", EmitDefaultValue=false)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FormatTest); + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + if (input == null) + return false; + + return + ( + this.Integer == input.Integer || + (this.Integer != null && + this.Integer.Equals(input.Integer)) + ) && + ( + this.Int32 == input.Int32 || + (this.Int32 != null && + this.Int32.Equals(input.Int32)) + ) && + ( + this.Int64 == input.Int64 || + (this.Int64 != null && + this.Int64.Equals(input.Int64)) + ) && + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) + ) && + ( + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) + ) && + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ) && + ( + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) + ) && + ( + this.Binary == input.Binary || + (this.Binary != null && + this.Binary.Equals(input.Binary)) + ) && + ( + this.Date == input.Date || + (this.Date != null && + this.Date.Equals(input.Date)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Integer != null) + hashCode = hashCode * 59 + this.Integer.GetHashCode(); + if (this.Int32 != null) + hashCode = hashCode * 59 + this.Int32.GetHashCode(); + if (this.Int64 != null) + hashCode = hashCode * 59 + this.Int64.GetHashCode(); + if (this.Number != null) + hashCode = hashCode * 59 + this.Number.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); + if (this.Binary != null) + hashCode = hashCode * 59 + this.Binary.GetHashCode(); + if (this.Date != null) + hashCode = hashCode * 59 + this.Date.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Uuid != null) + hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..e19333c9aff --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/HasOnlyReadOnly.cs @@ -0,0 +1,125 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract] + public partial class HasOnlyReadOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { get; private set; } + + /// + /// Gets or Sets Foo + /// + [DataMember(Name="foo", EmitDefaultValue=false)] + public string Foo { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as HasOnlyReadOnly); + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Foo == input.Foo || + (this.Foo != null && + this.Foo.Equals(input.Foo)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + if (this.Foo != null) + hashCode = hashCode * 59 + this.Foo.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..701fd9030b2 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/List.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/List.cs new file mode 100644 index 00000000000..8e584d1d945 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/List.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// List + /// + [DataContract] + public partial class List : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _123List. + public List(string _123List = default(string)) + { + this._123List = _123List; + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name="123-list", EmitDefaultValue=false)] + public string _123List { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as List); + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + if (input == null) + return false; + + return + ( + this._123List == input._123List || + (this._123List != null && + this._123List.Equals(input._123List)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + hashCode = hashCode * 59 + this._123List.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/MapTest.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/MapTest.cs new file mode 100644 index 00000000000..598f2309c81 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/MapTest.cs @@ -0,0 +1,149 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// MapTest + /// + [DataContract] + public partial class MapTest : IEquatable + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + } + + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name="map_of_enum_string", EmitDefaultValue=false)] + public Dictionary MapOfEnumString { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name="map_map_of_string", EmitDefaultValue=false)] + public Dictionary> MapMapOfString { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MapTest); + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + if (input == null) + return false; + + return + ( + this.MapMapOfString == input.MapMapOfString || + this.MapMapOfString != null && + this.MapMapOfString.SequenceEqual(input.MapMapOfString) + ) && + ( + this.MapOfEnumString == input.MapOfEnumString || + this.MapOfEnumString != null && + this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); + if (this.MapOfEnumString != null) + hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..b3ee6f35e6c --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + { + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name="uuid", EmitDefaultValue=false)] + public Guid? Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name="dateTime", EmitDefaultValue=false)] + public DateTime? DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name="map", EmitDefaultValue=false)] + public Dictionary Map { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MixedPropertiesAndAdditionalPropertiesClass); + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + if (input == null) + return false; + + return + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Map == input.Map || + this.Map != null && + this.Map.SequenceEqual(input.Map) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + if (this.DateTime != null) + hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + if (this.Map != null) + hashCode = hashCode * 59 + this.Map.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs new file mode 100644 index 00000000000..3bf31b5e40f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract] + public partial class Model200Response : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int? name = default(int?), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public int? Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name="class", EmitDefaultValue=false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Model200Response); + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs new file mode 100644 index 00000000000..909c4ead55a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ModelClient + /// + [DataContract] + public partial class ModelClient : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this.__Client = _client; + } + + /// + /// Gets or Sets __Client + /// + [DataMember(Name="client", EmitDefaultValue=false)] + public string __Client { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ModelClient); + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + if (input == null) + return false; + + return + ( + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Name.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Name.cs new file mode 100644 index 00000000000..414ed11b7a3 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Name.cs @@ -0,0 +1,169 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract] + public partial class Name : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int? name = default(int?), string property = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Name and cannot be null"); + } + else + { + this._Name = name; + } + this.Property = property; + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public int? _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name="snake_case", EmitDefaultValue=false)] + public int? SnakeCase { get; private set; } + + /// + /// Gets or Sets Property + /// + [DataMember(Name="property", EmitDefaultValue=false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name="123Number", EmitDefaultValue=false)] + public int? _123Number { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Name); + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + if (input == null) + return false; + + return + ( + this._Name == input._Name || + (this._Name != null && + this._Name.Equals(input._Name)) + ) && + ( + this.SnakeCase == input.SnakeCase || + (this.SnakeCase != null && + this.SnakeCase.Equals(input.SnakeCase)) + ) && + ( + this.Property == input.Property || + (this.Property != null && + this.Property.Equals(input.Property)) + ) && + ( + this._123Number == input._123Number || + (this._123Number != null && + this._123Number.Equals(input._123Number)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Name != null) + hashCode = hashCode * 59 + this._Name.GetHashCode(); + if (this.SnakeCase != null) + hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + if (this.Property != null) + hashCode = hashCode * 59 + this.Property.GetHashCode(); + if (this._123Number != null) + hashCode = hashCode * 59 + this._123Number.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/NumberOnly.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/NumberOnly.cs new file mode 100644 index 00000000000..05958dc3fd4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/NumberOnly.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// NumberOnly + /// + [DataContract] + public partial class NumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal? justNumber = default(decimal?)) + { + this.JustNumber = justNumber; + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name="JustNumber", EmitDefaultValue=false)] + public decimal? JustNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NumberOnly); + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + if (input == null) + return false; + + return + ( + this.JustNumber == input.JustNumber || + (this.JustNumber != null && + this.JustNumber.Equals(input.JustNumber)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.JustNumber != null) + hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..b5167fbd27e --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Order.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Order.cs new file mode 100644 index 00000000000..7f0ae101aa4 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Order.cs @@ -0,0 +1,228 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Order + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + // use default value if no "complete" provided + if (complete == null) + { + this.Complete = false; + } + else + { + this.Complete = complete; + } + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=false)] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=false)] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=false)] + public DateTime? ShipDate { get; set; } + + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=false)] + public bool? Complete { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Order); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.PetId == input.PetId || + (this.PetId != null && + this.PetId.Equals(input.PetId)) + ) && + ( + this.Quantity == input.Quantity || + (this.Quantity != null && + this.Quantity.Equals(input.Quantity)) + ) && + ( + this.ShipDate == input.ShipDate || + (this.ShipDate != null && + this.ShipDate.Equals(input.ShipDate)) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ) && + ( + this.Complete == input.Complete || + (this.Complete != null && + this.Complete.Equals(input.Complete)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.PetId != null) + hashCode = hashCode * 59 + this.PetId.GetHashCode(); + if (this.Quantity != null) + hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + if (this.Complete != null) + hashCode = hashCode * 59 + this.Complete.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/OuterComposite.cs new file mode 100644 index 00000000000..824de8cf988 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/OuterComposite.cs @@ -0,0 +1,144 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// OuterComposite + /// + [DataContract] + public partial class OuterComposite : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name="my_number", EmitDefaultValue=false)] + public decimal? MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name="my_string", EmitDefaultValue=false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name="my_boolean", EmitDefaultValue=false)] + public bool? MyBoolean { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + if (input == null) + return false; + + return + ( + this.MyNumber == input.MyNumber || + (this.MyNumber != null && + this.MyNumber.Equals(input.MyNumber)) + ) && + ( + this.MyString == input.MyString || + (this.MyString != null && + this.MyString.Equals(input.MyString)) + ) && + ( + this.MyBoolean == input.MyBoolean || + (this.MyBoolean != null && + this.MyBoolean.Equals(input.MyBoolean)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MyNumber != null) + hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + if (this.MyString != null) + hashCode = hashCode * 59 + this.MyString.GetHashCode(); + if (this.MyBoolean != null) + hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/OuterEnum.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/OuterEnum.cs new file mode 100644 index 00000000000..44466ce5ba0 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/OuterEnum.cs @@ -0,0 +1,53 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Defines OuterEnum + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnum + { + + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Pet.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Pet.cs new file mode 100644 index 00000000000..4d41431009a --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Pet.cs @@ -0,0 +1,241 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Pet + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Pet and cannot be null"); + } + else + { + this.Name = name; + } + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) + { + throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null"); + } + else + { + this.PhotoUrls = photoUrls; + } + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Pet); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PhotoUrls == input.PhotoUrls || + this.PhotoUrls != null && + this.PhotoUrls.SequenceEqual(input.PhotoUrls) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Status == input.Status || + (this.Status != null && + this.Status.Equals(input.Status)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Category != null) + hashCode = hashCode * 59 + this.Category.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.PhotoUrls != null) + hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..e2e49cce78f --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/ReadOnlyFirst.cs @@ -0,0 +1,126 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract] + public partial class ReadOnlyFirst : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name="bar", EmitDefaultValue=false)] + public string Bar { get; private set; } + + /// + /// Gets or Sets Baz + /// + [DataMember(Name="baz", EmitDefaultValue=false)] + public string Baz { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ReadOnlyFirst); + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + if (input == null) + return false; + + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Baz == input.Baz || + (this.Baz != null && + this.Baz.Equals(input.Baz)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + hashCode = hashCode * 59 + this.Bar.GetHashCode(); + if (this.Baz != null) + hashCode = hashCode * 59 + this.Baz.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs new file mode 100644 index 00000000000..e2a3377dd3b --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int? _return = default(int?)) + { + this._Return = _return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/SpecialModelName.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/SpecialModelName.cs new file mode 100644 index 00000000000..d18791b0f91 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/SpecialModelName.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// SpecialModelName + /// + [DataContract] + public partial class SpecialModelName : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + public SpecialModelName(long? specialPropertyName = default(long?)) + { + this.SpecialPropertyName = specialPropertyName; + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] + public long? SpecialPropertyName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SpecialModelName); + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + if (input == null) + return false; + + return + ( + this.SpecialPropertyName == input.SpecialPropertyName || + (this.SpecialPropertyName != null && + this.SpecialPropertyName.Equals(input.SpecialPropertyName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SpecialPropertyName != null) + hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Tag.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Tag.cs new file mode 100644 index 00000000000..0c25af135a7 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/Tag.cs @@ -0,0 +1,128 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Tag + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long? id = default(long?), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Tag); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/User.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/User.cs new file mode 100644 index 00000000000..6c5fb9fb311 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Model/User.cs @@ -0,0 +1,225 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// User + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=false)] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=false)] + public int? UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as User); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Username == input.Username || + (this.Username != null && + this.Username.Equals(input.Username)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.Email == input.Email || + (this.Email != null && + this.Email.Equals(input.Email)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Phone == input.Phone || + (this.Phone != null && + this.Phone.Equals(input.Phone)) + ) && + ( + this.UserStatus == input.UserStatus || + (this.UserStatus != null && + this.UserStatus.Equals(input.UserStatus)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Username != null) + hashCode = hashCode * 59 + this.Username.GetHashCode(); + if (this.FirstName != null) + hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + if (this.LastName != null) + hashCode = hashCode * 59 + this.LastName.GetHashCode(); + if (this.Email != null) + hashCode = hashCode * 59 + this.Email.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Phone != null) + hashCode = hashCode * 59 + this.Phone.GetHashCode(); + if (this.UserStatus != null) + hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Properties/AssemblyInfo.cs b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..f3b9f7d1d14 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Swagger Library")] +[assembly: AssemblyDescription("A library generated from a Swagger doc")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Swagger")] +[assembly: AssemblyProduct("SwaggerLibrary")] +[assembly: AssemblyCopyright("No Copyright")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] diff --git a/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/project.json b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/project.json new file mode 100644 index 00000000000..d5d3017c216 --- /dev/null +++ b/samples/client/petstore/csharp/httpClient/SwaggerClientNetStandard/src/IO.Swagger/project.json @@ -0,0 +1,12 @@ +{ + "supports": {}, + "dependencies": { + "FubarCoder.RestSharp.Portable.Core": "4.0.7", + "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7", + "Newtonsoft.Json": "10.0.3", + "JsonSubTypes": "1.2.0" + }, + "frameworks": { + "netstandard1.3": {} + } +} \ No newline at end of file