openapi-generator/samples/client/petstore/csharp/SwaggerClient/README.md

156 lines
6.8 KiB
Markdown
Raw Normal View History

# IO.Swagger - the C# library for the Swagger Petstore
2016-04-21 09:18:44 +00:00
2016-05-13 14:17:16 +00:00
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
2016-04-14 12:18:55 +00:00
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
2016-04-14 12:18:55 +00:00
- API version: 1.0.0
2016-04-21 09:18:44 +00:00
- SDK version: 1.0.0
2016-06-12 08:45:49 +00:00
- Build date: 2016-06-12T16:29:47.553+08:00
2016-04-14 12:18:55 +00:00
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
2015-07-06 03:24:59 +00:00
## Frameworks supported
2016-01-20 04:00:57 +00:00
- .NET 4.0 or later
2015-07-06 03:24:59 +00:00
- Windows Phone 7.1 (Mango)
## Dependencies
2016-01-20 04:00:57 +00:00
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
2015-07-06 03:24:59 +00:00
2016-02-21 10:54:13 +00:00
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
2015-07-06 03:24:59 +00:00
```
Install-Package RestSharp
Install-Package Newtonsoft.Json
2016-01-30 17:52:41 +00:00
```
2016-02-21 10:54:13 +00:00
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
## Installation
Run the following command to generate the DLL
- [Mac/Linux] `/bin/sh build.sh`
- [Windows] `build.bat`
2015-07-06 03:24:59 +00:00
2016-04-21 09:18:44 +00:00
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
```csharp
using IO.Swagger.Api;
using IO.Swagger.Client;
using Model;
```
2016-04-14 12:18:55 +00:00
## Getting Started
2016-04-14 12:18:55 +00:00
```csharp
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using Model;
2016-04-14 12:18:55 +00:00
namespace Example
{
public class Example
{
public void main()
{
2016-04-14 12:18:55 +00:00
var apiInstance = new FakeApi();
2016-06-10 12:10:50 +00:00
var number = 3.4; // decimal? | None
var _double = 1.2; // double? | None
var _string = _string_example; // string | None
var _byte = B; // byte[] | None
var integer = 56; // int? | None (optional)
var int32 = 56; // int? | None (optional)
var int64 = 789; // long? | None (optional)
var _float = 3.4; // float? | None (optional)
var binary = B; // byte[] | None (optional)
var date = 2013-10-20; // DateTime? | None (optional)
var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional)
var password = password_example; // string | None (optional)
2016-04-14 12:18:55 +00:00
try
{
2016-05-10 09:40:21 +00:00
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
}
catch (Exception e)
{
Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
2016-04-14 12:18:55 +00:00
}
}
}
}
```
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
2016-05-10 09:40:21 +00:00
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*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
2016-04-14 12:18:55 +00:00
## Documentation for Models
- [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Model.Animal](docs/Animal.md)
2016-05-07 09:49:54 +00:00
- [Model.AnimalFarm](docs/AnimalFarm.md)
- [Model.ApiResponse](docs/ApiResponse.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.Cat](docs/Cat.md)
- [Model.Category](docs/Category.md)
- [Model.Dog](docs/Dog.md)
2016-05-07 09:49:54 +00:00
- [Model.EnumClass](docs/EnumClass.md)
- [Model.EnumTest](docs/EnumTest.md)
- [Model.FormatTest](docs/FormatTest.md)
- [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model.Model200Response](docs/Model200Response.md)
- [Model.ModelReturn](docs/ModelReturn.md)
- [Model.Name](docs/Name.md)
- [Model.Order](docs/Order.md)
- [Model.Pet](docs/Pet.md)
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
- [Model.User](docs/User.md)
2016-04-14 12:18:55 +00:00
## Documentation for Authorization
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
2016-04-14 12:18:55 +00:00
### petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
2016-04-14 12:18:55 +00:00
- **Scopes**:
- write:pets: modify pets in your account
- read:pets: read your pets