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:
@@ -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
|
||||
- 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
|
||||
switch(auth)
|
||||
{
|
||||
case "petstore_auth":
|
||||
|
||||
//TODO support oauth
|
||||
break;
|
||||
case "api_key":
|
||||
headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
|
||||
|
||||
break;
|
||||
case "petstore_auth":
|
||||
|
||||
//TODO support oauth
|
||||
break;
|
||||
default:
|
||||
//TODO show warning about security definition not found
|
||||
|
||||
@@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
||||
namespace IO.Swagger.Model {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Describes the result of uploading an image resource
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class ApiResponse {
|
||||
|
||||
@@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
||||
namespace IO.Swagger.Model {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// A category for a pet
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class Category {
|
||||
|
||||
@@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
||||
namespace IO.Swagger.Model {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// An order for a pets from the pet store
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class Order {
|
||||
|
||||
@@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
||||
namespace IO.Swagger.Model {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// A pet for sale in the pet store
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class Pet {
|
||||
|
||||
@@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
||||
namespace IO.Swagger.Model {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// A tag for a pet
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class Tag {
|
||||
|
||||
@@ -8,7 +8,7 @@ using Newtonsoft.Json;
|
||||
namespace IO.Swagger.Model {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// A User who is purchasing from the pet store
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class User {
|
||||
|
||||
Reference in New Issue
Block a user