-
the C# library for the Swagger Petstore
This is a sample server Petstore server. You can find out more about Swagger at <a href="http://swagger.io">http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key "special-key" to test the authorization filters
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version:
- Build date: 2016-04-14T08:16:33.913-04:00
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
Frameworks supported
- .NET 4.0 or later
- Windows Phone 7.1 (Mango)
Dependencies
- [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
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:
Install-Package RestSharp
Install-Package Newtonsoft.Json
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742
Installation
Run the following command to generate the DLL
- [Mac/Linux] compile-mono.sh
- [Windows] compile.bat
Then include the DLL (under the bin
folder) in the C# project
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Module;
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 {
apiInstance.AddPet(body);
} catch (Exception e) {
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
}
}
}
}
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io/v2
Class | Method | HTTP request | Description |
---|---|---|---|
::PetApi | AddPet | POST /pet | Add a new pet to the store |
::PetApi | AddPetUsingByteArray | POST /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store |
::PetApi | DeletePet | DELETE /pet/{petId} | Deletes a pet |
::PetApi | FindPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
::PetApi | FindPetsByTags | GET /pet/findByTags | Finds Pets by tags |
::PetApi | GetPetById | GET /pet/{petId} | Find pet by ID |
::PetApi | GetPetByIdInObject | GET /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' |
::PetApi | PetPetIdtestingByteArraytrueGet | GET /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' |
::PetApi | UpdatePet | PUT /pet | Update an existing pet |
::PetApi | UpdatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
::PetApi | UploadFile | POST /pet/{petId}/uploadImage | uploads an image |
::StoreApi | DeleteOrder | DELETE /store/order/{orderId} | Delete purchase order by ID |
::StoreApi | FindOrdersByStatus | GET /store/findByStatus | Finds orders by status |
::StoreApi | GetInventory | GET /store/inventory | Returns pet inventories by status |
::StoreApi | GetInventoryInObject | GET /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' |
::StoreApi | GetOrderById | GET /store/order/{orderId} | Find purchase order by ID |
::StoreApi | PlaceOrder | POST /store/order | Place an order for a pet |
::UserApi | CreateUser | POST /user | Create user |
::UserApi | CreateUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
::UserApi | CreateUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
::UserApi | DeleteUser | DELETE /user/{username} | Delete user |
::UserApi | GetUserByName | GET /user/{username} | Get user by user name |
::UserApi | LoginUser | GET /user/login | Logs user into the system |
::UserApi | LogoutUser | GET /user/logout | Logs out current logged in user session |
::UserApi | UpdateUser | PUT /user/{username} | Updated user |
Documentation for Models
- ::Animal
- ::Cat
- ::Category
- ::Dog
- ::FormatTest
- ::InlineResponse200
- ::Model200Response
- ::ModelReturn
- ::Name
- ::Order
- ::Pet
- ::SpecialModelName
- ::Tag
- ::User
Documentation for Authorization
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
test_api_client_id
- Type: API key
- API key parameter name: x-test_api_client_id
- Location: HTTP header
test_api_client_secret
- Type: API key
- API key parameter name: x-test_api_client_secret
- Location: HTTP header
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
test_http_basic
- Type: HTTP basic authentication
test_api_key_query
- Type: API key
- API key parameter name: test_api_key_query
- Location: URL query string
test_api_key_header
- Type: API key
- API key parameter name: test_api_key_header
- Location: HTTP header