|
| 1 | +# IO.Swagger - the C# library for the Swagger Petstore |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: |
| 6 | + |
| 7 | +- API version: 1.0.0 |
| 8 | +- SDK version: 1.0.0 |
| 9 | +- Build package: io.swagger.codegen.v3.generators.dotnet.CsharpDotNet2ClientCodegen |
| 10 | + |
| 11 | +<a name="frameworks-supported"></a> |
| 12 | +## Frameworks supported |
| 13 | +- .NET 2.0 |
| 14 | + |
| 15 | +<a name="dependencies"></a> |
| 16 | +## Dependencies |
| 17 | +- Mono compiler |
| 18 | +- Newtonsoft.Json.7.0.1 |
| 19 | +- RestSharp.Net2.1.1.11 |
| 20 | + |
| 21 | +Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator |
| 22 | + |
| 23 | +<a name="installation"></a> |
| 24 | +## Installation |
| 25 | +Run the following command to generate the DLL |
| 26 | +- [Mac/Linux] `/bin/sh compile-mono.sh` |
| 27 | +- [Windows] TODO |
| 28 | + |
| 29 | +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: |
| 30 | +```csharp |
| 31 | +using IO.Swagger.Api; |
| 32 | +using IO.Swagger.Client; |
| 33 | +using IO.Swagger.Model; |
| 34 | +``` |
| 35 | +<a name="getting-started"></a> |
| 36 | +## Getting Started |
| 37 | + |
| 38 | +```csharp |
| 39 | +using System; |
| 40 | +using System.Diagnostics; |
| 41 | +using IO.Swagger.Api; |
| 42 | +using IO.Swagger.Client; |
| 43 | +using IO.Swagger.Model; |
| 44 | + |
| 45 | +namespace Example |
| 46 | +{ |
| 47 | + public class Example |
| 48 | + { |
| 49 | + public void main() |
| 50 | + { |
| 51 | + |
| 52 | + // Configure OAuth2 access token for authorization: petstore_auth |
| 53 | + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; |
| 54 | + |
| 55 | + var apiInstance = new PetApi(); |
| 56 | + var body = new Pet(); // Pet | Pet object that needs to be added to the store |
| 57 | +
|
| 58 | + try |
| 59 | + { |
| 60 | + // Add a new pet to the store |
| 61 | + apiInstance.AddPet(body); |
| 62 | + } |
| 63 | + catch (Exception e) |
| 64 | + { |
| 65 | + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); |
| 66 | + } |
| 67 | + } |
| 68 | + } |
| 69 | +} |
| 70 | +``` |
| 71 | + |
| 72 | +<a name="documentation-for-api-endpoints"></a> |
| 73 | +## Documentation for API Endpoints |
| 74 | + |
| 75 | +All URIs are relative to *http://petstore.swagger.io/v2* |
| 76 | + |
| 77 | +Class | Method | HTTP request | Description |
| 78 | +------------ | ------------- | ------------- | ------------- |
| 79 | +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store |
| 80 | +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet |
| 81 | +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status |
| 82 | +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags |
| 83 | +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID |
| 84 | +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet |
| 85 | +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data |
| 86 | +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image |
| 87 | +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID |
| 88 | +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status |
| 89 | +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID |
| 90 | +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet |
| 91 | +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user |
| 92 | +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array |
| 93 | +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array |
| 94 | +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user |
| 95 | +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name |
| 96 | +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system |
| 97 | +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session |
| 98 | +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user |
| 99 | + |
| 100 | +<a name="documentation-for-models"></a> |
| 101 | +## Documentation for Models |
| 102 | + |
| 103 | + - [IO.Swagger.Model.ApiResponse](docs/ApiResponse.md) |
| 104 | + - [IO.Swagger.Model.Category](docs/Category.md) |
| 105 | + - [IO.Swagger.Model.Order](docs/Order.md) |
| 106 | + - [IO.Swagger.Model.Pet](docs/Pet.md) |
| 107 | + - [IO.Swagger.Model.Tag](docs/Tag.md) |
| 108 | + - [IO.Swagger.Model.User](docs/User.md) |
| 109 | + |
| 110 | +<a name="documentation-for-authorization"></a> |
| 111 | +## Documentation for Authorization |
| 112 | + |
| 113 | +<a name="api_key"></a> |
| 114 | +### api_key |
| 115 | + |
| 116 | +- **Type**: API key |
| 117 | +- **API key parameter name**: api_key |
| 118 | +- **Location**: HTTP header |
| 119 | + |
| 120 | +<a name="petstore_auth"></a> |
| 121 | +### petstore_auth |
| 122 | + |
| 123 | +- **Type**: OAuth |
| 124 | +- **Flow**: implicit |
| 125 | +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog |
| 126 | +- **Scopes**: |
| 127 | + - : |
| 128 | + |
0 commit comments