forked from loafle/openapi-generator-original
[C#] Add auto-generated doc for c# 2.0 generator (#4354)
* add auto-generated doc for c# 2.0 generator * update readme for c# 2.0 * update readme * update namespace in the doc
This commit is contained in:
parent
83adcf5c06
commit
dbb66af73d
@ -21,6 +21,9 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
|||||||
protected String packageVersion = "1.0.0";
|
protected String packageVersion = "1.0.0";
|
||||||
protected String clientPackage = "IO.Swagger.Client";
|
protected String clientPackage = "IO.Swagger.Client";
|
||||||
protected String sourceFolder = "src" + File.separator + "main" + File.separator + "CsharpDotNet2";
|
protected String sourceFolder = "src" + File.separator + "main" + File.separator + "CsharpDotNet2";
|
||||||
|
protected String apiDocPath = "docs/";
|
||||||
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
|
|
||||||
public CsharpDotNet2ClientCodegen() {
|
public CsharpDotNet2ClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -35,6 +38,8 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
|||||||
embeddedTemplateDir = templateDir = "CsharpDotNet2";
|
embeddedTemplateDir = templateDir = "CsharpDotNet2";
|
||||||
apiPackage = "IO.Swagger.Api";
|
apiPackage = "IO.Swagger.Api";
|
||||||
modelPackage = "IO.Swagger.Model";
|
modelPackage = "IO.Swagger.Model";
|
||||||
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
setReservedWordsLowerCase(
|
setReservedWordsLowerCase(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
@ -122,6 +127,9 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
|||||||
additionalProperties.put(CLIENT_PACKAGE, clientPackage);
|
additionalProperties.put(CLIENT_PACKAGE, clientPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("Configuration.mustache",
|
supportingFiles.add(new SupportingFile("Configuration.mustache",
|
||||||
sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator), "Configuration.cs"));
|
sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator), "Configuration.cs"));
|
||||||
supportingFiles.add(new SupportingFile("ApiClient.mustache",
|
supportingFiles.add(new SupportingFile("ApiClient.mustache",
|
||||||
@ -130,7 +138,7 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
|||||||
sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator), "ApiException.cs"));
|
sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator), "ApiException.cs"));
|
||||||
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config"));
|
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config"));
|
||||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
||||||
supportingFiles.add(new SupportingFile("README.md", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,4 +300,14 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
|||||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
return input.replace("*/", "*_/").replace("/*", "/_*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
# Csharp-DotNet2
|
|
||||||
|
|
||||||
This generator creates C# code targeting the .Net 2.0 framework. The resulting DLLs can be used in places where .Net 2.0 is the maximum supported version, such as in the Unity3d.
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
- Mono compiler
|
|
||||||
- Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,153 @@
|
|||||||
|
# {{packageName}} - the C# library for the {{appName}}
|
||||||
|
|
||||||
|
{{#appDescription}}
|
||||||
|
{{{appDescription}}}
|
||||||
|
{{/appDescription}}
|
||||||
|
|
||||||
|
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: {{appVersion}}
|
||||||
|
- SDK version: {{packageVersion}}
|
||||||
|
{{^hideGenerationTimestamp}}
|
||||||
|
- Build date: {{generatedDate}}
|
||||||
|
{{/hideGenerationTimestamp}}
|
||||||
|
- Build package: {{generatorClass}}
|
||||||
|
{{#infoUrl}}
|
||||||
|
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||||
|
{{/infoUrl}}
|
||||||
|
|
||||||
|
<a name="frameworks-supported"></a>
|
||||||
|
## Frameworks supported
|
||||||
|
{{^supportUWP}}
|
||||||
|
- .NET 2.0
|
||||||
|
{{/supportUWP}}
|
||||||
|
{{#supportUWP}}
|
||||||
|
- UWP
|
||||||
|
{{/supportUWP}}
|
||||||
|
|
||||||
|
<a name="dependencies"></a>
|
||||||
|
## Dependencies
|
||||||
|
- Mono compiler
|
||||||
|
- Newtonsoft.Json.7.0.1
|
||||||
|
- RestSharp.Net2.1.1.11
|
||||||
|
|
||||||
|
Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator
|
||||||
|
|
||||||
|
<a name="installation"></a>
|
||||||
|
## Installation
|
||||||
|
Run the following command to generate the DLL
|
||||||
|
- [Mac/Linux] `/bin/sh compile-mono.sh`
|
||||||
|
- [Windows] TODO
|
||||||
|
|
||||||
|
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
|
||||||
|
```csharp
|
||||||
|
using {{packageName}}.{{apiPackage}};
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
using {{packageName}}.{{modelPackage}};
|
||||||
|
```
|
||||||
|
<a name="getting-started"></a>
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using {{apiPackage}};
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
using {{modelPackage}};
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class {{operationId}}Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
Configuration.Default.Username = "YOUR_USERNAME";
|
||||||
|
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
var apiInstance = new {{classname}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{#isPrimitiveType}}
|
||||||
|
var {{paramName}} = {{example}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
{{#summary}}
|
||||||
|
// {{{.}}}
|
||||||
|
{{/summary}}
|
||||||
|
{{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
Debug.WriteLine(result);{{/returnType}}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="documentation-for-api-endpoints"></a>
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *{{{basePath}}}*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
|
<a name="documentation-for-models"></a>
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
{{#modelPackage}}
|
||||||
|
{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
|
||||||
|
{{/model}}{{/models}}
|
||||||
|
{{/modelPackage}}
|
||||||
|
{{^modelPackage}}
|
||||||
|
No model defined in this package
|
||||||
|
{{/modelPackage}}
|
||||||
|
|
||||||
|
<a name="documentation-for-authorization"></a>
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}
|
||||||
|
All endpoints do not require authorization.
|
||||||
|
{{/authMethods}}
|
||||||
|
{{#authMethods}}
|
||||||
|
{{#last}}
|
||||||
|
Authentication schemes defined for the API:
|
||||||
|
{{/last}}
|
||||||
|
{{/authMethods}}
|
||||||
|
{{#authMethods}}
|
||||||
|
<a name="{{name}}"></a>
|
||||||
|
### {{name}}
|
||||||
|
|
||||||
|
{{#isApiKey}}- **Type**: API key
|
||||||
|
- **API key parameter name**: {{keyParamName}}
|
||||||
|
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||||
|
{{/isApiKey}}
|
||||||
|
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
|
- **Flow**: {{flow}}
|
||||||
|
- **Authorization URL**: {{authorizationUrl}}
|
||||||
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
|
{{#scopes}} - {{scope}}: {{description}}
|
||||||
|
{{/scopes}}
|
||||||
|
{{/isOAuth}}
|
||||||
|
|
||||||
|
{{/authMethods}}
|
@ -0,0 +1,97 @@
|
|||||||
|
# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}}
|
||||||
|
{{description}}{{/description}}
|
||||||
|
|
||||||
|
All URIs are relative to *{{{basePath}}}*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
<a name="{{{operationIdLowerCase}}}"></a>
|
||||||
|
# **{{{operationId}}}**
|
||||||
|
> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
|
|
||||||
|
{{{summary}}}{{#notes}}
|
||||||
|
|
||||||
|
{{{notes}}}{{/notes}}
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using {{packageName}}.Api;
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
using {{modelPackage}};
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class {{operationId}}Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
Configuration.Default.Username = "YOUR_USERNAME";
|
||||||
|
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
var apiInstance = new {{classname}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{#isPrimitiveType}}
|
||||||
|
var {{paramName}} = {{example}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
{{#summary}}
|
||||||
|
// {{{.}}}
|
||||||
|
{{/summary}}
|
||||||
|
{{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
Debug.WriteLine(result);{{/returnType}}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
|
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
|
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,14 @@
|
|||||||
|
{{#models}}
|
||||||
|
{{#model}}
|
||||||
|
# {{{packageName}}}.Model.{{{classname}}}
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
{{/model}}
|
||||||
|
{{/models}}
|
@ -0,0 +1,23 @@
|
|||||||
|
# Swagger Codegen Ignore
|
||||||
|
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
@ -1,10 +1,132 @@
|
|||||||
# Csharp-DotNet2
|
# IO.Swagger - the C# library for the Swagger Petstore
|
||||||
|
|
||||||
This generator creates C# code targeting the .Net 2.0 framework. The resulting DLLs can be used in places where .Net 2.0 is the maximum supported version, such as in the Unity3d.
|
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- SDK version: 1.0.0
|
||||||
|
- Build date: 2016-12-09T16:46:08.135+08:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.CsharpDotNet2ClientCodegen
|
||||||
|
|
||||||
|
<a name="frameworks-supported"></a>
|
||||||
|
## Frameworks supported
|
||||||
|
- .NET 2.0
|
||||||
|
|
||||||
|
<a name="dependencies"></a>
|
||||||
## Dependencies
|
## Dependencies
|
||||||
- Mono compiler
|
- Mono compiler
|
||||||
- Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator.
|
- Newtonsoft.Json.7.0.1
|
||||||
|
- RestSharp.Net2.1.1.11
|
||||||
|
|
||||||
|
Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator
|
||||||
|
|
||||||
|
<a name="installation"></a>
|
||||||
|
## Installation
|
||||||
|
Run the following command to generate the DLL
|
||||||
|
- [Mac/Linux] `/bin/sh compile-mono.sh`
|
||||||
|
- [Windows] TODO
|
||||||
|
|
||||||
|
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
|
||||||
|
```csharp
|
||||||
|
using IO.Swagger.IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.IO.Swagger.Model;
|
||||||
|
```
|
||||||
|
<a name="getting-started"></a>
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add a new pet to the store
|
||||||
|
apiInstance.AddPet(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<a name="documentation-for-api-endpoints"></a>
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**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
|
||||||
|
|
||||||
|
- [IO.Swagger.Model.ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [IO.Swagger.Model.Category](docs/Category.md)
|
||||||
|
- [IO.Swagger.Model.Order](docs/Order.md)
|
||||||
|
- [IO.Swagger.Model.Pet](docs/Pet.md)
|
||||||
|
- [IO.Swagger.Model.Tag](docs/Tag.md)
|
||||||
|
- [IO.Swagger.Model.User](docs/User.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="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,11 @@
|
|||||||
|
# IO.Swagger.Model.ApiResponse
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Code** | **int?** | | [optional] [default to null]
|
||||||
|
**Type** | **string** | | [optional] [default to null]
|
||||||
|
**Message** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[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 @@
|
|||||||
|
# IO.Swagger.Model.Category
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[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 @@
|
|||||||
|
# IO.Swagger.Model.Order
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional] [default to null]
|
||||||
|
**PetId** | **long?** | | [optional] [default to null]
|
||||||
|
**Quantity** | **int?** | | [optional] [default to null]
|
||||||
|
**ShipDate** | **DateTime?** | | [optional] [default to null]
|
||||||
|
**Status** | **string** | Order Status | [optional] [default to null]
|
||||||
|
**Complete** | **bool?** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[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 @@
|
|||||||
|
# IO.Swagger.Model.Pet
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional] [default to null]
|
||||||
|
**Category** | [**Category**](Category.md) | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [default to null]
|
||||||
|
**PhotoUrls** | **List<string>** | | [default to null]
|
||||||
|
**Tags** | [**List<Tag>**](Tag.md) | | [optional] [default to null]
|
||||||
|
**Status** | **string** | pet status in the store | [optional] [default to null]
|
||||||
|
|
||||||
|
[[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,544 @@
|
|||||||
|
# IO.Swagger..PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/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
|
||||||
|
|
||||||
|
|
||||||
|
<a name="addpet"></a>
|
||||||
|
# **AddPet**
|
||||||
|
> void AddPet (Pet body)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class AddPetExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add a new pet to the store
|
||||||
|
apiInstance.AddPet(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="deletepet"></a>
|
||||||
|
# **DeletePet**
|
||||||
|
> void DeletePet (long? petId, string apiKey)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeletePetExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | Pet id to delete
|
||||||
|
var apiKey = apiKey_example; // string | (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Deletes a pet
|
||||||
|
apiInstance.DeletePet(petId, apiKey);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| Pet id to delete |
|
||||||
|
**apiKey** | **string**| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FindPetsByStatusExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var status = new List<string>(); // 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 (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | [**List<string>**](string.md)| Status values that need to be considered for filter |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FindPetsByTagsExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var tags = new List<string>(); // List<string> | Tags to filter by
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Finds Pets by tags
|
||||||
|
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**List<string>**](string.md)| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="getpetbyid"></a>
|
||||||
|
# **GetPetById**
|
||||||
|
> Pet GetPetById (long? petId)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetPetByIdExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | ID of pet to return
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Find pet by ID
|
||||||
|
Pet result = apiInstance.GetPetById(petId);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| ID of pet to return |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="updatepet"></a>
|
||||||
|
# **UpdatePet**
|
||||||
|
> void UpdatePet (Pet body)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdatePetExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Update an existing pet
|
||||||
|
apiInstance.UpdatePet(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="updatepetwithform"></a>
|
||||||
|
# **UpdatePetWithForm**
|
||||||
|
> void UpdatePetWithForm (long? petId, string name, string status)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdatePetWithFormExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | ID of pet that needs to be updated
|
||||||
|
var name = name_example; // string | Updated name of the pet (optional)
|
||||||
|
var status = status_example; // string | Updated status of the pet (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Updates a pet in the store with form data
|
||||||
|
apiInstance.UpdatePetWithForm(petId, name, status);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| ID of pet that needs to be updated |
|
||||||
|
**name** | **string**| Updated name of the pet | [optional]
|
||||||
|
**status** | **string**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="uploadfile"></a>
|
||||||
|
# **UploadFile**
|
||||||
|
> ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UploadFileExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | ID of pet to update
|
||||||
|
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||||
|
var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// uploads an image
|
||||||
|
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| ID of pet to update |
|
||||||
|
**additionalMetadata** | **string**| Additional data to pass to server | [optional]
|
||||||
|
**file** | **System.IO.Stream**| file to upload | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,260 @@
|
|||||||
|
# IO.Swagger..StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
[**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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeleteOrderExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
var orderId = orderId_example; // string | ID of the order that needs to be deleted
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete purchase order by ID
|
||||||
|
apiInstance.DeleteOrder(orderId);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **string**| ID of the order that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetInventoryExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
|
||||||
|
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Returns pet inventories by status
|
||||||
|
Dictionary<String, int?> result = apiInstance.GetInventory();
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Dictionary<String, int?>**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetOrderByIdExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
var orderId = 789; // long? | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Find purchase order by ID
|
||||||
|
Order result = apiInstance.GetOrderById(orderId);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **long?**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="placeorder"></a>
|
||||||
|
# **PlaceOrder**
|
||||||
|
> Order PlaceOrder (Order body)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class PlaceOrderExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
var body = new Order(); // Order | order placed for purchasing the pet
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Place an order for a pet
|
||||||
|
Order result = apiInstance.PlaceOrder(body);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# IO.Swagger.Model.Tag
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[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 @@
|
|||||||
|
# IO.Swagger.Model.User
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional] [default to null]
|
||||||
|
**Username** | **string** | | [optional] [default to null]
|
||||||
|
**FirstName** | **string** | | [optional] [default to null]
|
||||||
|
**LastName** | **string** | | [optional] [default to null]
|
||||||
|
**Email** | **string** | | [optional] [default to null]
|
||||||
|
**Password** | **string** | | [optional] [default to null]
|
||||||
|
**Phone** | **string** | | [optional] [default to null]
|
||||||
|
**UserStatus** | **int?** | User Status | [optional] [default to null]
|
||||||
|
|
||||||
|
[[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,506 @@
|
|||||||
|
# IO.Swagger..UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/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 body)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var body = new User(); // User | Created user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Create user
|
||||||
|
apiInstance.CreateUser(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="createuserswitharrayinput"></a>
|
||||||
|
# **CreateUsersWithArrayInput**
|
||||||
|
> void CreateUsersWithArrayInput (List<User> body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUsersWithArrayInputExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var body = new List<User>(); // List<User> | List of user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Creates list of users with given input array
|
||||||
|
apiInstance.CreateUsersWithArrayInput(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="createuserswithlistinput"></a>
|
||||||
|
# **CreateUsersWithListInput**
|
||||||
|
> void CreateUsersWithListInput (List<User> body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUsersWithListInputExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var body = new List<User>(); // List<User> | List of user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Creates list of users with given input array
|
||||||
|
apiInstance.CreateUsersWithListInput(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeleteUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | The name that needs to be deleted
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete user
|
||||||
|
apiInstance.DeleteUser(username);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The name that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="getuserbyname"></a>
|
||||||
|
# **GetUserByName**
|
||||||
|
> User GetUserByName (string username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetUserByNameExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Get user by user name
|
||||||
|
User result = apiInstance.GetUserByName(username);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="loginuser"></a>
|
||||||
|
# **LoginUser**
|
||||||
|
> string LoginUser (string username, string password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class LoginUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | The user name for login
|
||||||
|
var password = password_example; // string | The password for login in clear text
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Logs user into the system
|
||||||
|
string result = apiInstance.LoginUser(username, password);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The user name for login |
|
||||||
|
**password** | **string**| The password for login in clear text |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**string**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="logoutuser"></a>
|
||||||
|
# **LogoutUser**
|
||||||
|
> void LogoutUser ()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class LogoutUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Logs out current logged in user session
|
||||||
|
apiInstance.LogoutUser();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
<a name="updateuser"></a>
|
||||||
|
# **UpdateUser**
|
||||||
|
> void UpdateUser (string username, User body)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdateUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | name that need to be deleted
|
||||||
|
var body = new User(); // User | Updated user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Updated user
|
||||||
|
apiInstance.UpdateUser(username, body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| name that need to be deleted |
|
||||||
|
**body** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
@ -257,13 +257,13 @@ namespace IO.Swagger.Client
|
|||||||
// determine which one to use
|
// determine which one to use
|
||||||
switch(auth)
|
switch(auth)
|
||||||
{
|
{
|
||||||
case "petstore_auth":
|
|
||||||
|
|
||||||
//TODO support oauth
|
|
||||||
break;
|
|
||||||
case "api_key":
|
case "api_key":
|
||||||
headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
|
headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "petstore_auth":
|
||||||
|
|
||||||
|
//TODO support oauth
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//TODO show warning about security definition not found
|
//TODO show warning about security definition not found
|
||||||
|
@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
|||||||
namespace IO.Swagger.Model {
|
namespace IO.Swagger.Model {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Describes the result of uploading an image resource
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class ApiResponse {
|
public class ApiResponse {
|
||||||
|
@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
|||||||
namespace IO.Swagger.Model {
|
namespace IO.Swagger.Model {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// A category for a pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class Category {
|
public class Category {
|
||||||
|
@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
|||||||
namespace IO.Swagger.Model {
|
namespace IO.Swagger.Model {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// An order for a pets from the pet store
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class Order {
|
public class Order {
|
||||||
|
@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
|||||||
namespace IO.Swagger.Model {
|
namespace IO.Swagger.Model {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// A pet for sale in the pet store
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class Pet {
|
public class Pet {
|
||||||
|
@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
|||||||
namespace IO.Swagger.Model {
|
namespace IO.Swagger.Model {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// A tag for a pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class Tag {
|
public class Tag {
|
||||||
|
@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
|||||||
namespace IO.Swagger.Model {
|
namespace IO.Swagger.Model {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// A User who is purchasing from the pet store
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class User {
|
public class User {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user