openapi-generator/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient
Pierre Deman 74e31699da CsharpDotNet2Client - Use clientPackage in additionalProperties (#6581)
* CsharpDotNet2Client - Use clientPackage in additionalProperties if provided

* Give execution rights for csharp-dotnet2-petstore.sh

* Fix generation of C#.net2 apiPackage, modelPackage, clientPackage

* Fix modelPackage property missing when generating models

* Initialize clientPackage in constructor
2017-10-03 16:58:27 +08:00
..
.swagger-codegen remove ref to SO (#6209) 2017-07-29 18:53:08 +08:00
docs CsharpDotNet2Client - Use clientPackage in additionalProperties (#6581) 2017-10-03 16:58:27 +08:00
src/main/CsharpDotNet2/IO/Swagger remove ref to SO (#6209) 2017-07-29 18:53:08 +08:00
vendor Adding sample generator and output 2015-07-22 11:31:29 -07:00
.swagger-codegen-ignore [C#] Add auto-generated doc for c# 2.0 generator (#4354) 2016-12-14 11:49:15 +08:00
compile-mono.sh [csharp] Update nuget.exe URL for latest version (#6031) 2017-07-13 22:49:56 +08:00
README.md CsharpDotNet2Client - Use clientPackage in additionalProperties (#6581) 2017-10-03 16:58:27 +08:00

IO.Swagger - the C# library for the Swagger Petstore

This is a sample server Petstore server. You can find out more about Swagger at 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 C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CsharpDotNet2ClientCodegen

Frameworks supported

  • .NET 2.0

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

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:

using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

Getting Started

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 );
            }
        }
    }
}

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 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 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 GetInventory GET /store/inventory Returns pet inventories by status
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

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: api_key
  • Location: HTTP header

petstore_auth