forked from loafle/openapi-generator-original
C# Netcore WebRequest and HttpClient functionality (#8821)
* Add switch to disable RestSharp * Introduce CLI Option for webRequestLibrary * Fix missing brace * Remove restsharp references * HttpClient added * WebRequest NewRequest functionality added * WebRequest added to CLIOptions * Add custom HttpMethod only for Restsharp. * Add WebRequestPathBuilder.mustache * HttpClient NewRequest * Add using Statement to WebRequestPathBuilder.mustache * Adjusts retry configuration for HttpClient * Reuse JsonDecoder * Make reusing the client a separate option * Save cookies in request * Implement more methods for HttpClient * Small fixes * Fix post content * Add new sample config * Update existing samples * Add new sample * Add new property supportsRetry * Use new property to exclude RetryConfiguration * Exclude Polly on non supporting Retry * Update sample and documentation * Create HttpMethod Patch for netstandard 2.0 compatibility * Fix query parameter generation * Switch to library settings * Allow httpclient reuse (experimental) * Remove webrequest from template as its not used right now
This commit is contained in:
parent
5a0b832bb4
commit
e815d7ced8
12
bin/configs/csharp-netcore-OpenAPIClient-httpclient.yaml
Normal file
12
bin/configs/csharp-netcore-OpenAPIClient-httpclient.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# for .net standard httpclient
|
||||||
|
generatorName: csharp-netcore
|
||||||
|
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/csharp-netcore
|
||||||
|
library: httpclient
|
||||||
|
additionalProperties:
|
||||||
|
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
|
||||||
|
useCompareNetObjects: true
|
||||||
|
disallowAdditionalPropertiesIfNotPresent: false
|
||||||
|
useOneOfDiscriminatorLookup: true
|
||||||
|
targetFramework: netstandard2.1
|
@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|
||||||
|
|library|HTTP library template (sub-template) to use|<dl><dt>**httpclient**</dt><dd>HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Beta support)</dd><dt>**restsharp**</dt><dd>RestSharp (https://github.com/restsharp/RestSharp)</dd></dl>|restsharp|
|
||||||
|licenseId|The identifier of the license| |null|
|
|licenseId|The identifier of the license| |null|
|
||||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
|
||||||
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|
||||||
|
@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableMap;
|
|||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
import org.openapitools.codegen.utils.ModelUtils;
|
||||||
@ -42,9 +43,14 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
// Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget
|
// Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget
|
||||||
protected static final String MCS_NET_VERSION_KEY = "x-mcs-sdk";
|
protected static final String MCS_NET_VERSION_KEY = "x-mcs-sdk";
|
||||||
protected static final String SUPPORTS_UWP = "supportsUWP";
|
protected static final String SUPPORTS_UWP = "supportsUWP";
|
||||||
|
protected static final String SUPPORTS_RETRY = "supportsRetry";
|
||||||
|
|
||||||
protected static final String NET_STANDARD = "netStandard";
|
protected static final String NET_STANDARD = "netStandard";
|
||||||
|
|
||||||
|
// HTTP libraries
|
||||||
|
protected static final String RESTSHARP = "restsharp";
|
||||||
|
protected static final String HTTPCLIENT = "httpclient";
|
||||||
|
|
||||||
// Project Variable, determined from target framework. Not intended to be user-settable.
|
// Project Variable, determined from target framework. Not intended to be user-settable.
|
||||||
protected static final String TARGET_FRAMEWORK_IDENTIFIER = "targetFrameworkIdentifier";
|
protected static final String TARGET_FRAMEWORK_IDENTIFIER = "targetFrameworkIdentifier";
|
||||||
// Project Variable, determined from target framework. Not intended to be user-settable.
|
// Project Variable, determined from target framework. Not intended to be user-settable.
|
||||||
@ -80,6 +86,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
// Defines nuget identifiers for target framework
|
// Defines nuget identifiers for target framework
|
||||||
protected String targetFrameworkNuget = targetFramework;
|
protected String targetFrameworkNuget = targetFramework;
|
||||||
|
|
||||||
|
protected boolean supportsRetry = Boolean.TRUE;
|
||||||
protected boolean supportsAsync = Boolean.TRUE;
|
protected boolean supportsAsync = Boolean.TRUE;
|
||||||
protected boolean netStandard = Boolean.FALSE;
|
protected boolean netStandard = Boolean.FALSE;
|
||||||
|
|
||||||
@ -94,6 +101,9 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
protected String packageTags;
|
protected String packageTags;
|
||||||
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
||||||
|
|
||||||
|
protected boolean needsCustomHttpMethod = false;
|
||||||
|
protected boolean needsUriBuilder = false;
|
||||||
|
|
||||||
public CSharpNetCoreClientCodegen() {
|
public CSharpNetCoreClientCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -290,6 +300,16 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
regexModifiers.put('m', "Multiline");
|
regexModifiers.put('m', "Multiline");
|
||||||
regexModifiers.put('s', "Singleline");
|
regexModifiers.put('s', "Singleline");
|
||||||
regexModifiers.put('x', "IgnorePatternWhitespace");
|
regexModifiers.put('x', "IgnorePatternWhitespace");
|
||||||
|
|
||||||
|
supportedLibraries.put(HTTPCLIENT, "HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Beta support)");
|
||||||
|
supportedLibraries.put(RESTSHARP, "RestSharp (https://github.com/restsharp/RestSharp)");
|
||||||
|
|
||||||
|
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use");
|
||||||
|
libraryOption.setEnum(supportedLibraries);
|
||||||
|
// set RESTSHARP as the default
|
||||||
|
libraryOption.setDefault(RESTSHARP);
|
||||||
|
cliOptions.add(libraryOption);
|
||||||
|
setLibrary(RESTSHARP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -556,8 +576,17 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
if (isEmpty(modelPackage)) {
|
if (isEmpty(modelPackage)) {
|
||||||
setModelPackage("Model");
|
setModelPackage("Model");
|
||||||
}
|
}
|
||||||
|
|
||||||
clientPackage = "Client";
|
clientPackage = "Client";
|
||||||
|
|
||||||
|
if (RESTSHARP.equals(getLibrary())) {
|
||||||
|
additionalProperties.put("useRestSharp", true);
|
||||||
|
needsCustomHttpMethod = true;
|
||||||
|
} else if (HTTPCLIENT.equals(getLibrary())) {
|
||||||
|
additionalProperties.put("useHttpClient", true);
|
||||||
|
needsUriBuilder = true;
|
||||||
|
}
|
||||||
|
|
||||||
String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name);
|
String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name);
|
||||||
boolean strategyMatched = false;
|
boolean strategyMatched = false;
|
||||||
FrameworkStrategy strategy = defaultFramework;
|
FrameworkStrategy strategy = defaultFramework;
|
||||||
@ -614,6 +643,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
|
|
||||||
syncBooleanProperty(additionalProperties, CodegenConstants.VALIDATABLE, this::setValidatable, this.validatable);
|
syncBooleanProperty(additionalProperties, CodegenConstants.VALIDATABLE, this::setValidatable, this.validatable);
|
||||||
syncBooleanProperty(additionalProperties, CodegenConstants.SUPPORTS_ASYNC, this::setSupportsAsync, this.supportsAsync);
|
syncBooleanProperty(additionalProperties, CodegenConstants.SUPPORTS_ASYNC, this::setSupportsAsync, this.supportsAsync);
|
||||||
|
syncBooleanProperty(additionalProperties, SUPPORTS_RETRY, this::setSupportsRetry, this.supportsRetry);
|
||||||
syncBooleanProperty(additionalProperties, CodegenConstants.OPTIONAL_METHOD_ARGUMENT, this::setOptionalMethodArgumentFlag, optionalMethodArgumentFlag);
|
syncBooleanProperty(additionalProperties, CodegenConstants.OPTIONAL_METHOD_ARGUMENT, this::setOptionalMethodArgumentFlag, optionalMethodArgumentFlag);
|
||||||
syncBooleanProperty(additionalProperties, CodegenConstants.NON_PUBLIC_API, this::setNonPublicApi, isNonPublicApi());
|
syncBooleanProperty(additionalProperties, CodegenConstants.NON_PUBLIC_API, this::setNonPublicApi, isNonPublicApi());
|
||||||
syncBooleanProperty(additionalProperties, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup, this.useOneOfDiscriminatorLookup);
|
syncBooleanProperty(additionalProperties, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup, this.useOneOfDiscriminatorLookup);
|
||||||
@ -644,7 +674,12 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("ExceptionFactory.mustache", clientPackageDir, "ExceptionFactory.cs"));
|
supportingFiles.add(new SupportingFile("ExceptionFactory.mustache", clientPackageDir, "ExceptionFactory.cs"));
|
||||||
supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs"));
|
supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs"));
|
||||||
supportingFiles.add(new SupportingFile("ClientUtils.mustache", clientPackageDir, "ClientUtils.cs"));
|
supportingFiles.add(new SupportingFile("ClientUtils.mustache", clientPackageDir, "ClientUtils.cs"));
|
||||||
|
if(needsCustomHttpMethod) {
|
||||||
supportingFiles.add(new SupportingFile("HttpMethod.mustache", clientPackageDir, "HttpMethod.cs"));
|
supportingFiles.add(new SupportingFile("HttpMethod.mustache", clientPackageDir, "HttpMethod.cs"));
|
||||||
|
}
|
||||||
|
if(needsUriBuilder) {
|
||||||
|
supportingFiles.add(new SupportingFile("WebRequestPathBuilder.mustache", clientPackageDir, "WebRequestPathBuilder.cs"));
|
||||||
|
}
|
||||||
if (ProcessUtils.hasHttpSignatureMethods(openAPI)) {
|
if (ProcessUtils.hasHttpSignatureMethods(openAPI)) {
|
||||||
supportingFiles.add(new SupportingFile("HttpSigningConfiguration.mustache", clientPackageDir, "HttpSigningConfiguration.cs"));
|
supportingFiles.add(new SupportingFile("HttpSigningConfiguration.mustache", clientPackageDir, "HttpSigningConfiguration.cs"));
|
||||||
}
|
}
|
||||||
@ -654,7 +689,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("ISynchronousClient.mustache", clientPackageDir, "ISynchronousClient.cs"));
|
supportingFiles.add(new SupportingFile("ISynchronousClient.mustache", clientPackageDir, "ISynchronousClient.cs"));
|
||||||
supportingFiles.add(new SupportingFile("RequestOptions.mustache", clientPackageDir, "RequestOptions.cs"));
|
supportingFiles.add(new SupportingFile("RequestOptions.mustache", clientPackageDir, "RequestOptions.cs"));
|
||||||
supportingFiles.add(new SupportingFile("Multimap.mustache", clientPackageDir, "Multimap.cs"));
|
supportingFiles.add(new SupportingFile("Multimap.mustache", clientPackageDir, "Multimap.cs"));
|
||||||
|
|
||||||
|
if (supportsRetry) {
|
||||||
supportingFiles.add(new SupportingFile("RetryConfiguration.mustache", clientPackageDir, "RetryConfiguration.cs"));
|
supportingFiles.add(new SupportingFile("RetryConfiguration.mustache", clientPackageDir, "RetryConfiguration.cs"));
|
||||||
|
}
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("IReadableConfiguration.mustache",
|
supportingFiles.add(new SupportingFile("IReadableConfiguration.mustache",
|
||||||
clientPackageDir, "IReadableConfiguration.cs"));
|
clientPackageDir, "IReadableConfiguration.cs"));
|
||||||
@ -717,6 +755,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
|||||||
this.supportsAsync = supportsAsync;
|
this.supportsAsync = supportsAsync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSupportsRetry(Boolean supportsRetry) {
|
||||||
|
this.supportsRetry = supportsRetry;
|
||||||
|
}
|
||||||
|
|
||||||
public void setTargetFramework(String dotnetFramework) {
|
public void setTargetFramework(String dotnetFramework) {
|
||||||
if (!frameworks.containsKey(dotnetFramework)) {
|
if (!frameworks.containsKey(dotnetFramework)) {
|
||||||
throw new IllegalArgumentException("Invalid .NET framework version: " +
|
throw new IllegalArgumentException("Invalid .NET framework version: " +
|
||||||
|
@ -19,18 +19,28 @@ using System.Web;
|
|||||||
{{/netStandard}}
|
{{/netStandard}}
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Serialization;
|
using Newtonsoft.Json.Serialization;
|
||||||
|
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
||||||
|
{{#useRestSharp}}
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
using RestSharp.Deserializers;
|
using RestSharp.Deserializers;
|
||||||
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
|
||||||
using RestSharpMethod = RestSharp.Method;
|
using RestSharpMethod = RestSharp.Method;
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useWebRequest}}
|
||||||
|
using System.Net.Http;
|
||||||
|
{{/useWebRequest}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
using System.Net.Http;
|
||||||
|
{{/useHttpClient}}
|
||||||
|
{{#supportsRetry}}
|
||||||
using Polly;
|
using Polly;
|
||||||
|
{{/supportsRetry}}
|
||||||
|
|
||||||
namespace {{packageName}}.Client
|
namespace {{packageName}}.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
|
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer
|
internal class CustomJsonCodec {{#useRestSharp}} : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer {{/useRestSharp}}
|
||||||
{
|
{
|
||||||
private readonly IReadableConfiguration _configuration;
|
private readonly IReadableConfiguration _configuration;
|
||||||
private static readonly string _contentType = "application/json";
|
private static readonly string _contentType = "application/json";
|
||||||
@ -76,7 +86,12 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{#useRestSharp}}
|
||||||
public T Deserialize<T>(IRestResponse response)
|
public T Deserialize<T>(IRestResponse response)
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
public T Deserialize<T>(HttpResponseMessage response)
|
||||||
|
{{/useHttpClient}}
|
||||||
{
|
{
|
||||||
var result = (T)Deserialize(response, typeof(T));
|
var result = (T)Deserialize(response, typeof(T));
|
||||||
return result;
|
return result;
|
||||||
@ -88,17 +103,36 @@ namespace {{packageName}}.Client
|
|||||||
/// <param name="response">The HTTP response.</param>
|
/// <param name="response">The HTTP response.</param>
|
||||||
/// <param name="type">Object type.</param>
|
/// <param name="type">Object type.</param>
|
||||||
/// <returns>Object representation of the JSON string.</returns>
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
|
{{#useRestSharp}}
|
||||||
internal object Deserialize(IRestResponse response, Type type)
|
internal object Deserialize(IRestResponse response, Type type)
|
||||||
{
|
{
|
||||||
IList<Parameter> headers = response.Headers;
|
IList<Parameter> headers = response.Headers;
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
internal object Deserialize(HttpResponseMessage response, Type type)
|
||||||
|
{
|
||||||
|
IList<string> headers = response.Headers.Select(x => x.Key + "=" + x.Value).ToList();
|
||||||
|
{{/useHttpClient}}
|
||||||
|
|
||||||
if (type == typeof(byte[])) // return byte array
|
if (type == typeof(byte[])) // return byte array
|
||||||
{
|
{
|
||||||
|
{{#useRestSharp}}
|
||||||
return response.RawBytes;
|
return response.RawBytes;
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
return response.Content.ReadAsByteArrayAsync().Result;
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
|
// TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
|
||||||
if (type == typeof(Stream))
|
if (type == typeof(Stream))
|
||||||
{
|
{
|
||||||
|
{{#useRestSharp}}
|
||||||
|
var bytes = response.RawBytes;
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
var bytes = response.Content.ReadAsByteArrayAsync().Result;
|
||||||
|
{{/useHttpClient}}
|
||||||
if (headers != null)
|
if (headers != null)
|
||||||
{
|
{
|
||||||
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
@ -111,29 +145,44 @@ namespace {{packageName}}.Client
|
|||||||
if (match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
|
string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
|
||||||
File.WriteAllBytes(fileName, response.RawBytes);
|
File.WriteAllBytes(fileName, bytes);
|
||||||
return new FileStream(fileName, FileMode.Open);
|
return new FileStream(fileName, FileMode.Open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var stream = new MemoryStream(response.RawBytes);
|
var stream = new MemoryStream(bytes);
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
|
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
|
||||||
{
|
{
|
||||||
|
{{#useRestSharp}}
|
||||||
return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind);
|
return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind);
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
return DateTime.Parse(response.Content.ReadAsStringAsync().Result, null, System.Globalization.DateTimeStyles.RoundtripKind);
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type
|
if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type
|
||||||
{
|
{
|
||||||
|
{{#useRestSharp}}
|
||||||
return Convert.ChangeType(response.Content, type);
|
return Convert.ChangeType(response.Content, type);
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
return Convert.ChangeType(response.Content.ReadAsStringAsync().Result, type);
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point, it must be a model (json)
|
// at this point, it must be a model (json)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
{{#useRestSharp}}
|
||||||
return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
|
return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result, type, _serializerSettings);
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -159,6 +208,12 @@ namespace {{packageName}}.Client
|
|||||||
{{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}}
|
{{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}}
|
||||||
{
|
{
|
||||||
private readonly String _baseUrl;
|
private readonly String _baseUrl;
|
||||||
|
{{#useHttpClient}}
|
||||||
|
{{#reUseHttpClient}}
|
||||||
|
private readonly HttpClientHandler _httpClientHandler;
|
||||||
|
private readonly HttpClient _httpClient;
|
||||||
|
{{/reUseHttpClient}}
|
||||||
|
{{/useHttpClient}}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
||||||
@ -176,7 +231,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
{{#useRestSharp}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows for extending request processing for <see cref="ApiClient"/> generated code.
|
/// Allows for extending request processing for <see cref="ApiClient"/> generated code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -189,6 +244,7 @@ namespace {{packageName}}.Client
|
|||||||
/// <param name="request">The RestSharp request object</param>
|
/// <param name="request">The RestSharp request object</param>
|
||||||
/// <param name="response">The RestSharp response object</param>
|
/// <param name="response">The RestSharp response object</param>
|
||||||
partial void InterceptResponse(IRestRequest request, IRestResponse response);
|
partial void InterceptResponse(IRestRequest request, IRestResponse response);
|
||||||
|
{{/useRestSharp}}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
|
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
|
||||||
@ -196,6 +252,12 @@ namespace {{packageName}}.Client
|
|||||||
public ApiClient()
|
public ApiClient()
|
||||||
{
|
{
|
||||||
_baseUrl = {{packageName}}.Client.GlobalConfiguration.Instance.BasePath;
|
_baseUrl = {{packageName}}.Client.GlobalConfiguration.Instance.BasePath;
|
||||||
|
{{#useHttpClient}}
|
||||||
|
{{#reUseHttpClient}}
|
||||||
|
_httpClientHandler = new HttpClientHandler();
|
||||||
|
_httpClient = new HttpClient(_httpClientHandler);
|
||||||
|
{{/reUseHttpClient}}
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -209,8 +271,15 @@ namespace {{packageName}}.Client
|
|||||||
throw new ArgumentException("basePath cannot be empty");
|
throw new ArgumentException("basePath cannot be empty");
|
||||||
|
|
||||||
_baseUrl = basePath;
|
_baseUrl = basePath;
|
||||||
|
{{#useHttpClient}}
|
||||||
|
{{#reUseHttpClient}}
|
||||||
|
_httpClientHandler = new HttpClientHandler();
|
||||||
|
_httpClient = new HttpClient(_httpClientHandler);
|
||||||
|
{{/reUseHttpClient}}
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{#useRestSharp}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs the RestSharp version of an http method
|
/// Constructs the RestSharp version of an http method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -521,8 +590,258 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
{{/useRestSharp}}
|
||||||
|
|
||||||
|
{{#useHttpClient}}
|
||||||
|
/// <summary>
|
||||||
|
/// Provides all logic for constructing a new HttpRequestMessage.
|
||||||
|
/// At this point, all information for querying the service is known. Here, it is simply
|
||||||
|
/// mapped into the a HttpRequestMessage.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="method">The http verb.</param>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>[private] A new HttpRequestMessage instance.</returns>
|
||||||
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
|
private HttpRequestMessage NewRequest(
|
||||||
|
HttpMethod method,
|
||||||
|
String path,
|
||||||
|
RequestOptions options,
|
||||||
|
IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
if (path == null) throw new ArgumentNullException("path");
|
||||||
|
if (options == null) throw new ArgumentNullException("options");
|
||||||
|
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||||
|
|
||||||
|
WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path);
|
||||||
|
|
||||||
|
builder.AddPathParameters(options.PathParameters);
|
||||||
|
|
||||||
|
// In case of POST or PUT pass query parameters in request body
|
||||||
|
if (method != HttpMethod.Post && method != HttpMethod.Put)
|
||||||
|
{
|
||||||
|
builder.AddQueryParameters(options.QueryParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri());
|
||||||
|
|
||||||
|
if (configuration.DefaultHeaders != null)
|
||||||
|
{
|
||||||
|
foreach (var headerParam in configuration.DefaultHeaders)
|
||||||
|
{
|
||||||
|
request.Headers.Add(headerParam.Key, headerParam.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.HeaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var headerParam in options.HeaderParameters)
|
||||||
|
{
|
||||||
|
foreach (var value in headerParam.Value)
|
||||||
|
{
|
||||||
|
// Todo make content headers actually content headers
|
||||||
|
request.Headers.TryAddWithoutValidation(headerParam.Key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Tuple<HttpContent, string, string>> contentList = new List<Tuple<HttpContent, string, string>>();
|
||||||
|
|
||||||
|
if (options.FormParameters != null && options.FormParameters.Count > 0)
|
||||||
|
{
|
||||||
|
contentList.Add(new Tuple<HttpContent, string, string>(new FormUrlEncodedContent(options.FormParameters), null, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.Data != null)
|
||||||
|
{
|
||||||
|
var serializer = new CustomJsonCodec(SerializerSettings, configuration);
|
||||||
|
contentList.Add(
|
||||||
|
new Tuple<HttpContent, string, string>(new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), "application/json"), null, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.FileParameters != null && options.FileParameters.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var fileParam in options.FileParameters)
|
||||||
|
{
|
||||||
|
var bytes = ClientUtils.ReadAsBytes(fileParam.Value);
|
||||||
|
var fileStream = fileParam.Value as FileStream;
|
||||||
|
contentList.Add(new Tuple<HttpContent, string, string>(new ByteArrayContent(bytes), fileParam.Key,
|
||||||
|
fileStream?.Name ?? "no_file_name_provided"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (contentList.Count > 1)
|
||||||
|
{
|
||||||
|
string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant();
|
||||||
|
var multipartContent = new MultipartFormDataContent(boundary);
|
||||||
|
foreach (var content in contentList)
|
||||||
|
{
|
||||||
|
if(content.Item2 != null)
|
||||||
|
{
|
||||||
|
multipartContent.Add(content.Item1, content.Item2, content.Item3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
multipartContent.Add(content.Item1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
request.Content = multipartContent;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
request.Content = contentList.FirstOrDefault()?.Item1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO provide an alternative that allows cookies per request instead of per API client
|
||||||
|
if (options.Cookies != null && options.Cookies.Count > 0)
|
||||||
|
{
|
||||||
|
request.Properties["CookieContainer"] = options.Cookies;
|
||||||
|
}
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void InterceptRequest(HttpRequestMessage req, HttpClientHandler handler);
|
||||||
|
partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response);
|
||||||
|
|
||||||
|
private ApiResponse<T> ToApiResponse<T>(HttpResponseMessage response, object responseData, HttpClientHandler handler, Uri uri)
|
||||||
|
{
|
||||||
|
T result = (T) responseData;
|
||||||
|
string rawContent = response.Content.ToString();
|
||||||
|
|
||||||
|
var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent)
|
||||||
|
{
|
||||||
|
ErrorText = response.ReasonPhrase,
|
||||||
|
Cookies = new List<Cookie>()
|
||||||
|
};
|
||||||
|
|
||||||
|
if (response.Headers != null)
|
||||||
|
{
|
||||||
|
foreach (var responseHeader in response.Headers)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
foreach (Cookie cookie in handler.CookieContainer.GetCookies(uri))
|
||||||
|
{
|
||||||
|
transformed.Cookies.Add(cookie);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return transformed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiResponse<T> Exec<T>(HttpRequestMessage req, IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
return ExecAsync<T>(req, configuration).Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<ApiResponse<T>> ExecAsync<T>(HttpRequestMessage req,
|
||||||
|
IReadableConfiguration configuration,
|
||||||
|
System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||||
|
{
|
||||||
|
{{^reUseHttpClient}}
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
var client = new HttpClient();
|
||||||
|
{{/reUseHttpClient}}
|
||||||
|
{{#reUseHttpClient}}
|
||||||
|
var handler = _httpClientHandler;
|
||||||
|
var client = _httpClient;
|
||||||
|
{{/reUseHttpClient}}
|
||||||
|
var deserializer = new CustomJsonCodec(SerializerSettings, configuration);
|
||||||
|
|
||||||
|
var finalToken = cancellationToken;
|
||||||
|
|
||||||
|
if (configuration.Timeout > 0)
|
||||||
|
{
|
||||||
|
var tokenSource = new CancellationTokenSource(configuration.Timeout);
|
||||||
|
finalToken = CancellationTokenSource.CreateLinkedTokenSource(finalToken, tokenSource.Token).Token;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configuration.Proxy != null)
|
||||||
|
{
|
||||||
|
handler.Proxy = configuration.Proxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configuration.UserAgent != null)
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", configuration.UserAgent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configuration.ClientCertificates != null)
|
||||||
|
{
|
||||||
|
handler.ClientCertificates.AddRange(configuration.ClientCertificates);
|
||||||
|
}
|
||||||
|
|
||||||
|
var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List<Cookie> : null;
|
||||||
|
|
||||||
|
if (cookieContainer != null)
|
||||||
|
{
|
||||||
|
foreach (var cookie in cookieContainer)
|
||||||
|
{
|
||||||
|
handler.CookieContainer.Add(cookie);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InterceptRequest(req, handler);
|
||||||
|
|
||||||
|
HttpResponseMessage response;
|
||||||
|
{{#supportsRetry}}
|
||||||
|
if (RetryConfiguration.AsyncRetryPolicy != null)
|
||||||
|
{
|
||||||
|
var policy = RetryConfiguration.AsyncRetryPolicy;
|
||||||
|
var policyResult = await policy
|
||||||
|
.ExecuteAndCaptureAsync(() => client.SendAsync(req, cancellationToken))
|
||||||
|
.ConfigureAwait(false);
|
||||||
|
response = (policyResult.Outcome == OutcomeType.Successful) ?
|
||||||
|
policyResult.Result : new HttpResponseMessage()
|
||||||
|
{
|
||||||
|
ReasonPhrase = policyResult.FinalException.ToString(),
|
||||||
|
RequestMessage = req
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
{{/supportsRetry}}
|
||||||
|
response = await client.SendAsync(req, cancellationToken).ConfigureAwait(false);
|
||||||
|
{{#supportsRetry}}
|
||||||
|
}
|
||||||
|
{{/supportsRetry}}
|
||||||
|
|
||||||
|
object responseData = deserializer.Deserialize<T>(response);
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
T instance = (T) Activator.CreateInstance(typeof(T));
|
||||||
|
MethodInfo method = typeof(T).GetMethod("FromJson");
|
||||||
|
method.Invoke(instance, new object[] {response.Content});
|
||||||
|
responseData = instance;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
responseData = (T) (object) await response.Content.ReadAsStreamAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
InterceptResponse(req, response);
|
||||||
|
|
||||||
|
var result = ToApiResponse<T>(response, responseData, handler, req.RequestUri);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
{{/useHttpClient}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{#supportsAsync}}
|
{{#supportsAsync}}
|
||||||
|
{{#useRestSharp}}
|
||||||
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||||
{
|
{
|
||||||
RestClient client = new RestClient(_baseUrl);
|
RestClient client = new RestClient(_baseUrl);
|
||||||
@ -573,6 +892,7 @@ namespace {{packageName}}.Client
|
|||||||
InterceptRequest(req);
|
InterceptRequest(req);
|
||||||
|
|
||||||
IRestResponse<T> response;
|
IRestResponse<T> response;
|
||||||
|
{{#supportsRetry}}
|
||||||
if (RetryConfiguration.AsyncRetryPolicy != null)
|
if (RetryConfiguration.AsyncRetryPolicy != null)
|
||||||
{
|
{
|
||||||
var policy = RetryConfiguration.AsyncRetryPolicy;
|
var policy = RetryConfiguration.AsyncRetryPolicy;
|
||||||
@ -585,8 +905,11 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
{{/supportsRetry}}
|
||||||
response = await client.ExecuteAsync<T>(req, cancellationToken).ConfigureAwait(false);
|
response = await client.ExecuteAsync<T>(req, cancellationToken).ConfigureAwait(false);
|
||||||
|
{{#supportsRetry}}
|
||||||
}
|
}
|
||||||
|
{{/supportsRetry}}
|
||||||
|
|
||||||
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
@ -637,6 +960,7 @@ namespace {{packageName}}.Client
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
{{/useRestSharp}}
|
||||||
|
|
||||||
#region IAsynchronousClient
|
#region IAsynchronousClient
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -741,7 +1065,12 @@ namespace {{packageName}}.Client
|
|||||||
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||||
{
|
{
|
||||||
var config = configuration ?? GlobalConfiguration.Instance;
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
{{#useRestSharp}}
|
||||||
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken);
|
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken);
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
return ExecAsync<T>(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken);
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
#endregion IAsynchronousClient
|
#endregion IAsynchronousClient
|
||||||
{{/supportsAsync}}
|
{{/supportsAsync}}
|
||||||
@ -842,7 +1171,12 @@ namespace {{packageName}}.Client
|
|||||||
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
{
|
{
|
||||||
var config = configuration ?? GlobalConfiguration.Instance;
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
{{#useRestSharp}}
|
||||||
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), config);
|
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), config);
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
return Exec<T>(NewRequest(new HttpMethod("PATCH"), path, options, config), config);
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
#endregion ISynchronousClient
|
#endregion ISynchronousClient
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
using Polly;
|
using Polly;
|
||||||
|
{{#useRestSharp}}
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
using System.Net.Http;
|
||||||
|
{{/useHttpClient}}
|
||||||
|
|
||||||
namespace {{packageName}}.Client
|
namespace {{packageName}}.Client
|
||||||
{
|
{
|
||||||
@ -8,6 +13,7 @@ namespace {{packageName}}.Client
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class RetryConfiguration
|
public class RetryConfiguration
|
||||||
{
|
{
|
||||||
|
{{#useRestSharp}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retry policy
|
/// Retry policy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -17,5 +23,17 @@ namespace {{packageName}}.Client
|
|||||||
/// Async retry policy
|
/// Async retry policy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static AsyncPolicy<IRestResponse> AsyncRetryPolicy { get; set; }
|
public static AsyncPolicy<IRestResponse> AsyncRetryPolicy { get; set; }
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#useHttpClient}}
|
||||||
|
/// <summary>
|
||||||
|
/// Retry policy
|
||||||
|
/// </summary>
|
||||||
|
public static Policy<HttpResponseMessage> RetryPolicy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Async retry policy
|
||||||
|
/// </summary>
|
||||||
|
public static AsyncPolicy<HttpResponseMessage> AsyncRetryPolicy { get; set; }
|
||||||
|
{{/useHttpClient}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
44
modules/openapi-generator/src/main/resources/csharp-netcore/WebRequestPathBuilder.mustache
vendored
Normal file
44
modules/openapi-generator/src/main/resources/csharp-netcore/WebRequestPathBuilder.mustache
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{{>partial_header}}
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace {{packageName}}.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A URI builder
|
||||||
|
/// </summary>
|
||||||
|
class WebRequestPathBuilder
|
||||||
|
{
|
||||||
|
private string _baseUrl;
|
||||||
|
private string _path;
|
||||||
|
private string _query = "?";
|
||||||
|
public WebRequestPathBuilder(string baseUrl, string path)
|
||||||
|
{
|
||||||
|
_baseUrl = baseUrl;
|
||||||
|
_path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddPathParameters(Dictionary<string, string> parameters)
|
||||||
|
{
|
||||||
|
foreach (var parameter in parameters)
|
||||||
|
{
|
||||||
|
_path = _path.Replace("{" + parameter.Key + "}", parameter.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddQueryParameters(Multimap<string, string> parameters)
|
||||||
|
{
|
||||||
|
foreach (var parameter in parameters)
|
||||||
|
{
|
||||||
|
foreach (var value in parameter.Value)
|
||||||
|
{
|
||||||
|
_query = _query + parameter.Key + "=" + value + "&";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetFullUri()
|
||||||
|
{
|
||||||
|
return _baseUrl + _path + _query.Substring(0, _query.Length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,9 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
{{#useRestSharp}}
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
|
{{/useRestSharp}}
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
using {{packageName}}.Client;
|
using {{packageName}}.Client;
|
||||||
|
@ -27,8 +27,12 @@
|
|||||||
{{/useCompareNetObjects}}
|
{{/useCompareNetObjects}}
|
||||||
<PackageReference Include="JsonSubTypes" Version="1.7.0" />
|
<PackageReference Include="JsonSubTypes" Version="1.7.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
|
{{#useRestSharp}}
|
||||||
<PackageReference Include="RestSharp" Version="106.11.4" />
|
<PackageReference Include="RestSharp" Version="106.11.4" />
|
||||||
|
{{/useRestSharp}}
|
||||||
|
{{#supportsRetry}}
|
||||||
<PackageReference Include="Polly" Version="7.2.0" />
|
<PackageReference Include="Polly" Version="7.2.0" />
|
||||||
|
{{/supportsRetry}}
|
||||||
{{#validatable}}
|
{{#validatable}}
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
|
||||||
{{/validatable}}
|
{{/validatable}}
|
||||||
|
362
samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.gitignore
vendored
Normal file
362
samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.gitignore
vendored
Normal file
@ -0,0 +1,362 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# 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
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# 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
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# 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 OpenAPI Generator 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
|
@ -0,0 +1,187 @@
|
|||||||
|
.gitignore
|
||||||
|
Org.OpenAPITools.sln
|
||||||
|
README.md
|
||||||
|
appveyor.yml
|
||||||
|
docs/AdditionalPropertiesClass.md
|
||||||
|
docs/Animal.md
|
||||||
|
docs/AnotherFakeApi.md
|
||||||
|
docs/ApiResponse.md
|
||||||
|
docs/Apple.md
|
||||||
|
docs/AppleReq.md
|
||||||
|
docs/ArrayOfArrayOfNumberOnly.md
|
||||||
|
docs/ArrayOfNumberOnly.md
|
||||||
|
docs/ArrayTest.md
|
||||||
|
docs/Banana.md
|
||||||
|
docs/BananaReq.md
|
||||||
|
docs/BasquePig.md
|
||||||
|
docs/Capitalization.md
|
||||||
|
docs/Cat.md
|
||||||
|
docs/CatAllOf.md
|
||||||
|
docs/Category.md
|
||||||
|
docs/ChildCat.md
|
||||||
|
docs/ChildCatAllOf.md
|
||||||
|
docs/ClassModel.md
|
||||||
|
docs/ComplexQuadrilateral.md
|
||||||
|
docs/DanishPig.md
|
||||||
|
docs/DefaultApi.md
|
||||||
|
docs/Dog.md
|
||||||
|
docs/DogAllOf.md
|
||||||
|
docs/Drawing.md
|
||||||
|
docs/EnumArrays.md
|
||||||
|
docs/EnumClass.md
|
||||||
|
docs/EnumTest.md
|
||||||
|
docs/EquilateralTriangle.md
|
||||||
|
docs/FakeApi.md
|
||||||
|
docs/FakeClassnameTags123Api.md
|
||||||
|
docs/File.md
|
||||||
|
docs/FileSchemaTestClass.md
|
||||||
|
docs/Foo.md
|
||||||
|
docs/FormatTest.md
|
||||||
|
docs/Fruit.md
|
||||||
|
docs/FruitReq.md
|
||||||
|
docs/GmFruit.md
|
||||||
|
docs/GrandparentAnimal.md
|
||||||
|
docs/HasOnlyReadOnly.md
|
||||||
|
docs/HealthCheckResult.md
|
||||||
|
docs/InlineResponseDefault.md
|
||||||
|
docs/IsoscelesTriangle.md
|
||||||
|
docs/List.md
|
||||||
|
docs/Mammal.md
|
||||||
|
docs/MapTest.md
|
||||||
|
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||||
|
docs/Model200Response.md
|
||||||
|
docs/ModelClient.md
|
||||||
|
docs/Name.md
|
||||||
|
docs/NullableClass.md
|
||||||
|
docs/NullableShape.md
|
||||||
|
docs/NumberOnly.md
|
||||||
|
docs/Order.md
|
||||||
|
docs/OuterComposite.md
|
||||||
|
docs/OuterEnum.md
|
||||||
|
docs/OuterEnumDefaultValue.md
|
||||||
|
docs/OuterEnumInteger.md
|
||||||
|
docs/OuterEnumIntegerDefaultValue.md
|
||||||
|
docs/ParentPet.md
|
||||||
|
docs/Pet.md
|
||||||
|
docs/PetApi.md
|
||||||
|
docs/Pig.md
|
||||||
|
docs/Quadrilateral.md
|
||||||
|
docs/QuadrilateralInterface.md
|
||||||
|
docs/ReadOnlyFirst.md
|
||||||
|
docs/Return.md
|
||||||
|
docs/ScaleneTriangle.md
|
||||||
|
docs/Shape.md
|
||||||
|
docs/ShapeInterface.md
|
||||||
|
docs/ShapeOrNull.md
|
||||||
|
docs/SimpleQuadrilateral.md
|
||||||
|
docs/SpecialModelName.md
|
||||||
|
docs/StoreApi.md
|
||||||
|
docs/Tag.md
|
||||||
|
docs/Triangle.md
|
||||||
|
docs/TriangleInterface.md
|
||||||
|
docs/User.md
|
||||||
|
docs/UserApi.md
|
||||||
|
docs/Whale.md
|
||||||
|
docs/Zebra.md
|
||||||
|
git_push.sh
|
||||||
|
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
|
||||||
|
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||||
|
src/Org.OpenAPITools/Api/DefaultApi.cs
|
||||||
|
src/Org.OpenAPITools/Api/FakeApi.cs
|
||||||
|
src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs
|
||||||
|
src/Org.OpenAPITools/Api/PetApi.cs
|
||||||
|
src/Org.OpenAPITools/Api/StoreApi.cs
|
||||||
|
src/Org.OpenAPITools/Api/UserApi.cs
|
||||||
|
src/Org.OpenAPITools/Client/ApiClient.cs
|
||||||
|
src/Org.OpenAPITools/Client/ApiException.cs
|
||||||
|
src/Org.OpenAPITools/Client/ApiResponse.cs
|
||||||
|
src/Org.OpenAPITools/Client/ClientUtils.cs
|
||||||
|
src/Org.OpenAPITools/Client/Configuration.cs
|
||||||
|
src/Org.OpenAPITools/Client/ExceptionFactory.cs
|
||||||
|
src/Org.OpenAPITools/Client/GlobalConfiguration.cs
|
||||||
|
src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs
|
||||||
|
src/Org.OpenAPITools/Client/IApiAccessor.cs
|
||||||
|
src/Org.OpenAPITools/Client/IAsynchronousClient.cs
|
||||||
|
src/Org.OpenAPITools/Client/IReadableConfiguration.cs
|
||||||
|
src/Org.OpenAPITools/Client/ISynchronousClient.cs
|
||||||
|
src/Org.OpenAPITools/Client/Multimap.cs
|
||||||
|
src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
|
||||||
|
src/Org.OpenAPITools/Client/RequestOptions.cs
|
||||||
|
src/Org.OpenAPITools/Client/RetryConfiguration.cs
|
||||||
|
src/Org.OpenAPITools/Client/WebRequestPathBuilder.cs
|
||||||
|
src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
|
||||||
|
src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs
|
||||||
|
src/Org.OpenAPITools/Model/Animal.cs
|
||||||
|
src/Org.OpenAPITools/Model/ApiResponse.cs
|
||||||
|
src/Org.OpenAPITools/Model/Apple.cs
|
||||||
|
src/Org.OpenAPITools/Model/AppleReq.cs
|
||||||
|
src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs
|
||||||
|
src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs
|
||||||
|
src/Org.OpenAPITools/Model/ArrayTest.cs
|
||||||
|
src/Org.OpenAPITools/Model/Banana.cs
|
||||||
|
src/Org.OpenAPITools/Model/BananaReq.cs
|
||||||
|
src/Org.OpenAPITools/Model/BasquePig.cs
|
||||||
|
src/Org.OpenAPITools/Model/Capitalization.cs
|
||||||
|
src/Org.OpenAPITools/Model/Cat.cs
|
||||||
|
src/Org.OpenAPITools/Model/CatAllOf.cs
|
||||||
|
src/Org.OpenAPITools/Model/Category.cs
|
||||||
|
src/Org.OpenAPITools/Model/ChildCat.cs
|
||||||
|
src/Org.OpenAPITools/Model/ChildCatAllOf.cs
|
||||||
|
src/Org.OpenAPITools/Model/ClassModel.cs
|
||||||
|
src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs
|
||||||
|
src/Org.OpenAPITools/Model/DanishPig.cs
|
||||||
|
src/Org.OpenAPITools/Model/Dog.cs
|
||||||
|
src/Org.OpenAPITools/Model/DogAllOf.cs
|
||||||
|
src/Org.OpenAPITools/Model/Drawing.cs
|
||||||
|
src/Org.OpenAPITools/Model/EnumArrays.cs
|
||||||
|
src/Org.OpenAPITools/Model/EnumClass.cs
|
||||||
|
src/Org.OpenAPITools/Model/EnumTest.cs
|
||||||
|
src/Org.OpenAPITools/Model/EquilateralTriangle.cs
|
||||||
|
src/Org.OpenAPITools/Model/File.cs
|
||||||
|
src/Org.OpenAPITools/Model/FileSchemaTestClass.cs
|
||||||
|
src/Org.OpenAPITools/Model/Foo.cs
|
||||||
|
src/Org.OpenAPITools/Model/FormatTest.cs
|
||||||
|
src/Org.OpenAPITools/Model/Fruit.cs
|
||||||
|
src/Org.OpenAPITools/Model/FruitReq.cs
|
||||||
|
src/Org.OpenAPITools/Model/GmFruit.cs
|
||||||
|
src/Org.OpenAPITools/Model/GrandparentAnimal.cs
|
||||||
|
src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs
|
||||||
|
src/Org.OpenAPITools/Model/HealthCheckResult.cs
|
||||||
|
src/Org.OpenAPITools/Model/InlineResponseDefault.cs
|
||||||
|
src/Org.OpenAPITools/Model/IsoscelesTriangle.cs
|
||||||
|
src/Org.OpenAPITools/Model/List.cs
|
||||||
|
src/Org.OpenAPITools/Model/Mammal.cs
|
||||||
|
src/Org.OpenAPITools/Model/MapTest.cs
|
||||||
|
src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs
|
||||||
|
src/Org.OpenAPITools/Model/Model200Response.cs
|
||||||
|
src/Org.OpenAPITools/Model/ModelClient.cs
|
||||||
|
src/Org.OpenAPITools/Model/Name.cs
|
||||||
|
src/Org.OpenAPITools/Model/NullableClass.cs
|
||||||
|
src/Org.OpenAPITools/Model/NullableShape.cs
|
||||||
|
src/Org.OpenAPITools/Model/NumberOnly.cs
|
||||||
|
src/Org.OpenAPITools/Model/Order.cs
|
||||||
|
src/Org.OpenAPITools/Model/OuterComposite.cs
|
||||||
|
src/Org.OpenAPITools/Model/OuterEnum.cs
|
||||||
|
src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs
|
||||||
|
src/Org.OpenAPITools/Model/OuterEnumInteger.cs
|
||||||
|
src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs
|
||||||
|
src/Org.OpenAPITools/Model/ParentPet.cs
|
||||||
|
src/Org.OpenAPITools/Model/Pet.cs
|
||||||
|
src/Org.OpenAPITools/Model/Pig.cs
|
||||||
|
src/Org.OpenAPITools/Model/Quadrilateral.cs
|
||||||
|
src/Org.OpenAPITools/Model/QuadrilateralInterface.cs
|
||||||
|
src/Org.OpenAPITools/Model/ReadOnlyFirst.cs
|
||||||
|
src/Org.OpenAPITools/Model/Return.cs
|
||||||
|
src/Org.OpenAPITools/Model/ScaleneTriangle.cs
|
||||||
|
src/Org.OpenAPITools/Model/Shape.cs
|
||||||
|
src/Org.OpenAPITools/Model/ShapeInterface.cs
|
||||||
|
src/Org.OpenAPITools/Model/ShapeOrNull.cs
|
||||||
|
src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs
|
||||||
|
src/Org.OpenAPITools/Model/SpecialModelName.cs
|
||||||
|
src/Org.OpenAPITools/Model/Tag.cs
|
||||||
|
src/Org.OpenAPITools/Model/Triangle.cs
|
||||||
|
src/Org.OpenAPITools/Model/TriangleInterface.cs
|
||||||
|
src/Org.OpenAPITools/Model/User.cs
|
||||||
|
src/Org.OpenAPITools/Model/Whale.cs
|
||||||
|
src/Org.OpenAPITools/Model/Zebra.cs
|
||||||
|
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
@ -0,0 +1 @@
|
|||||||
|
5.1.0-SNAPSHOT
|
@ -0,0 +1,27 @@
|
|||||||
|
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}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.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
|
||||||
|
EndGlobal
|
@ -0,0 +1,265 @@
|
|||||||
|
# Org.OpenAPITools - the C# library for the OpenAPI 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 [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- SDK version: 1.0.0
|
||||||
|
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen
|
||||||
|
|
||||||
|
<a name="frameworks-supported"></a>
|
||||||
|
## Frameworks supported
|
||||||
|
- .NET Core >=1.0
|
||||||
|
- .NET Framework >=4.6
|
||||||
|
- Mono/Xamarin >=vNext
|
||||||
|
|
||||||
|
<a name="dependencies"></a>
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.4 or later
|
||||||
|
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later
|
||||||
|
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later
|
||||||
|
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
|
||||||
|
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.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
|
||||||
|
Install-Package System.ComponentModel.Annotations
|
||||||
|
Install-Package CompareNETObjects
|
||||||
|
```
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
<a name="installation"></a>
|
||||||
|
## Installation
|
||||||
|
Generate the DLL using your preferred tool (e.g. `dotnet build`)
|
||||||
|
|
||||||
|
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
|
||||||
|
```csharp
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
```
|
||||||
|
<a name="usage"></a>
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To use the API client with a HTTP proxy, setup a `System.Net.WebProxy`
|
||||||
|
```csharp
|
||||||
|
Configuration c = new Configuration();
|
||||||
|
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
|
||||||
|
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
|
||||||
|
c.Proxy = webProxy;
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="getting-started"></a>
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class Example
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new AnotherFakeApi(config);
|
||||||
|
var modelClient = new ModelClient(); // ModelClient | client model
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// To test special tags
|
||||||
|
ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="documentation-for-api-endpoints"></a>
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||||
|
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||||
|
*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* | [**GetArrayOfEnums**](docs/FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums
|
||||||
|
*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
|
||||||
|
*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* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||||
|
*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
|
||||||
|
*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters |
|
||||||
|
*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
|
||||||
|
*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
*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
|
||||||
|
|
||||||
|
|
||||||
|
<a name="documentation-for-models"></a>
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [Model.Animal](docs/Animal.md)
|
||||||
|
- [Model.ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [Model.Apple](docs/Apple.md)
|
||||||
|
- [Model.AppleReq](docs/AppleReq.md)
|
||||||
|
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||||
|
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||||
|
- [Model.ArrayTest](docs/ArrayTest.md)
|
||||||
|
- [Model.Banana](docs/Banana.md)
|
||||||
|
- [Model.BananaReq](docs/BananaReq.md)
|
||||||
|
- [Model.BasquePig](docs/BasquePig.md)
|
||||||
|
- [Model.Capitalization](docs/Capitalization.md)
|
||||||
|
- [Model.Cat](docs/Cat.md)
|
||||||
|
- [Model.CatAllOf](docs/CatAllOf.md)
|
||||||
|
- [Model.Category](docs/Category.md)
|
||||||
|
- [Model.ChildCat](docs/ChildCat.md)
|
||||||
|
- [Model.ChildCatAllOf](docs/ChildCatAllOf.md)
|
||||||
|
- [Model.ClassModel](docs/ClassModel.md)
|
||||||
|
- [Model.ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
|
||||||
|
- [Model.DanishPig](docs/DanishPig.md)
|
||||||
|
- [Model.Dog](docs/Dog.md)
|
||||||
|
- [Model.DogAllOf](docs/DogAllOf.md)
|
||||||
|
- [Model.Drawing](docs/Drawing.md)
|
||||||
|
- [Model.EnumArrays](docs/EnumArrays.md)
|
||||||
|
- [Model.EnumClass](docs/EnumClass.md)
|
||||||
|
- [Model.EnumTest](docs/EnumTest.md)
|
||||||
|
- [Model.EquilateralTriangle](docs/EquilateralTriangle.md)
|
||||||
|
- [Model.File](docs/File.md)
|
||||||
|
- [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||||
|
- [Model.Foo](docs/Foo.md)
|
||||||
|
- [Model.FormatTest](docs/FormatTest.md)
|
||||||
|
- [Model.Fruit](docs/Fruit.md)
|
||||||
|
- [Model.FruitReq](docs/FruitReq.md)
|
||||||
|
- [Model.GmFruit](docs/GmFruit.md)
|
||||||
|
- [Model.GrandparentAnimal](docs/GrandparentAnimal.md)
|
||||||
|
- [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||||
|
- [Model.HealthCheckResult](docs/HealthCheckResult.md)
|
||||||
|
- [Model.InlineResponseDefault](docs/InlineResponseDefault.md)
|
||||||
|
- [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md)
|
||||||
|
- [Model.List](docs/List.md)
|
||||||
|
- [Model.Mammal](docs/Mammal.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.NullableClass](docs/NullableClass.md)
|
||||||
|
- [Model.NullableShape](docs/NullableShape.md)
|
||||||
|
- [Model.NumberOnly](docs/NumberOnly.md)
|
||||||
|
- [Model.Order](docs/Order.md)
|
||||||
|
- [Model.OuterComposite](docs/OuterComposite.md)
|
||||||
|
- [Model.OuterEnum](docs/OuterEnum.md)
|
||||||
|
- [Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
|
||||||
|
- [Model.OuterEnumInteger](docs/OuterEnumInteger.md)
|
||||||
|
- [Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
|
||||||
|
- [Model.ParentPet](docs/ParentPet.md)
|
||||||
|
- [Model.Pet](docs/Pet.md)
|
||||||
|
- [Model.Pig](docs/Pig.md)
|
||||||
|
- [Model.Quadrilateral](docs/Quadrilateral.md)
|
||||||
|
- [Model.QuadrilateralInterface](docs/QuadrilateralInterface.md)
|
||||||
|
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||||
|
- [Model.Return](docs/Return.md)
|
||||||
|
- [Model.ScaleneTriangle](docs/ScaleneTriangle.md)
|
||||||
|
- [Model.Shape](docs/Shape.md)
|
||||||
|
- [Model.ShapeInterface](docs/ShapeInterface.md)
|
||||||
|
- [Model.ShapeOrNull](docs/ShapeOrNull.md)
|
||||||
|
- [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
|
||||||
|
- [Model.SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [Model.Tag](docs/Tag.md)
|
||||||
|
- [Model.Triangle](docs/Triangle.md)
|
||||||
|
- [Model.TriangleInterface](docs/TriangleInterface.md)
|
||||||
|
- [Model.User](docs/User.md)
|
||||||
|
- [Model.Whale](docs/Whale.md)
|
||||||
|
- [Model.Zebra](docs/Zebra.md)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="documentation-for-authorization"></a>
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
<a name="api_key"></a>
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
<a name="api_key_query"></a>
|
||||||
|
### api_key_query
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key_query
|
||||||
|
- **Location**: URL query string
|
||||||
|
|
||||||
|
<a name="bearer_test"></a>
|
||||||
|
### bearer_test
|
||||||
|
|
||||||
|
- **Type**: Bearer Authentication
|
||||||
|
|
||||||
|
<a name="http_basic_test"></a>
|
||||||
|
### http_basic_test
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
<a name="http_signature_test"></a>
|
||||||
|
### http_signature_test
|
||||||
|
|
||||||
|
|
||||||
|
<a name="petstore_auth"></a>
|
||||||
|
### 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
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator)
|
||||||
|
#
|
||||||
|
image: Visual Studio 2019
|
||||||
|
clone_depth: 1
|
||||||
|
build_script:
|
||||||
|
- dotnet build -c Release
|
||||||
|
- dotnet test -c Release
|
||||||
|
after_build:
|
||||||
|
- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build
|
@ -0,0 +1,16 @@
|
|||||||
|
# Org.OpenAPITools.Model.AdditionalPropertiesClass
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**MapProperty** | **Dictionary<string, string>** | | [optional]
|
||||||
|
**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional]
|
||||||
|
**Anytype1** | **Object** | | [optional]
|
||||||
|
**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional]
|
||||||
|
**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional]
|
||||||
|
**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional]
|
||||||
|
**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional]
|
||||||
|
**MapWithUndeclaredPropertiesString** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,79 @@
|
|||||||
|
# Org.OpenAPITools.Api.AnotherFakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
|
||||||
|
|
||||||
|
<a name="call123testspecialtags"></a>
|
||||||
|
# **Call123TestSpecialTags**
|
||||||
|
> ModelClient Call123TestSpecialTags (ModelClient modelClient)
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class Call123TestSpecialTagsExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new AnotherFakeApi(config);
|
||||||
|
var modelClient = new ModelClient(); // ModelClient | client model
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// To test special tags
|
||||||
|
ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ModelClient**](ModelClient.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Apple
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Cultivar** | **string** | | [optional]
|
||||||
|
**Origin** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.AppleReq
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Cultivar** | **string** | |
|
||||||
|
**Mealy** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.Banana
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**LengthCm** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.BananaReq
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**LengthCm** | **decimal** | |
|
||||||
|
**Sweet** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.BasquePig
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ClassName** | **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)
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.CatAllOf
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Category
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long** | | [optional]
|
||||||
|
**Name** | **string** | | [default to "default-name"]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.ChildCat
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Name** | **string** | | [optional]
|
||||||
|
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.ChildCatAllOf
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Name** | **string** | | [optional]
|
||||||
|
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.ClassModel
|
||||||
|
Model for testing model with \"_class\" property
|
||||||
|
## 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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.ComplexQuadrilateral
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.DanishPig
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ClassName** | **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)
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
# Org.OpenAPITools.Api.DefaultApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**FooGet**](DefaultApi.md#fooget) | **GET** /foo |
|
||||||
|
|
||||||
|
|
||||||
|
<a name="fooget"></a>
|
||||||
|
# **FooGet**
|
||||||
|
> InlineResponseDefault FooGet ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FooGetExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new DefaultApi(config);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
InlineResponseDefault result = apiInstance.FooGet();
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**InlineResponseDefault**](InlineResponseDefault.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | response | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.DogAllOf
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# Org.OpenAPITools.Model.Drawing
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**MainShape** | [**Shape**](Shape.md) | | [optional]
|
||||||
|
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
|
||||||
|
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
|
||||||
|
**Shapes** | [**List<Shape>**](Shape.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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
# Org.OpenAPITools.Model.EnumTest
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**EnumString** | **string** | | [optional]
|
||||||
|
**EnumStringRequired** | **string** | |
|
||||||
|
**EnumInteger** | **int** | | [optional]
|
||||||
|
**EnumNumber** | **double** | | [optional]
|
||||||
|
**OuterEnum** | **OuterEnum** | | [optional]
|
||||||
|
**OuterEnumInteger** | **OuterEnumInteger** | | [optional]
|
||||||
|
**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional]
|
||||||
|
**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.EquilateralTriangle
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**TriangleType** | **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)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,84 @@
|
|||||||
|
# Org.OpenAPITools.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
|
||||||
|
|
||||||
|
|
||||||
|
<a name="testclassname"></a>
|
||||||
|
# **TestClassname**
|
||||||
|
> ModelClient TestClassname (ModelClient modelClient)
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class TestClassnameExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure API key authorization: api_key_query
|
||||||
|
config.AddApiKey("api_key_query", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// config.AddApiKeyPrefix("api_key_query", "Bearer");
|
||||||
|
|
||||||
|
var apiInstance = new FakeClassnameTags123Api(config);
|
||||||
|
var modelClient = new ModelClient(); // ModelClient | client model
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// To test class name in snake case
|
||||||
|
ModelClient result = apiInstance.TestClassname(modelClient);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**modelClient** | [**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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.File
|
||||||
|
Must be named `File` for test.
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**SourceURI** | **string** | Test capitalization | [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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.FileSchemaTestClass
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**File** | [**File**](File.md) | | [optional]
|
||||||
|
**Files** | [**List<File>**](File.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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.Foo
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Bar** | **string** | | [optional] [default to "bar"]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,24 @@
|
|||||||
|
# Org.OpenAPITools.Model.FormatTest
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Integer** | **int** | | [optional]
|
||||||
|
**Int32** | **int** | | [optional]
|
||||||
|
**Int64** | **long** | | [optional]
|
||||||
|
**Number** | **decimal** | |
|
||||||
|
**Float** | **float** | | [optional]
|
||||||
|
**Double** | **double** | | [optional]
|
||||||
|
**Decimal** | **decimal** | | [optional]
|
||||||
|
**String** | **string** | | [optional]
|
||||||
|
**Byte** | **byte[]** | |
|
||||||
|
**Binary** | **System.IO.Stream** | | [optional]
|
||||||
|
**Date** | **DateTime** | |
|
||||||
|
**DateTime** | **DateTime** | | [optional]
|
||||||
|
**Uuid** | **Guid** | | [optional]
|
||||||
|
**Password** | **string** | |
|
||||||
|
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
|
||||||
|
**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# Org.OpenAPITools.Model.Fruit
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Color** | **string** | | [optional]
|
||||||
|
**Cultivar** | **string** | | [optional]
|
||||||
|
**Origin** | **string** | | [optional]
|
||||||
|
**LengthCm** | **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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# Org.OpenAPITools.Model.FruitReq
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Cultivar** | **string** | |
|
||||||
|
**Mealy** | **bool** | | [optional]
|
||||||
|
**LengthCm** | **decimal** | |
|
||||||
|
**Sweet** | **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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# Org.OpenAPITools.Model.GmFruit
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Color** | **string** | | [optional]
|
||||||
|
**Cultivar** | **string** | | [optional]
|
||||||
|
**Origin** | **string** | | [optional]
|
||||||
|
**LengthCm** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.GrandparentAnimal
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**PetType** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.HasOnlyReadOnly
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Bar** | **string** | | [optional] [readonly]
|
||||||
|
**Foo** | **string** | | [optional] [readonly]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.HealthCheckResult
|
||||||
|
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**NullableMessage** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.InlineResponseDefault
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**String** | [**Foo**](Foo.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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.IsoscelesTriangle
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**TriangleType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# Org.OpenAPITools.Model.Mammal
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**HasBaleen** | **bool** | | [optional]
|
||||||
|
**HasTeeth** | **bool** | | [optional]
|
||||||
|
**ClassName** | **string** | |
|
||||||
|
**Type** | **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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# Org.OpenAPITools.Model.MapTest
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional]
|
||||||
|
**MapOfEnumString** | **Dictionary<string, string>** | | [optional]
|
||||||
|
**DirectMap** | **Dictionary<string, bool>** | | [optional]
|
||||||
|
**IndirectMap** | **Dictionary<string, 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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.Model.Model200Response
|
||||||
|
Model for testing model name starting with number
|
||||||
|
## 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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
# Org.OpenAPITools.Model.Name
|
||||||
|
Model for testing model name same as property name
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_Name** | **int** | |
|
||||||
|
**SnakeCase** | **int** | | [optional] [readonly]
|
||||||
|
**Property** | **string** | | [optional]
|
||||||
|
**_123Number** | **int** | | [optional] [readonly]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
# Org.OpenAPITools.Model.NullableClass
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**IntegerProp** | **int?** | | [optional]
|
||||||
|
**NumberProp** | **decimal?** | | [optional]
|
||||||
|
**BooleanProp** | **bool?** | | [optional]
|
||||||
|
**StringProp** | **string** | | [optional]
|
||||||
|
**DateProp** | **DateTime?** | | [optional]
|
||||||
|
**DatetimeProp** | **DateTime?** | | [optional]
|
||||||
|
**ArrayNullableProp** | **List<Object>** | | [optional]
|
||||||
|
**ArrayAndItemsNullableProp** | **List<Object>** | | [optional]
|
||||||
|
**ArrayItemsNullable** | **List<Object>** | | [optional]
|
||||||
|
**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional]
|
||||||
|
**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional]
|
||||||
|
**ObjectItemsNullable** | **Dictionary<string, Object>** | | [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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.Model.NullableShape
|
||||||
|
The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1.
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# Org.OpenAPITools.Model.OuterEnumDefaultValue
|
||||||
|
## 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)
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# Org.OpenAPITools.Model.OuterEnumInteger
|
||||||
|
## 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)
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue
|
||||||
|
## 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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.ParentPet
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**PetType** | **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)
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,680 @@
|
|||||||
|
# Org.OpenAPITools.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
|
||||||
|
[**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="addpet"></a>
|
||||||
|
# **AddPet**
|
||||||
|
> void AddPet (Pet pet)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class AddPetExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add a new pet to the store
|
||||||
|
apiInstance.AddPet(pet);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **405** | Invalid input | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="deletepet"></a>
|
||||||
|
# **DeletePet**
|
||||||
|
> void DeletePet (long petId, string apiKey = null)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeletePetExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var petId = 789; // long | Pet id to delete
|
||||||
|
var apiKey = apiKey_example; // string | (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Deletes a pet
|
||||||
|
apiInstance.DeletePet(petId, apiKey);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid pet value | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="findpetsbystatus"></a>
|
||||||
|
# **FindPetsByStatus**
|
||||||
|
> List<Pet> FindPetsByStatus (List<string> status)
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
Multiple status values can be provided with comma separated strings
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FindPetsByStatusExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var status = status_example; // List<string> | Status values that need to be considered for filter
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Finds Pets by status
|
||||||
|
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | **List<string>**| Status values that need to be considered for filter |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid status value | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="findpetsbytags"></a>
|
||||||
|
# **FindPetsByTags**
|
||||||
|
> List<Pet> FindPetsByTags (List<string> tags)
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FindPetsByTagsExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var tags = new List<string>(); // List<string> | Tags to filter by
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Finds Pets by tags
|
||||||
|
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**List<string>**](string.md)| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid tag value | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="getpetbyid"></a>
|
||||||
|
# **GetPetById**
|
||||||
|
> Pet GetPetById (long petId)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetPetByIdExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
config.AddApiKey("api_key", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// config.AddApiKeyPrefix("api_key", "Bearer");
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var petId = 789; // long | ID of pet to return
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Find pet by ID
|
||||||
|
Pet result = apiInstance.GetPetById(petId);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Pet not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="updatepet"></a>
|
||||||
|
# **UpdatePet**
|
||||||
|
> void UpdatePet (Pet pet)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdatePetExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Update an existing pet
|
||||||
|
apiInstance.UpdatePet(pet);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Pet not found | - |
|
||||||
|
| **405** | Validation exception | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="updatepetwithform"></a>
|
||||||
|
# **UpdatePetWithForm**
|
||||||
|
> void UpdatePetWithForm (long petId, string name = null, string status = null)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdatePetWithFormExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
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 (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **405** | Invalid input | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="uploadfile"></a>
|
||||||
|
# **UploadFile**
|
||||||
|
> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UploadFileExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var petId = 789; // long | ID of pet to update
|
||||||
|
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||||
|
var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// uploads an image
|
||||||
|
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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****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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="uploadfilewithrequiredfile"></a>
|
||||||
|
# **UploadFileWithRequiredFile**
|
||||||
|
> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null)
|
||||||
|
|
||||||
|
uploads an image (required)
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UploadFileWithRequiredFileExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi(config);
|
||||||
|
var petId = 789; // long | ID of pet to update
|
||||||
|
var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload
|
||||||
|
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// uploads an image (required)
|
||||||
|
ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long**| ID of pet to update |
|
||||||
|
**requiredFile** | **System.IO.Stream****System.IO.Stream**| file to upload |
|
||||||
|
**additionalMetadata** | **string**| Additional data to pass to server | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.Pig
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ClassName** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Quadrilateral
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.QuadrilateralInterface
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.ReadOnlyFirst
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Bar** | **string** | | [optional] [readonly]
|
||||||
|
**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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Return
|
||||||
|
Model for testing reserved words
|
||||||
|
## 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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.ScaleneTriangle
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**TriangleType** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Shape
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.ShapeInterface
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.Model.ShapeOrNull
|
||||||
|
The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1.
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.SimpleQuadrilateral
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**QuadrilateralType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,294 @@
|
|||||||
|
# Org.OpenAPITools.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
|
||||||
|
|
||||||
|
|
||||||
|
<a name="deleteorder"></a>
|
||||||
|
# **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.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeleteOrderExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new StoreApi(config);
|
||||||
|
var orderId = orderId_example; // string | ID of the order that needs to be deleted
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete purchase order by ID
|
||||||
|
apiInstance.DeleteOrder(orderId);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Order not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="getinventory"></a>
|
||||||
|
# **GetInventory**
|
||||||
|
> Dictionary<string, int> GetInventory ()
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetInventoryExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
config.AddApiKey("api_key", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// config.AddApiKeyPrefix("api_key", "Bearer");
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi(config);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Returns pet inventories by status
|
||||||
|
Dictionary<string, int> result = apiInstance.GetInventory();
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Dictionary<string, int>**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="getorderbyid"></a>
|
||||||
|
# **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.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetOrderByIdExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new StoreApi(config);
|
||||||
|
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 (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid ID supplied | - |
|
||||||
|
| **404** | Order not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="placeorder"></a>
|
||||||
|
# **PlaceOrder**
|
||||||
|
> Order PlaceOrder (Order order)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class PlaceOrderExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new StoreApi(config);
|
||||||
|
var order = new Order(); // Order | order placed for purchasing the pet
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Place an order for a pet
|
||||||
|
Order result = apiInstance.PlaceOrder(order);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid Order | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Triangle
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ShapeType** | **string** | |
|
||||||
|
**TriangleType** | **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)
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# Org.OpenAPITools.Model.TriangleInterface
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**TriangleType** | **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)
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
# Org.OpenAPITools.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]
|
||||||
|
**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional]
|
||||||
|
**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional]
|
||||||
|
**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional]
|
||||||
|
**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [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)
|
||||||
|
|
@ -0,0 +1,565 @@
|
|||||||
|
# Org.OpenAPITools.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
|
||||||
|
|
||||||
|
|
||||||
|
<a name="createuser"></a>
|
||||||
|
# **CreateUser**
|
||||||
|
> void CreateUser (User user)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUserExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
var user = new User(); // User | Created user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Create user
|
||||||
|
apiInstance.CreateUser(user);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="createuserswitharrayinput"></a>
|
||||||
|
# **CreateUsersWithArrayInput**
|
||||||
|
> void CreateUsersWithArrayInput (List<User> user)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUsersWithArrayInputExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
var user = new List<User>(); // List<User> | List of user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Creates list of users with given input array
|
||||||
|
apiInstance.CreateUsersWithArrayInput(user);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="createuserswithlistinput"></a>
|
||||||
|
# **CreateUsersWithListInput**
|
||||||
|
> void CreateUsersWithListInput (List<User> user)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUsersWithListInputExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
var user = new List<User>(); // List<User> | List of user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Creates list of users with given input array
|
||||||
|
apiInstance.CreateUsersWithListInput(user);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**user** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="deleteuser"></a>
|
||||||
|
# **DeleteUser**
|
||||||
|
> void DeleteUser (string username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeleteUserExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
var username = username_example; // string | The name that needs to be deleted
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete user
|
||||||
|
apiInstance.DeleteUser(username);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid username supplied | - |
|
||||||
|
| **404** | User not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="getuserbyname"></a>
|
||||||
|
# **GetUserByName**
|
||||||
|
> User GetUserByName (string username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetUserByNameExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
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 (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
| **400** | Invalid username supplied | - |
|
||||||
|
| **404** | User not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="loginuser"></a>
|
||||||
|
# **LoginUser**
|
||||||
|
> string LoginUser (string username, string password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class LoginUserExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
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 (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||||
|
| **400** | Invalid username/password supplied | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="logoutuser"></a>
|
||||||
|
# **LogoutUser**
|
||||||
|
> void LogoutUser ()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class LogoutUserExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Logs out current logged in user session
|
||||||
|
apiInstance.LogoutUser();
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
<a name="updateuser"></a>
|
||||||
|
# **UpdateUser**
|
||||||
|
> void UpdateUser (string username, User user)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdateUserExample
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||||
|
var apiInstance = new UserApi(config);
|
||||||
|
var username = username_example; // string | name that need to be deleted
|
||||||
|
var user = new User(); // User | Updated user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Updated user
|
||||||
|
apiInstance.UpdateUser(username, user);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
|
||||||
|
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||||
|
Debug.Print(e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| name that need to be deleted |
|
||||||
|
**user** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **400** | Invalid user supplied | - |
|
||||||
|
| **404** | User not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# Org.OpenAPITools.Model.Whale
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**HasBaleen** | **bool** | | [optional]
|
||||||
|
**HasTeeth** | **bool** | | [optional]
|
||||||
|
**ClassName** | **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)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# Org.OpenAPITools.Model.Zebra
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Type** | **string** | | [optional]
|
||||||
|
**ClassName** | **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)
|
||||||
|
|
@ -0,0 +1,58 @@
|
|||||||
|
#!/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 openapi-pestore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
git_host=$4
|
||||||
|
|
||||||
|
if [ "$git_host" = "" ]; then
|
||||||
|
git_host="github.com"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||||
|
fi
|
||||||
|
|
||||||
|
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://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${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://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI 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: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
// uncomment below to import models
|
||||||
|
//using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Test.Api
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing AnotherFakeApi
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
/// Please update the test case below to test the API endpoint.
|
||||||
|
/// </remarks>
|
||||||
|
public class AnotherFakeApiTests : IDisposable
|
||||||
|
{
|
||||||
|
private AnotherFakeApi instance;
|
||||||
|
|
||||||
|
public AnotherFakeApiTests()
|
||||||
|
{
|
||||||
|
instance = new AnotherFakeApi();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
// Cleanup when everything is done.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of AnotherFakeApi
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void InstanceTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test 'IsType' AnotherFakeApi
|
||||||
|
//Assert.IsType<AnotherFakeApi>(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test Call123TestSpecialTags
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void Call123TestSpecialTagsTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//ModelClient modelClient = null;
|
||||||
|
//var response = instance.Call123TestSpecialTags(modelClient);
|
||||||
|
//Assert.IsType<ModelClient>(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI 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: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
// uncomment below to import models
|
||||||
|
//using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Test.Api
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing DefaultApi
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
/// Please update the test case below to test the API endpoint.
|
||||||
|
/// </remarks>
|
||||||
|
public class DefaultApiTests : IDisposable
|
||||||
|
{
|
||||||
|
private DefaultApi instance;
|
||||||
|
|
||||||
|
public DefaultApiTests()
|
||||||
|
{
|
||||||
|
instance = new DefaultApi();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
// Cleanup when everything is done.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of DefaultApi
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void InstanceTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test 'IsType' DefaultApi
|
||||||
|
//Assert.IsType<DefaultApi>(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test FooGet
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void FooGetTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//var response = instance.FooGet();
|
||||||
|
//Assert.IsType<InlineResponseDefault>(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,257 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI 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: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
using Org.OpenAPITools.Client;
|
||||||
|
using Org.OpenAPITools.Api;
|
||||||
|
// uncomment below to import models
|
||||||
|
//using Org.OpenAPITools.Model;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Test.Api
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class for testing FakeApi
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
/// Please update the test case below to test the API endpoint.
|
||||||
|
/// </remarks>
|
||||||
|
public class FakeApiTests : IDisposable
|
||||||
|
{
|
||||||
|
private FakeApi instance;
|
||||||
|
|
||||||
|
public FakeApiTests()
|
||||||
|
{
|
||||||
|
instance = new FakeApi();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
// Cleanup when everything is done.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test an instance of FakeApi
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void InstanceTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test 'IsType' FakeApi
|
||||||
|
//Assert.IsType<FakeApi>(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test FakeHealthGet
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void FakeHealthGetTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//var response = instance.FakeHealthGet();
|
||||||
|
//Assert.IsType<HealthCheckResult>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test FakeOuterBooleanSerialize
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void FakeOuterBooleanSerializeTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//bool? body = null;
|
||||||
|
//var response = instance.FakeOuterBooleanSerialize(body);
|
||||||
|
//Assert.IsType<bool>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test FakeOuterCompositeSerialize
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void FakeOuterCompositeSerializeTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//OuterComposite outerComposite = null;
|
||||||
|
//var response = instance.FakeOuterCompositeSerialize(outerComposite);
|
||||||
|
//Assert.IsType<OuterComposite>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test FakeOuterNumberSerialize
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void FakeOuterNumberSerializeTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//decimal? body = null;
|
||||||
|
//var response = instance.FakeOuterNumberSerialize(body);
|
||||||
|
//Assert.IsType<decimal>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test FakeOuterStringSerialize
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void FakeOuterStringSerializeTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//string body = null;
|
||||||
|
//var response = instance.FakeOuterStringSerialize(body);
|
||||||
|
//Assert.IsType<string>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test GetArrayOfEnums
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void GetArrayOfEnumsTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//var response = instance.GetArrayOfEnums();
|
||||||
|
//Assert.IsType<List<OuterEnum>>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestBodyWithFileSchema
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestBodyWithFileSchemaTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//FileSchemaTestClass fileSchemaTestClass = null;
|
||||||
|
//instance.TestBodyWithFileSchema(fileSchemaTestClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestBodyWithQueryParams
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestBodyWithQueryParamsTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//string query = null;
|
||||||
|
//User user = null;
|
||||||
|
//instance.TestBodyWithQueryParams(query, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestClientModel
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestClientModelTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//ModelClient modelClient = null;
|
||||||
|
//var response = instance.TestClientModel(modelClient);
|
||||||
|
//Assert.IsType<ModelClient>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestEndpointParameters
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
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;
|
||||||
|
//System.IO.Stream 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestEnumParameters
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestEnumParametersTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//List<string> enumHeaderStringArray = null;
|
||||||
|
//string enumHeaderString = null;
|
||||||
|
//List<string> enumQueryStringArray = null;
|
||||||
|
//string enumQueryString = null;
|
||||||
|
//int? enumQueryInteger = null;
|
||||||
|
//double? enumQueryDouble = null;
|
||||||
|
//List<string> enumFormStringArray = null;
|
||||||
|
//string enumFormString = null;
|
||||||
|
//instance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestGroupParameters
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestGroupParametersTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//int requiredStringGroup = null;
|
||||||
|
//bool requiredBooleanGroup = null;
|
||||||
|
//long requiredInt64Group = null;
|
||||||
|
//int? stringGroup = null;
|
||||||
|
//bool? booleanGroup = null;
|
||||||
|
//long? int64Group = null;
|
||||||
|
//instance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestInlineAdditionalProperties
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestInlineAdditionalPropertiesTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//Dictionary<string, string> requestBody = null;
|
||||||
|
//instance.TestInlineAdditionalProperties(requestBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestJsonFormData
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test TestQueryParameterCollectionFormat
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestQueryParameterCollectionFormatTest()
|
||||||
|
{
|
||||||
|
// TODO uncomment below to test the method and replace null with proper value
|
||||||
|
//List<string> pipe = null;
|
||||||
|
//List<string> ioutil = null;
|
||||||
|
//List<string> http = null;
|
||||||
|
//List<string> url = null;
|
||||||
|
//List<string> context = null;
|
||||||
|
//instance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user