forked from loafle/openapi-generator-original
Merge branch 'csharp_default_paths' of https://github.com/jimschubert/swagger-codegen into jimschubert-csharp_default_paths
Conflicts: modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java samples/client/petstore/csharp/SwaggerClient/README.md samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/InlineResponse200.cs samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using NUnit.Framework;
|
||||
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Api;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing FakeApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class FakeApiTests
|
||||
{
|
||||
private FakeApi instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each unit test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new FakeApi();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each unit test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of FakeApi
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<FakeApi> (instance, "instance is a FakeApi");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test TestEndpointParameters
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestEndpointParametersTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'TestEndpointParameters'
|
||||
double? number = null; // TODO: replace null with proper value
|
||||
double? _double = null; // TODO: replace null with proper value
|
||||
string _string = null; // TODO: replace null with proper value
|
||||
byte[] _byte = null; // TODO: replace null with proper value
|
||||
int? integer = null; // TODO: replace null with proper value
|
||||
int? int32 = null; // TODO: replace null with proper value
|
||||
long? int64 = null; // TODO: replace null with proper value
|
||||
float? _float = null; // TODO: replace null with proper value
|
||||
byte[] binary = null; // TODO: replace null with proper value
|
||||
DateTime? date = null; // TODO: replace null with proper value
|
||||
DateTime? dateTime = null; // TODO: replace null with proper value
|
||||
string password = null; // TODO: replace null with proper value
|
||||
instance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using NUnit.Framework;
|
||||
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing PetApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class PetApiTests
|
||||
{
|
||||
private PetApi instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each unit test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new PetApi();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each unit test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of PetApi
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<PetApi> (instance, "instance is a PetApi");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test AddPet
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void AddPetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'AddPet'
|
||||
Pet body = null; // TODO: replace null with proper value
|
||||
instance.AddPet(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test DeletePet
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DeletePetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'DeletePet'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string apiKey = null; // TODO: replace null with proper value
|
||||
instance.DeletePet(petId, apiKey);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test FindPetsByStatus
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void FindPetsByStatusTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'FindPetsByStatus'
|
||||
List<string> status = null; // TODO: replace null with proper value
|
||||
var response = instance.FindPetsByStatus(status);
|
||||
Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test FindPetsByTags
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void FindPetsByTagsTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'FindPetsByTags'
|
||||
List<string> tags = null; // TODO: replace null with proper value
|
||||
var response = instance.FindPetsByTags(tags);
|
||||
Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetPetById
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetPetByIdTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetPetById'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
var response = instance.GetPetById(petId);
|
||||
Assert.IsInstanceOf<Pet> (response, "response is Pet");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test UpdatePet
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UpdatePetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdatePet'
|
||||
Pet body = null; // TODO: replace null with proper value
|
||||
instance.UpdatePet(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test UpdatePetWithForm
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UpdatePetWithFormTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdatePetWithForm'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string name = null; // TODO: replace null with proper value
|
||||
string status = null; // TODO: replace null with proper value
|
||||
instance.UpdatePetWithForm(petId, name, status);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test UploadFile
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UploadFileTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UploadFile'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string additionalMetadata = null; // TODO: replace null with proper value
|
||||
System.IO.Stream file = null; // TODO: replace null with proper value
|
||||
var response = instance.UploadFile(petId, additionalMetadata, file);
|
||||
Assert.IsInstanceOf<ApiResponse> (response, "response is ApiResponse");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using NUnit.Framework;
|
||||
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing StoreApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class StoreApiTests
|
||||
{
|
||||
private StoreApi instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each unit test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new StoreApi();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each unit test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of StoreApi
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<StoreApi> (instance, "instance is a StoreApi");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test DeleteOrder
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DeleteOrderTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'DeleteOrder'
|
||||
string orderId = null; // TODO: replace null with proper value
|
||||
instance.DeleteOrder(orderId);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetInventory
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetInventoryTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetInventory'
|
||||
var response = instance.GetInventory();
|
||||
Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetOrderById
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetOrderByIdTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetOrderById'
|
||||
long? orderId = null; // TODO: replace null with proper value
|
||||
var response = instance.GetOrderById(orderId);
|
||||
Assert.IsInstanceOf<Order> (response, "response is Order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test PlaceOrder
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PlaceOrderTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'PlaceOrder'
|
||||
Order body = null; // TODO: replace null with proper value
|
||||
var response = instance.PlaceOrder(body);
|
||||
Assert.IsInstanceOf<Order> (response, "response is Order");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using NUnit.Framework;
|
||||
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing UserApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class UserApiTests
|
||||
{
|
||||
private UserApi instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each unit test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new UserApi();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each unit test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of UserApi
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<UserApi> (instance, "instance is a UserApi");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test CreateUser
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CreateUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'CreateUser'
|
||||
User body = null; // TODO: replace null with proper value
|
||||
instance.CreateUser(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test CreateUsersWithArrayInput
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CreateUsersWithArrayInputTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'CreateUsersWithArrayInput'
|
||||
List<User> body = null; // TODO: replace null with proper value
|
||||
instance.CreateUsersWithArrayInput(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test CreateUsersWithListInput
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CreateUsersWithListInputTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'CreateUsersWithListInput'
|
||||
List<User> body = null; // TODO: replace null with proper value
|
||||
instance.CreateUsersWithListInput(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test DeleteUser
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DeleteUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'DeleteUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
instance.DeleteUser(username);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetUserByName
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetUserByNameTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetUserByName'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
var response = instance.GetUserByName(username);
|
||||
Assert.IsInstanceOf<User> (response, "response is User");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test LoginUser
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void LoginUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'LoginUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
string password = null; // TODO: replace null with proper value
|
||||
var response = instance.LoginUser(username, password);
|
||||
Assert.IsInstanceOf<string> (response, "response is string");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test LogoutUser
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void LogoutUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'LogoutUser'
|
||||
instance.LogoutUser();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test UpdateUser
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UpdateUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdateUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
User body = null; // TODO: replace null with proper value
|
||||
instance.UpdateUser(username, body);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{19F1DEBC-DE5E-4517-8062-F000CD499087}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>IO.Swagger.Test</RootNamespace>
|
||||
<AssemblyName>IO.Swagger.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
|
||||
<Project>{27FD0ED8-0F4A-458A-B564-6BFC0A02B9C9}</Project>
|
||||
<Name>IO.Swagger</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Animal
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class AnimalTests
|
||||
{
|
||||
private Animal instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Animal();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Animal
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void AnimalInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Animal> (instance, "instance is a Animal");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'ClassName'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ApiResponse
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class ApiResponseTests
|
||||
{
|
||||
private ApiResponse instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new ApiResponse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ApiResponse
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ApiResponseInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ApiResponse> (instance, "instance is a ApiResponse");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Code'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CodeTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Code'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Type'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Message'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void MessageTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Message'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Cat
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class CatTests
|
||||
{
|
||||
private Cat instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Cat();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Cat
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CatInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Cat> (instance, "instance is a Cat");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'ClassName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Declawed'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DeclawedTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Declawed'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Category
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class CategoryTests
|
||||
{
|
||||
private Category instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Category();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Category
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CategoryInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Category> (instance, "instance is a Category");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Name'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Dog
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class DogTests
|
||||
{
|
||||
private Dog instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Dog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Dog
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DogInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Dog> (instance, "instance is a Dog");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'ClassName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Breed'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void BreedTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Breed'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing FormatTest
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class FormatTestTests
|
||||
{
|
||||
private FormatTest instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new FormatTest();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of FormatTest
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void FormatTestInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<FormatTest> (instance, "instance is a FormatTest");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Integer'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void IntegerTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Integer'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Int32'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Int32Test()
|
||||
{
|
||||
// TODO: unit test for the property 'Int32'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Int64'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Int64Test()
|
||||
{
|
||||
// TODO: unit test for the property 'Int64'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Number'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NumberTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Number'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property '_Float'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void _FloatTest()
|
||||
{
|
||||
// TODO: unit test for the property '_Float'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property '_Double'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void _DoubleTest()
|
||||
{
|
||||
// TODO: unit test for the property '_Double'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property '_String'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void _StringTest()
|
||||
{
|
||||
// TODO: unit test for the property '_String'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property '_Byte'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void _ByteTest()
|
||||
{
|
||||
// TODO: unit test for the property '_Byte'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Binary'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void BinaryTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Binary'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Date'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DateTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Date'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'DateTime'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void DateTimeTest()
|
||||
{
|
||||
// TODO: unit test for the property 'DateTime'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Uuid'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UuidTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Uuid'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Password'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PasswordTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Password'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Model200Response
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class Model200ResponseTests
|
||||
{
|
||||
private Model200Response instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Model200Response();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Model200Response
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Model200ResponseInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Model200Response> (instance, "instance is a Model200Response");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Name'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ModelReturn
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class ModelReturnTests
|
||||
{
|
||||
private ModelReturn instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new ModelReturn();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ModelReturn
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ModelReturnInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ModelReturn> (instance, "instance is a ModelReturn");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property '_Return'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void _ReturnTest()
|
||||
{
|
||||
// TODO: unit test for the property '_Return'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Name
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class NameTests
|
||||
{
|
||||
private Name instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Name();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Name
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NameInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Name> (instance, "instance is a Name");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property '_Name'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void _NameTest()
|
||||
{
|
||||
// TODO: unit test for the property '_Name'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'SnakeCase'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void SnakeCaseTest()
|
||||
{
|
||||
// TODO: unit test for the property 'SnakeCase'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Property'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PropertyTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Property'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Order
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class OrderTests
|
||||
{
|
||||
private Order instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Order();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Order
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void OrderInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Order> (instance, "instance is a Order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'PetId'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PetIdTest()
|
||||
{
|
||||
// TODO: unit test for the property 'PetId'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Quantity'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void QuantityTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Quantity'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'ShipDate'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ShipDateTest()
|
||||
{
|
||||
// TODO: unit test for the property 'ShipDate'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Status'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void StatusTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Status'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Complete'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CompleteTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Complete'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class PetTests
|
||||
{
|
||||
private Pet instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Pet();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Pet
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PetInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Pet> (instance, "instance is a Pet");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Category'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CategoryTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Category'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Name'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'PhotoUrls'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PhotoUrlsTest()
|
||||
{
|
||||
// TODO: unit test for the property 'PhotoUrls'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Tags'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TagsTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Tags'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Status'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void StatusTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Status'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing SpecialModelName
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class SpecialModelNameTests
|
||||
{
|
||||
private SpecialModelName instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new SpecialModelName();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of SpecialModelName
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void SpecialModelNameInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<SpecialModelName> (instance, "instance is a SpecialModelName");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'SpecialPropertyName'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void SpecialPropertyNameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'SpecialPropertyName'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Tag
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class TagTests
|
||||
{
|
||||
private Tag instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new Tag();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Tag
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TagInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<Tag> (instance, "instance is a Tag");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Name'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing User
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class UserTests
|
||||
{
|
||||
private User instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new User();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of User
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UserInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<User> (instance, "instance is a User");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Username'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UsernameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Username'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'FirstName'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void FirstNameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'FirstName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'LastName'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void LastNameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'LastName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Email'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void EmailTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Email'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Password'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PasswordTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Password'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Phone'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PhoneTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Phone'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'UserStatus'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void UserStatusTest()
|
||||
{
|
||||
// TODO: unit test for the property 'UserStatus'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="2.6.3" targetFramework="net45" />
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
||||
@@ -0,0 +1,418 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using RestSharp;
|
||||
using IO.Swagger.Client;
|
||||
|
||||
namespace IO.Swagger.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IFakeApi
|
||||
{
|
||||
#region Synchronous Operations
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns></returns>
|
||||
void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
#endregion Synchronous Operations
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public class FakeApi : IFakeApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FakeApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public FakeApi(String basePath)
|
||||
{
|
||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||
|
||||
// ensure API client has configuration ready
|
||||
if (Configuration.ApiClient.Configuration == null)
|
||||
{
|
||||
this.Configuration.ApiClient.Configuration = this.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FakeApi"/> class
|
||||
/// using Configuration object
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration</param>
|
||||
/// <returns></returns>
|
||||
public FakeApi(Configuration configuration = null)
|
||||
{
|
||||
if (configuration == null) // use the default one in Configuration
|
||||
this.Configuration = Configuration.Default;
|
||||
else
|
||||
this.Configuration = configuration;
|
||||
|
||||
// ensure API client has configuration ready
|
||||
if (Configuration.ApiClient.Configuration == null)
|
||||
{
|
||||
this.Configuration.ApiClient.Configuration = this.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
public String GetBasePath()
|
||||
{
|
||||
return this.Configuration.ApiClient.RestClient.BaseUrl.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
[Obsolete("SetBasePath is deprecated, please do 'Configuraiton.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
|
||||
public void SetBasePath(String basePath)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
public Configuration Configuration {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default header.
|
||||
/// </summary>
|
||||
/// <returns>Dictionary of HTTP header</returns>
|
||||
[Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
|
||||
public Dictionary<String, String> DefaultHeader()
|
||||
{
|
||||
return this.Configuration.DefaultHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add default header.
|
||||
/// </summary>
|
||||
/// <param name="key">Header field name.</param>
|
||||
/// <param name="value">Header field value.</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
|
||||
public void AddDefaultHeader(string key, string value)
|
||||
{
|
||||
this.Configuration.AddDefaultHeader(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns></returns>
|
||||
public void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
TestEndpointParametersWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_string' is set
|
||||
if (_string == null)
|
||||
throw new ApiException(400, "Missing required parameter '_string' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_byte' is set
|
||||
if (_byte == null)
|
||||
throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
var localVarPath = "/fake";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter
|
||||
if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter
|
||||
if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter
|
||||
if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter
|
||||
if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter
|
||||
if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter
|
||||
if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter
|
||||
if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter
|
||||
if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter
|
||||
if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter
|
||||
if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter
|
||||
if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
await TestEndpointParametersAsyncWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_string' is set
|
||||
if (_string == null)
|
||||
throw new ApiException(400, "Missing required parameter '_string' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_byte' is set
|
||||
if (_byte == null)
|
||||
throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
var localVarPath = "/fake";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter
|
||||
if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter
|
||||
if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter
|
||||
if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter
|
||||
if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter
|
||||
if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter
|
||||
if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter
|
||||
if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter
|
||||
if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter
|
||||
if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter
|
||||
if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter
|
||||
if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,847 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using RestSharp;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IStoreApi
|
||||
{
|
||||
#region Synchronous Operations
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns></returns>
|
||||
void DeleteOrder (string orderId);
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Dictionary<string, int?></returns>
|
||||
Dictionary<string, int?> GetInventory ();
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of Dictionary<string, int?></returns>
|
||||
ApiResponse<Dictionary<string, int?>> GetInventoryWithHttpInfo ();
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Order</returns>
|
||||
Order GetOrderById (long? orderId);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
ApiResponse<Order> GetOrderByIdWithHttpInfo (long? orderId);
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Order</returns>
|
||||
Order PlaceOrder (Order body);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
|
||||
#endregion Synchronous Operations
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task DeleteOrderAsync (string orderId);
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId);
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of Dictionary<string, int?></returns>
|
||||
System.Threading.Tasks.Task<Dictionary<string, int?>> GetInventoryAsync ();
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of ApiResponse (Dictionary<string, int?>)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ();
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId);
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body);
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public class StoreApi : IStoreApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StoreApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public StoreApi(String basePath)
|
||||
{
|
||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||
|
||||
// ensure API client has configuration ready
|
||||
if (Configuration.ApiClient.Configuration == null)
|
||||
{
|
||||
this.Configuration.ApiClient.Configuration = this.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StoreApi"/> class
|
||||
/// using Configuration object
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration</param>
|
||||
/// <returns></returns>
|
||||
public StoreApi(Configuration configuration = null)
|
||||
{
|
||||
if (configuration == null) // use the default one in Configuration
|
||||
this.Configuration = Configuration.Default;
|
||||
else
|
||||
this.Configuration = configuration;
|
||||
|
||||
// ensure API client has configuration ready
|
||||
if (Configuration.ApiClient.Configuration == null)
|
||||
{
|
||||
this.Configuration.ApiClient.Configuration = this.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
public String GetBasePath()
|
||||
{
|
||||
return this.Configuration.ApiClient.RestClient.BaseUrl.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
[Obsolete("SetBasePath is deprecated, please do 'Configuraiton.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
|
||||
public void SetBasePath(String basePath)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
public Configuration Configuration {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default header.
|
||||
/// </summary>
|
||||
/// <returns>Dictionary of HTTP header</returns>
|
||||
[Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
|
||||
public Dictionary<String, String> DefaultHeader()
|
||||
{
|
||||
return this.Configuration.DefaultHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add default header.
|
||||
/// </summary>
|
||||
/// <param name="key">Header field name.</param>
|
||||
/// <param name="value">Header field value.</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
|
||||
public void AddDefaultHeader(string key, string value)
|
||||
{
|
||||
this.Configuration.AddDefaultHeader(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns></returns>
|
||||
public void DeleteOrder (string orderId)
|
||||
{
|
||||
DeleteOrderWithHttpInfo(orderId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
|
||||
|
||||
var localVarPath = "/store/order/{orderId}";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId)
|
||||
{
|
||||
await DeleteOrderAsyncWithHttpInfo(orderId);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
|
||||
|
||||
var localVarPath = "/store/order/{orderId}";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Dictionary<string, int?></returns>
|
||||
public Dictionary<string, int?> GetInventory ()
|
||||
{
|
||||
ApiResponse<Dictionary<string, int?>> localVarResponse = GetInventoryWithHttpInfo();
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of Dictionary<string, int?></returns>
|
||||
public ApiResponse< Dictionary<string, int?> > GetInventoryWithHttpInfo ()
|
||||
{
|
||||
|
||||
var localVarPath = "/store/inventory";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Dictionary<string, int?>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary<string, int?>)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of Dictionary<string, int?></returns>
|
||||
public async System.Threading.Tasks.Task<Dictionary<string, int?>> GetInventoryAsync ()
|
||||
{
|
||||
ApiResponse<Dictionary<string, int?>> localVarResponse = await GetInventoryAsyncWithHttpInfo();
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of ApiResponse (Dictionary<string, int?>)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ()
|
||||
{
|
||||
|
||||
var localVarPath = "/store/inventory";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Dictionary<string, int?>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary<string, int?>)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Order</returns>
|
||||
public Order GetOrderById (long? orderId)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = GetOrderByIdWithHttpInfo(orderId);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||
|
||||
var localVarPath = "/store/order/{orderId}";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Order>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
public async System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId);
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||
|
||||
var localVarPath = "/store/order/{orderId}";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Order>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Order</returns>
|
||||
public Order PlaceOrder (Order body)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(body);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
|
||||
|
||||
var localVarPath = "/store/order";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (body.GetType() != typeof(byte[]))
|
||||
{
|
||||
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
localVarPostBody = body; // byte array
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Order>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of Order</returns>
|
||||
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
|
||||
{
|
||||
ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(body);
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="body">order placed for purchasing the pet</param>
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body)
|
||||
{
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null)
|
||||
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
|
||||
|
||||
var localVarPath = "/store/order";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (body.GetType() != typeof(byte[]))
|
||||
{
|
||||
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||
}
|
||||
else
|
||||
{
|
||||
localVarPostBody = body; // byte array
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Order>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,449 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace IO.Swagger.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// API client is mainly responible for making the HTTP call to the API backend.
|
||||
/// </summary>
|
||||
public class ApiClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiClient" /> class
|
||||
/// with default configuration and base path (http://petstore.swagger.io/v2).
|
||||
/// </summary>
|
||||
public ApiClient()
|
||||
{
|
||||
Configuration = Configuration.Default;
|
||||
RestClient = new RestClient("http://petstore.swagger.io/v2");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiClient" /> class
|
||||
/// with default base path (http://petstore.swagger.io/v2).
|
||||
/// </summary>
|
||||
/// <param name="config">An instance of Configuration.</param>
|
||||
public ApiClient(Configuration config = null)
|
||||
{
|
||||
if (config == null)
|
||||
Configuration = Configuration.Default;
|
||||
else
|
||||
Configuration = config;
|
||||
|
||||
RestClient = new RestClient("http://petstore.swagger.io/v2");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiClient" /> class
|
||||
/// with default configuration.
|
||||
/// </summary>
|
||||
/// <param name="basePath">The base path.</param>
|
||||
public ApiClient(String basePath = "http://petstore.swagger.io/v2")
|
||||
{
|
||||
if (String.IsNullOrEmpty(basePath))
|
||||
throw new ArgumentException("basePath cannot be empty");
|
||||
|
||||
RestClient = new RestClient(basePath);
|
||||
Configuration = Configuration.Default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default API client for making HTTP calls.
|
||||
/// </summary>
|
||||
/// <value>The default API client.</value>
|
||||
[Obsolete("ApiClient.Default is deprecated, please use 'Configuration.Default.ApiClient' instead.")]
|
||||
public static ApiClient Default;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Configuration.
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration.</value>
|
||||
public Configuration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RestClient.
|
||||
/// </summary>
|
||||
/// <value>An instance of the RestClient</value>
|
||||
public RestClient RestClient { get; set; }
|
||||
|
||||
// Creates and sets up a RestRequest prior to a call.
|
||||
private RestRequest PrepareRequest(
|
||||
String path, RestSharp.Method method, Dictionary<String, String> queryParams, Object postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams,
|
||||
String contentType)
|
||||
{
|
||||
var request = new RestRequest(path, method);
|
||||
|
||||
// add path parameter, if any
|
||||
foreach(var param in pathParams)
|
||||
request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment);
|
||||
|
||||
// add header parameter, if any
|
||||
foreach(var param in headerParams)
|
||||
request.AddHeader(param.Key, param.Value);
|
||||
|
||||
// add query parameter, if any
|
||||
foreach(var param in queryParams)
|
||||
request.AddQueryParameter(param.Key, param.Value);
|
||||
|
||||
// add form parameter, if any
|
||||
foreach(var param in formParams)
|
||||
request.AddParameter(param.Key, param.Value);
|
||||
|
||||
// add file parameter, if any
|
||||
foreach(var param in fileParams)
|
||||
{
|
||||
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType);
|
||||
}
|
||||
|
||||
if (postBody != null) // http body (model or byte[]) parameter
|
||||
{
|
||||
if (postBody.GetType() == typeof(String))
|
||||
{
|
||||
request.AddParameter("application/json", postBody, ParameterType.RequestBody);
|
||||
}
|
||||
else if (postBody.GetType() == typeof(byte[]))
|
||||
{
|
||||
request.AddParameter(contentType, postBody, ParameterType.RequestBody);
|
||||
}
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the HTTP request (Sync).
|
||||
/// </summary>
|
||||
/// <param name="path">URL path.</param>
|
||||
/// <param name="method">HTTP method.</param>
|
||||
/// <param name="queryParams">Query parameters.</param>
|
||||
/// <param name="postBody">HTTP body (POST request).</param>
|
||||
/// <param name="headerParams">Header parameters.</param>
|
||||
/// <param name="formParams">Form parameters.</param>
|
||||
/// <param name="fileParams">File parameters.</param>
|
||||
/// <param name="pathParams">Path parameters.</param>
|
||||
/// <param name="contentType">Content Type of the request</param>
|
||||
/// <returns>Object</returns>
|
||||
public Object CallApi(
|
||||
String path, RestSharp.Method method, Dictionary<String, String> queryParams, Object postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams,
|
||||
String contentType)
|
||||
{
|
||||
var request = PrepareRequest(
|
||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||
pathParams, contentType);
|
||||
|
||||
// set timeout
|
||||
RestClient.Timeout = Configuration.Timeout;
|
||||
// set user agent
|
||||
RestClient.UserAgent = Configuration.UserAgent;
|
||||
|
||||
var response = RestClient.Execute(request);
|
||||
return (Object) response;
|
||||
}
|
||||
/// <summary>
|
||||
/// Makes the asynchronous HTTP request.
|
||||
/// </summary>
|
||||
/// <param name="path">URL path.</param>
|
||||
/// <param name="method">HTTP method.</param>
|
||||
/// <param name="queryParams">Query parameters.</param>
|
||||
/// <param name="postBody">HTTP body (POST request).</param>
|
||||
/// <param name="headerParams">Header parameters.</param>
|
||||
/// <param name="formParams">Form parameters.</param>
|
||||
/// <param name="fileParams">File parameters.</param>
|
||||
/// <param name="pathParams">Path parameters.</param>
|
||||
/// <param name="contentType">Content type.</param>
|
||||
/// <returns>The Task instance.</returns>
|
||||
public async System.Threading.Tasks.Task<Object> CallApiAsync(
|
||||
String path, RestSharp.Method method, Dictionary<String, String> queryParams, Object postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams,
|
||||
String contentType)
|
||||
{
|
||||
var request = PrepareRequest(
|
||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||
pathParams, contentType);
|
||||
var response = await RestClient.ExecuteTaskAsync(request);
|
||||
return (Object)response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Escape string (url-encoded).
|
||||
/// </summary>
|
||||
/// <param name="str">String to be escaped.</param>
|
||||
/// <returns>Escaped string.</returns>
|
||||
public string EscapeString(string str)
|
||||
{
|
||||
return UrlEncode(str);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create FileParameter based on Stream.
|
||||
/// </summary>
|
||||
/// <param name="name">Parameter name.</param>
|
||||
/// <param name="stream">Input stream.</param>
|
||||
/// <returns>FileParameter.</returns>
|
||||
public FileParameter ParameterToFile(string name, Stream stream)
|
||||
{
|
||||
if (stream is FileStream)
|
||||
return FileParameter.Create(name, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name));
|
||||
else
|
||||
return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
|
||||
/// If parameter is a list, join the list with ",".
|
||||
/// Otherwise just return the string.
|
||||
/// </summary>
|
||||
/// <param name="obj">The parameter (header, path, query, form).</param>
|
||||
/// <returns>Formatted string.</returns>
|
||||
public string ParameterToString(object obj)
|
||||
{
|
||||
if (obj is DateTime)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return ((DateTime)obj).ToString (Configuration.DateTimeFormat);
|
||||
else if (obj is DateTimeOffset)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat);
|
||||
else if (obj is IList)
|
||||
{
|
||||
var flattenedString = new StringBuilder();
|
||||
foreach (var param in (IList)obj)
|
||||
{
|
||||
if (flattenedString.Length > 0)
|
||||
flattenedString.Append(",");
|
||||
flattenedString.Append(param);
|
||||
}
|
||||
return flattenedString.ToString();
|
||||
}
|
||||
else
|
||||
return Convert.ToString (obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize the JSON string into a proper object.
|
||||
/// </summary>
|
||||
/// <param name="response">The HTTP response.</param>
|
||||
/// <param name="type">Object type.</param>
|
||||
/// <returns>Object representation of the JSON string.</returns>
|
||||
public object Deserialize(IRestResponse response, Type type)
|
||||
{
|
||||
IList<Parameter> headers = response.Headers;
|
||||
if (type == typeof(byte[])) // return byte array
|
||||
{
|
||||
return response.RawBytes;
|
||||
}
|
||||
|
||||
if (type == typeof(Stream))
|
||||
{
|
||||
if (headers != null)
|
||||
{
|
||||
var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath)
|
||||
? Path.GetTempPath()
|
||||
: Configuration.TempFolderPath;
|
||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||
foreach (var header in headers)
|
||||
{
|
||||
var match = regex.Match(header.ToString());
|
||||
if (match.Success)
|
||||
{
|
||||
string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
|
||||
File.WriteAllBytes(fileName, response.RawBytes);
|
||||
return new FileStream(fileName, FileMode.Open);
|
||||
}
|
||||
}
|
||||
}
|
||||
var stream = new MemoryStream(response.RawBytes);
|
||||
return stream;
|
||||
}
|
||||
|
||||
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
|
||||
{
|
||||
return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind);
|
||||
}
|
||||
|
||||
if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type
|
||||
{
|
||||
return ConvertType(response.Content, type);
|
||||
}
|
||||
|
||||
// at this point, it must be a model (json)
|
||||
try
|
||||
{
|
||||
return JsonConvert.DeserializeObject(response.Content, type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ApiException(500, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize an input (model) into JSON string
|
||||
/// </summary>
|
||||
/// <param name="obj">Object.</param>
|
||||
/// <returns>JSON string.</returns>
|
||||
public String Serialize(object obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
return obj != null ? JsonConvert.SerializeObject(obj) : null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ApiException(500, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Select the Content-Type header's value from the given content-type array:
|
||||
/// if JSON exists in the given array, use it;
|
||||
/// otherwise use the first one defined in 'consumes'
|
||||
/// </summary>
|
||||
/// <param name="contentTypes">The Content-Type array to select from.</param>
|
||||
/// <returns>The Content-Type header to use.</returns>
|
||||
public String SelectHeaderContentType(String[] contentTypes)
|
||||
{
|
||||
if (contentTypes.Length == 0)
|
||||
return null;
|
||||
|
||||
if (contentTypes.Contains("application/json", StringComparer.OrdinalIgnoreCase))
|
||||
return "application/json";
|
||||
|
||||
return contentTypes[0]; // use the first content type specified in 'consumes'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Select the Accept header's value from the given accepts array:
|
||||
/// if JSON exists in the given array, use it;
|
||||
/// otherwise use all of them (joining into a string)
|
||||
/// </summary>
|
||||
/// <param name="accepts">The accepts array to select from.</param>
|
||||
/// <returns>The Accept header to use.</returns>
|
||||
public String SelectHeaderAccept(String[] accepts)
|
||||
{
|
||||
if (accepts.Length == 0)
|
||||
return null;
|
||||
|
||||
if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
|
||||
return "application/json";
|
||||
|
||||
return String.Join(",", accepts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode string in base64 format.
|
||||
/// </summary>
|
||||
/// <param name="text">String to be encoded.</param>
|
||||
/// <returns>Encoded string.</returns>
|
||||
public static string Base64Encode(string text)
|
||||
{
|
||||
return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dynamically cast the object into target type.
|
||||
/// Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast
|
||||
/// </summary>
|
||||
/// <param name="source">Object to be casted</param>
|
||||
/// <param name="dest">Target type</param>
|
||||
/// <returns>Casted object</returns>
|
||||
public static dynamic ConvertType(dynamic source, Type dest)
|
||||
{
|
||||
return Convert.ChangeType(source, dest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert stream to byte array
|
||||
/// Credit/Ref: http://stackoverflow.com/a/221941/677735
|
||||
/// </summary>
|
||||
/// <param name="input">Input stream to be converted</param>
|
||||
/// <returns>Byte array</returns>
|
||||
public static byte[] ReadAsBytes(Stream input)
|
||||
{
|
||||
byte[] buffer = new byte[16*1024];
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
int read;
|
||||
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
ms.Write(buffer, 0, read);
|
||||
}
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL encode a string
|
||||
/// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50
|
||||
/// </summary>
|
||||
/// <param name="input">String to be URL encoded</param>
|
||||
/// <returns>Byte array</returns>
|
||||
public static string UrlEncode(string input)
|
||||
{
|
||||
const int maxLength = 32766;
|
||||
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException("input");
|
||||
}
|
||||
|
||||
if (input.Length <= maxLength)
|
||||
{
|
||||
return Uri.EscapeDataString(input);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(input.Length * 2);
|
||||
int index = 0;
|
||||
|
||||
while (index < input.Length)
|
||||
{
|
||||
int length = Math.Min(input.Length - index, maxLength);
|
||||
string subString = input.Substring(index, length);
|
||||
|
||||
sb.Append(Uri.EscapeDataString(subString));
|
||||
index += subString.Length;
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sanitize filename by removing the path
|
||||
/// </summary>
|
||||
/// <param name="filename">Filename</param>
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
|
||||
if (match.Success)
|
||||
{
|
||||
return match.Groups[1].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace IO.Swagger.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// API Exception
|
||||
/// </summary>
|
||||
public class ApiException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the error code (HTTP status code)
|
||||
/// </summary>
|
||||
/// <value>The error code (HTTP status code).</value>
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the error content (body json object)
|
||||
/// </summary>
|
||||
/// <value>The error content (Http response body).</value>
|
||||
public dynamic ErrorContent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
public ApiException() {}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="errorCode">HTTP status code.</param>
|
||||
/// <param name="message">Error message.</param>
|
||||
public ApiException(int errorCode, string message) : base(message)
|
||||
{
|
||||
this.ErrorCode = errorCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="errorCode">HTTP status code.</param>
|
||||
/// <param name="message">Error message.</param>
|
||||
/// <param name="errorContent">Error content.</param>
|
||||
public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message)
|
||||
{
|
||||
this.ErrorCode = errorCode;
|
||||
this.ErrorContent = errorContent;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IO.Swagger.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// API Response
|
||||
/// </summary>
|
||||
public class ApiResponse<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the status code (HTTP status code)
|
||||
/// </summary>
|
||||
/// <value>The status code.</value>
|
||||
public int StatusCode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP headers
|
||||
/// </summary>
|
||||
/// <value>HTTP headers</value>
|
||||
public IDictionary<string, string> Headers { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data (parsed HTTP body)
|
||||
/// </summary>
|
||||
/// <value>The data.</value>
|
||||
public T Data { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse<T>" /> class.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">HTTP status code.</param>
|
||||
/// <param name="headers">HTTP headers.</param>
|
||||
/// <param name="data">Data (parsed HTTP body)</param>
|
||||
public ApiResponse(int statusCode, IDictionary<string, string> headers, T data)
|
||||
{
|
||||
this.StatusCode= statusCode;
|
||||
this.Headers = headers;
|
||||
this.Data = data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IO.Swagger.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a set of configuration settings
|
||||
/// </summary>
|
||||
public class Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Configuration class with different settings
|
||||
/// </summary>
|
||||
/// <param name="apiClient">Api client</param>
|
||||
/// <param name="defaultHeader">Dictionary of default HTTP header</param>
|
||||
/// <param name="username">Username</param>
|
||||
/// <param name="password">Password</param>
|
||||
/// <param name="accessToken">accessToken</param>
|
||||
/// <param name="apiKey">Dictionary of API key</param>
|
||||
/// <param name="apiKeyPrefix">Dictionary of API key prefix</param>
|
||||
/// <param name="tempFolderPath">Temp folder path</param>
|
||||
/// <param name="dateTimeFormat">DateTime format string</param>
|
||||
/// <param name="timeout">HTTP connection timeout (in milliseconds)</param>
|
||||
/// <param name="userAgent">HTTP user agent</param>
|
||||
public Configuration(ApiClient apiClient = null,
|
||||
Dictionary<String, String> defaultHeader = null,
|
||||
string username = null,
|
||||
string password = null,
|
||||
string accessToken = null,
|
||||
Dictionary<String, String> apiKey = null,
|
||||
Dictionary<String, String> apiKeyPrefix = null,
|
||||
string tempFolderPath = null,
|
||||
string dateTimeFormat = null,
|
||||
int timeout = 100000,
|
||||
string userAgent = "Swagger-Codegen/1.0.0/csharp"
|
||||
)
|
||||
{
|
||||
setApiClientUsingDefault(apiClient);
|
||||
|
||||
Username = username;
|
||||
Password = password;
|
||||
AccessToken = accessToken;
|
||||
UserAgent = userAgent;
|
||||
|
||||
if (defaultHeader != null)
|
||||
DefaultHeader = defaultHeader;
|
||||
if (apiKey != null)
|
||||
ApiKey = apiKey;
|
||||
if (apiKeyPrefix != null)
|
||||
ApiKeyPrefix = apiKeyPrefix;
|
||||
|
||||
TempFolderPath = tempFolderPath;
|
||||
DateTimeFormat = dateTimeFormat;
|
||||
Timeout = timeout;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Configuration class.
|
||||
/// </summary>
|
||||
/// <param name="apiClient">Api client.</param>
|
||||
public Configuration(ApiClient apiClient)
|
||||
{
|
||||
setApiClientUsingDefault(apiClient);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Version of the package.
|
||||
/// </summary>
|
||||
/// <value>Version of the package.</value>
|
||||
public const string Version = "1.0.0";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default Configuration.
|
||||
/// </summary>
|
||||
/// <value>Configuration.</value>
|
||||
public static Configuration Default = new Configuration();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
|
||||
/// </summary>
|
||||
/// <value>Timeout.</value>
|
||||
public int Timeout
|
||||
{
|
||||
get { return ApiClient.RestClient.Timeout; }
|
||||
|
||||
set
|
||||
{
|
||||
if (ApiClient != null)
|
||||
ApiClient.RestClient.Timeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default API client for making HTTP calls.
|
||||
/// </summary>
|
||||
/// <value>The API client.</value>
|
||||
public ApiClient ApiClient;
|
||||
|
||||
/// <summary>
|
||||
/// Set the ApiClient using Default or ApiClient instance.
|
||||
/// </summary>
|
||||
/// <param name="apiClient">An instance of ApiClient.</param>
|
||||
/// <returns></returns>
|
||||
public void setApiClientUsingDefault (ApiClient apiClient = null)
|
||||
{
|
||||
if (apiClient == null)
|
||||
{
|
||||
if (Default != null && Default.ApiClient == null)
|
||||
Default.ApiClient = new ApiClient();
|
||||
|
||||
ApiClient = Default != null ? Default.ApiClient : new ApiClient();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Default != null && Default.ApiClient == null)
|
||||
Default.ApiClient = apiClient;
|
||||
|
||||
ApiClient = apiClient;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<String, String> _defaultHeaderMap = new Dictionary<String, String>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default header.
|
||||
/// </summary>
|
||||
public Dictionary<String, String> DefaultHeader
|
||||
{
|
||||
get { return _defaultHeaderMap; }
|
||||
|
||||
set
|
||||
{
|
||||
_defaultHeaderMap = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add default header.
|
||||
/// </summary>
|
||||
/// <param name="key">Header field name.</param>
|
||||
/// <param name="value">Header field value.</param>
|
||||
/// <returns></returns>
|
||||
public void AddDefaultHeader(string key, string value)
|
||||
{
|
||||
_defaultHeaderMap.Add(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP user agent.
|
||||
/// </summary>
|
||||
/// <value>Http user agent.</value>
|
||||
public String UserAgent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the username (HTTP basic authentication).
|
||||
/// </summary>
|
||||
/// <value>The username.</value>
|
||||
public String Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password (HTTP basic authentication).
|
||||
/// </summary>
|
||||
/// <value>The password.</value>
|
||||
public String Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the access token for OAuth2 authentication.
|
||||
/// </summary>
|
||||
/// <value>The access token.</value>
|
||||
public String AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the API key based on the authentication name.
|
||||
/// </summary>
|
||||
/// <value>The API key.</value>
|
||||
public Dictionary<String, String> ApiKey = new Dictionary<String, String>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
|
||||
/// </summary>
|
||||
/// <value>The prefix of the API key.</value>
|
||||
public Dictionary<String, String> ApiKeyPrefix = new Dictionary<String, String>();
|
||||
|
||||
/// <summary>
|
||||
/// Get the API key with prefix.
|
||||
/// </summary>
|
||||
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
|
||||
/// <returns>API key with prefix.</returns>
|
||||
public string GetApiKeyWithPrefix (string apiKeyIdentifier)
|
||||
{
|
||||
var apiKeyValue = "";
|
||||
ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue);
|
||||
var apiKeyPrefix = "";
|
||||
if (ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix))
|
||||
return apiKeyPrefix + " " + apiKeyValue;
|
||||
else
|
||||
return apiKeyValue;
|
||||
}
|
||||
|
||||
private string _tempFolderPath = Path.GetTempPath();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the temporary folder path to store the files downloaded from the server.
|
||||
/// </summary>
|
||||
/// <value>Folder path.</value>
|
||||
public String TempFolderPath
|
||||
{
|
||||
get { return _tempFolderPath; }
|
||||
|
||||
set
|
||||
{
|
||||
if (String.IsNullOrEmpty(value))
|
||||
{
|
||||
_tempFolderPath = value;
|
||||
return;
|
||||
}
|
||||
|
||||
// create the directory if it does not exist
|
||||
if (!Directory.Exists(value))
|
||||
Directory.CreateDirectory(value);
|
||||
|
||||
// check if the path contains directory separator at the end
|
||||
if (value[value.Length - 1] == Path.DirectorySeparatorChar)
|
||||
_tempFolderPath = value;
|
||||
else
|
||||
_tempFolderPath = value + Path.DirectorySeparatorChar;
|
||||
}
|
||||
}
|
||||
|
||||
private const string ISO8601_DATETIME_FORMAT = "o";
|
||||
|
||||
private string _dateTimeFormat = ISO8601_DATETIME_FORMAT;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the the date time format used when serializing in the ApiClient
|
||||
/// By default, it's set to ISO 8601 - "o", for others see:
|
||||
/// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
|
||||
/// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
|
||||
/// No validation is done to ensure that the string you're providing is valid
|
||||
/// </summary>
|
||||
/// <value>The DateTimeFormat string</value>
|
||||
public String DateTimeFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dateTimeFormat;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
// Never allow a blank or null string, go back to the default
|
||||
_dateTimeFormat = ISO8601_DATETIME_FORMAT;
|
||||
return;
|
||||
}
|
||||
|
||||
// Caution, no validation when you choose date time format other than ISO 8601
|
||||
// Take a look at the above links
|
||||
_dateTimeFormat = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string with essential information for debugging.
|
||||
/// </summary>
|
||||
public static String ToDebugReport()
|
||||
{
|
||||
String report = "C# SDK (IO.Swagger) Debug Report:\n";
|
||||
report += " OS: " + Environment.OSVersion + "\n";
|
||||
report += " .NET Framework Version: " + Assembly
|
||||
.GetExecutingAssembly()
|
||||
.GetReferencedAssemblies()
|
||||
.Where(x => x.Name == "System.Core").First().Version.ToString() + "\n";
|
||||
report += " Version of the API: 1.0.0\n";
|
||||
report += " SDK Package Version: 1.0.0\n";
|
||||
|
||||
return report;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{27FD0ED8-0F4A-458A-B564-6BFC0A02B9C9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Swagger Library</RootNamespace>
|
||||
<AssemblyName>Swagger Library</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Animal
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Animal : IEquatable<Animal>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Animal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="ClassName">ClassName (required).</param>
|
||||
public Animal(string ClassName = null)
|
||||
{
|
||||
// to ensure "ClassName" is required (not null)
|
||||
if (ClassName == null)
|
||||
{
|
||||
throw new InvalidDataException("ClassName is a required property for Animal and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassName = ClassName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[DataMember(Name="className", EmitDefaultValue=false)]
|
||||
public string ClassName { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Animal {\n");
|
||||
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Animal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Animal instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Animal to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Animal other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.ClassName == other.ClassName ||
|
||||
this.ClassName != null &&
|
||||
this.ClassName.Equals(other.ClassName)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.ClassName != null)
|
||||
hash = hash * 59 + this.ClassName.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ApiResponse
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class ApiResponse : IEquatable<ApiResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Code">Code.</param>
|
||||
/// <param name="Type">Type.</param>
|
||||
/// <param name="Message">Message.</param>
|
||||
public ApiResponse(int? Code = null, string Type = null, string Message = null)
|
||||
{
|
||||
|
||||
|
||||
this.Code = Code;
|
||||
|
||||
this.Type = Type;
|
||||
|
||||
this.Message = Message;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Code
|
||||
/// </summary>
|
||||
[DataMember(Name="code", EmitDefaultValue=false)]
|
||||
public int? Code { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Type
|
||||
/// </summary>
|
||||
[DataMember(Name="type", EmitDefaultValue=false)]
|
||||
public string Type { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Message
|
||||
/// </summary>
|
||||
[DataMember(Name="message", EmitDefaultValue=false)]
|
||||
public string Message { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class ApiResponse {\n");
|
||||
sb.Append(" Code: ").Append(Code).Append("\n");
|
||||
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||
sb.Append(" Message: ").Append(Message).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as ApiResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ApiResponse instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of ApiResponse to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ApiResponse other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Code == other.Code ||
|
||||
this.Code != null &&
|
||||
this.Code.Equals(other.Code)
|
||||
) &&
|
||||
(
|
||||
this.Type == other.Type ||
|
||||
this.Type != null &&
|
||||
this.Type.Equals(other.Type)
|
||||
) &&
|
||||
(
|
||||
this.Message == other.Message ||
|
||||
this.Message != null &&
|
||||
this.Message.Equals(other.Message)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Code != null)
|
||||
hash = hash * 59 + this.Code.GetHashCode();
|
||||
if (this.Type != null)
|
||||
hash = hash * 59 + this.Type.GetHashCode();
|
||||
if (this.Message != null)
|
||||
hash = hash * 59 + this.Message.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Cat
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Cat : Animal, IEquatable<Cat>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Cat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="ClassName">ClassName (required).</param>
|
||||
/// <param name="Declawed">Declawed.</param>
|
||||
public Cat(string ClassName = null, bool? Declawed = null)
|
||||
{
|
||||
// to ensure "ClassName" is required (not null)
|
||||
if (ClassName == null)
|
||||
{
|
||||
throw new InvalidDataException("ClassName is a required property for Cat and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassName = ClassName;
|
||||
}
|
||||
|
||||
|
||||
this.Declawed = Declawed;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[DataMember(Name="className", EmitDefaultValue=false)]
|
||||
public string ClassName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Declawed
|
||||
/// </summary>
|
||||
[DataMember(Name="declawed", EmitDefaultValue=false)]
|
||||
public bool? Declawed { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Cat {\n");
|
||||
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
|
||||
sb.Append(" Declawed: ").Append(Declawed).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public new string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Cat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Cat instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Cat to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Cat other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.ClassName == other.ClassName ||
|
||||
this.ClassName != null &&
|
||||
this.ClassName.Equals(other.ClassName)
|
||||
) &&
|
||||
(
|
||||
this.Declawed == other.Declawed ||
|
||||
this.Declawed != null &&
|
||||
this.Declawed.Equals(other.Declawed)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.ClassName != null)
|
||||
hash = hash * 59 + this.ClassName.GetHashCode();
|
||||
if (this.Declawed != null)
|
||||
hash = hash * 59 + this.Declawed.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Category
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Category : IEquatable<Category>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Category" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id.</param>
|
||||
/// <param name="Name">Name.</param>
|
||||
public Category(long? Id = null, string Name = null)
|
||||
{
|
||||
|
||||
|
||||
this.Id = Id;
|
||||
|
||||
this.Name = Name;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Category {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Category);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Category instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Category to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Category other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Id == other.Id ||
|
||||
this.Id != null &&
|
||||
this.Id.Equals(other.Id)
|
||||
) &&
|
||||
(
|
||||
this.Name == other.Name ||
|
||||
this.Name != null &&
|
||||
this.Name.Equals(other.Name)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
if (this.Name != null)
|
||||
hash = hash * 59 + this.Name.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Dog
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Dog : Animal, IEquatable<Dog>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Dog" /> class.
|
||||
/// </summary>
|
||||
/// <param name="ClassName">ClassName (required).</param>
|
||||
/// <param name="Breed">Breed.</param>
|
||||
public Dog(string ClassName = null, string Breed = null)
|
||||
{
|
||||
// to ensure "ClassName" is required (not null)
|
||||
if (ClassName == null)
|
||||
{
|
||||
throw new InvalidDataException("ClassName is a required property for Dog and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassName = ClassName;
|
||||
}
|
||||
|
||||
|
||||
this.Breed = Breed;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[DataMember(Name="className", EmitDefaultValue=false)]
|
||||
public string ClassName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Breed
|
||||
/// </summary>
|
||||
[DataMember(Name="breed", EmitDefaultValue=false)]
|
||||
public string Breed { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Dog {\n");
|
||||
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
|
||||
sb.Append(" Breed: ").Append(Breed).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public new string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Dog);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Dog instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Dog to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Dog other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.ClassName == other.ClassName ||
|
||||
this.ClassName != null &&
|
||||
this.ClassName.Equals(other.ClassName)
|
||||
) &&
|
||||
(
|
||||
this.Breed == other.Breed ||
|
||||
this.Breed != null &&
|
||||
this.Breed.Equals(other.Breed)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.ClassName != null)
|
||||
hash = hash * 59 + this.ClassName.GetHashCode();
|
||||
if (this.Breed != null)
|
||||
hash = hash * 59 + this.Breed.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class FormatTest : IEquatable<FormatTest>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormatTest" /> class.
|
||||
/// Initializes a new instance of the <see cref="FormatTest" />class.
|
||||
/// </summary>
|
||||
/// <param name="Integer">Integer.</param>
|
||||
/// <param name="Int32">Int32.</param>
|
||||
/// <param name="Int64">Int64.</param>
|
||||
/// <param name="Number">Number (required).</param>
|
||||
/// <param name="_Float">_Float.</param>
|
||||
/// <param name="_Double">_Double.</param>
|
||||
/// <param name="_String">_String.</param>
|
||||
/// <param name="_Byte">_Byte (required).</param>
|
||||
/// <param name="Binary">Binary.</param>
|
||||
/// <param name="Date">Date (required).</param>
|
||||
/// <param name="DateTime">DateTime.</param>
|
||||
/// <param name="Uuid">Uuid.</param>
|
||||
/// <param name="Password">Password (required).</param>
|
||||
|
||||
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, Guid? Uuid = null, string Password = null)
|
||||
{
|
||||
// to ensure "Number" is required (not null)
|
||||
if (Number == null)
|
||||
{
|
||||
throw new InvalidDataException("Number is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Number = Number;
|
||||
}
|
||||
// to ensure "_Byte" is required (not null)
|
||||
if (_Byte == null)
|
||||
{
|
||||
throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Byte = _Byte;
|
||||
}
|
||||
// to ensure "Date" is required (not null)
|
||||
if (Date == null)
|
||||
{
|
||||
throw new InvalidDataException("Date is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Date = Date;
|
||||
}
|
||||
// to ensure "Password" is required (not null)
|
||||
if (Password == null)
|
||||
{
|
||||
throw new InvalidDataException("Password is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Password = Password;
|
||||
}
|
||||
this.Integer = Integer;
|
||||
this.Int32 = Int32;
|
||||
this.Int64 = Int64;
|
||||
this._Float = _Float;
|
||||
this._Double = _Double;
|
||||
this._String = _String;
|
||||
this.Binary = Binary;
|
||||
this.DateTime = DateTime;
|
||||
this.Uuid = Uuid;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Integer
|
||||
/// </summary>
|
||||
[DataMember(Name="integer", EmitDefaultValue=false)]
|
||||
public int? Integer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Int32
|
||||
/// </summary>
|
||||
[DataMember(Name="int32", EmitDefaultValue=false)]
|
||||
public int? Int32 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Int64
|
||||
/// </summary>
|
||||
[DataMember(Name="int64", EmitDefaultValue=false)]
|
||||
public long? Int64 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Number
|
||||
/// </summary>
|
||||
[DataMember(Name="number", EmitDefaultValue=false)]
|
||||
public double? Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _Float
|
||||
/// </summary>
|
||||
[DataMember(Name="float", EmitDefaultValue=false)]
|
||||
public float? _Float { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _Double
|
||||
/// </summary>
|
||||
[DataMember(Name="double", EmitDefaultValue=false)]
|
||||
public double? _Double { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _String
|
||||
/// </summary>
|
||||
[DataMember(Name="string", EmitDefaultValue=false)]
|
||||
public string _String { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _Byte
|
||||
/// </summary>
|
||||
[DataMember(Name="byte", EmitDefaultValue=false)]
|
||||
public byte[] _Byte { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Binary
|
||||
/// </summary>
|
||||
[DataMember(Name="binary", EmitDefaultValue=false)]
|
||||
public byte[] Binary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Date
|
||||
/// </summary>
|
||||
[DataMember(Name="date", EmitDefaultValue=false)]
|
||||
public DateTime? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DateTime
|
||||
/// </summary>
|
||||
[DataMember(Name="dateTime", EmitDefaultValue=false)]
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Uuid
|
||||
/// </summary>
|
||||
[DataMember(Name="uuid", EmitDefaultValue=false)]
|
||||
public Guid? Uuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Password
|
||||
/// </summary>
|
||||
[DataMember(Name="password", EmitDefaultValue=false)]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class FormatTest {\n");
|
||||
sb.Append(" Integer: ").Append(Integer).Append("\n");
|
||||
sb.Append(" Int32: ").Append(Int32).Append("\n");
|
||||
sb.Append(" Int64: ").Append(Int64).Append("\n");
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" _Float: ").Append(_Float).Append("\n");
|
||||
sb.Append(" _Double: ").Append(_Double).Append("\n");
|
||||
sb.Append(" _String: ").Append(_String).Append("\n");
|
||||
sb.Append(" _Byte: ").Append(_Byte).Append("\n");
|
||||
sb.Append(" Binary: ").Append(Binary).Append("\n");
|
||||
sb.Append(" Date: ").Append(Date).Append("\n");
|
||||
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
|
||||
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as FormatTest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if FormatTest instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of FormatTest to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(FormatTest other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Integer == other.Integer ||
|
||||
this.Integer != null &&
|
||||
this.Integer.Equals(other.Integer)
|
||||
) &&
|
||||
(
|
||||
this.Int32 == other.Int32 ||
|
||||
this.Int32 != null &&
|
||||
this.Int32.Equals(other.Int32)
|
||||
) &&
|
||||
(
|
||||
this.Int64 == other.Int64 ||
|
||||
this.Int64 != null &&
|
||||
this.Int64.Equals(other.Int64)
|
||||
) &&
|
||||
(
|
||||
this.Number == other.Number ||
|
||||
this.Number != null &&
|
||||
this.Number.Equals(other.Number)
|
||||
) &&
|
||||
(
|
||||
this._Float == other._Float ||
|
||||
this._Float != null &&
|
||||
this._Float.Equals(other._Float)
|
||||
) &&
|
||||
(
|
||||
this._Double == other._Double ||
|
||||
this._Double != null &&
|
||||
this._Double.Equals(other._Double)
|
||||
) &&
|
||||
(
|
||||
this._String == other._String ||
|
||||
this._String != null &&
|
||||
this._String.Equals(other._String)
|
||||
) &&
|
||||
(
|
||||
this._Byte == other._Byte ||
|
||||
this._Byte != null &&
|
||||
this._Byte.Equals(other._Byte)
|
||||
) &&
|
||||
(
|
||||
this.Binary == other.Binary ||
|
||||
this.Binary != null &&
|
||||
this.Binary.Equals(other.Binary)
|
||||
) &&
|
||||
(
|
||||
this.Date == other.Date ||
|
||||
this.Date != null &&
|
||||
this.Date.Equals(other.Date)
|
||||
) &&
|
||||
(
|
||||
this.DateTime == other.DateTime ||
|
||||
this.DateTime != null &&
|
||||
this.DateTime.Equals(other.DateTime)
|
||||
) &&
|
||||
(
|
||||
this.Uuid == other.Uuid ||
|
||||
this.Uuid != null &&
|
||||
this.Uuid.Equals(other.Uuid)
|
||||
) &&
|
||||
(
|
||||
this.Password == other.Password ||
|
||||
this.Password != null &&
|
||||
this.Password.Equals(other.Password)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Integer != null)
|
||||
hash = hash * 59 + this.Integer.GetHashCode();
|
||||
if (this.Int32 != null)
|
||||
hash = hash * 59 + this.Int32.GetHashCode();
|
||||
if (this.Int64 != null)
|
||||
hash = hash * 59 + this.Int64.GetHashCode();
|
||||
if (this.Number != null)
|
||||
hash = hash * 59 + this.Number.GetHashCode();
|
||||
if (this._Float != null)
|
||||
hash = hash * 59 + this._Float.GetHashCode();
|
||||
if (this._Double != null)
|
||||
hash = hash * 59 + this._Double.GetHashCode();
|
||||
if (this._String != null)
|
||||
hash = hash * 59 + this._String.GetHashCode();
|
||||
if (this._Byte != null)
|
||||
hash = hash * 59 + this._Byte.GetHashCode();
|
||||
if (this.Binary != null)
|
||||
hash = hash * 59 + this.Binary.GetHashCode();
|
||||
if (this.Date != null)
|
||||
hash = hash * 59 + this.Date.GetHashCode();
|
||||
if (this.DateTime != null)
|
||||
hash = hash * 59 + this.DateTime.GetHashCode();
|
||||
if (this.Uuid != null)
|
||||
hash = hash * 59 + this.Uuid.GetHashCode();
|
||||
if (this.Password != null)
|
||||
hash = hash * 59 + this.Password.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Model for testing model name starting with number
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Model200Response : IEquatable<Model200Response>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Model200Response" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Name">Name.</param>
|
||||
public Model200Response(int? Name = null)
|
||||
{
|
||||
|
||||
|
||||
this.Name = Name;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||
public int? Name { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Model200Response {\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Model200Response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Model200Response instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Model200Response to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Model200Response other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Name == other.Name ||
|
||||
this.Name != null &&
|
||||
this.Name.Equals(other.Name)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Name != null)
|
||||
hash = hash * 59 + this.Name.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Model for testing reserved words
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class ModelReturn : IEquatable<ModelReturn>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ModelReturn" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_Return">_Return.</param>
|
||||
public ModelReturn(int? _Return = null)
|
||||
{
|
||||
|
||||
|
||||
this._Return = _Return;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _Return
|
||||
/// </summary>
|
||||
[DataMember(Name="return", EmitDefaultValue=false)]
|
||||
public int? _Return { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class ModelReturn {\n");
|
||||
sb.Append(" _Return: ").Append(_Return).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as ModelReturn);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ModelReturn instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of ModelReturn to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ModelReturn other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this._Return == other._Return ||
|
||||
this._Return != null &&
|
||||
this._Return.Equals(other._Return)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this._Return != null)
|
||||
hash = hash * 59 + this._Return.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Model for testing model name same as property name
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Name : IEquatable<Name>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Name" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_Name">_Name (required).</param>
|
||||
/// <param name="Property">Property.</param>
|
||||
public Name(int? _Name = null, string Property = null)
|
||||
{
|
||||
// to ensure "_Name" is required (not null)
|
||||
if (_Name == null)
|
||||
{
|
||||
throw new InvalidDataException("_Name is a required property for Name and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Name = _Name;
|
||||
}
|
||||
|
||||
|
||||
this.Property = Property;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _Name
|
||||
/// </summary>
|
||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||
public int? _Name { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets SnakeCase
|
||||
/// </summary>
|
||||
[DataMember(Name="snake_case", EmitDefaultValue=false)]
|
||||
public int? SnakeCase { get; private set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Property
|
||||
/// </summary>
|
||||
[DataMember(Name="property", EmitDefaultValue=false)]
|
||||
public string Property { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Name {\n");
|
||||
sb.Append(" _Name: ").Append(_Name).Append("\n");
|
||||
sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n");
|
||||
sb.Append(" Property: ").Append(Property).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Name instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Name to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Name other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this._Name == other._Name ||
|
||||
this._Name != null &&
|
||||
this._Name.Equals(other._Name)
|
||||
) &&
|
||||
(
|
||||
this.SnakeCase == other.SnakeCase ||
|
||||
this.SnakeCase != null &&
|
||||
this.SnakeCase.Equals(other.SnakeCase)
|
||||
) &&
|
||||
(
|
||||
this.Property == other.Property ||
|
||||
this.Property != null &&
|
||||
this.Property.Equals(other.Property)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this._Name != null)
|
||||
hash = hash * 59 + this._Name.GetHashCode();
|
||||
if (this.SnakeCase != null)
|
||||
hash = hash * 59 + this.SnakeCase.GetHashCode();
|
||||
if (this.Property != null)
|
||||
hash = hash * 59 + this.Property.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Order
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Order : IEquatable<Order>
|
||||
{
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
/// <value>Order Status</value>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum StatusEnum
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum Placed for "placed"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "placed")]
|
||||
Placed,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Approved for "approved"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "approved")]
|
||||
Approved,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Delivered for "delivered"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "delivered")]
|
||||
Delivered
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
/// <value>Order Status</value>
|
||||
[DataMember(Name="status", EmitDefaultValue=false)]
|
||||
public StatusEnum? Status { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Order" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id.</param>
|
||||
/// <param name="PetId">PetId.</param>
|
||||
/// <param name="Quantity">Quantity.</param>
|
||||
/// <param name="ShipDate">ShipDate.</param>
|
||||
/// <param name="Status">Order Status.</param>
|
||||
/// <param name="Complete">Complete (default to false).</param>
|
||||
public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
|
||||
{
|
||||
|
||||
|
||||
this.Id = Id;
|
||||
|
||||
this.PetId = PetId;
|
||||
|
||||
this.Quantity = Quantity;
|
||||
|
||||
this.ShipDate = ShipDate;
|
||||
|
||||
this.Status = Status;
|
||||
|
||||
// use default value if no "Complete" provided
|
||||
if (Complete == null)
|
||||
{
|
||||
this.Complete = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Complete = Complete;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets PetId
|
||||
/// </summary>
|
||||
[DataMember(Name="petId", EmitDefaultValue=false)]
|
||||
public long? PetId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Quantity
|
||||
/// </summary>
|
||||
[DataMember(Name="quantity", EmitDefaultValue=false)]
|
||||
public int? Quantity { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets ShipDate
|
||||
/// </summary>
|
||||
[DataMember(Name="shipDate", EmitDefaultValue=false)]
|
||||
public DateTime? ShipDate { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Complete
|
||||
/// </summary>
|
||||
[DataMember(Name="complete", EmitDefaultValue=false)]
|
||||
public bool? Complete { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Order {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" PetId: ").Append(PetId).Append("\n");
|
||||
sb.Append(" Quantity: ").Append(Quantity).Append("\n");
|
||||
sb.Append(" ShipDate: ").Append(ShipDate).Append("\n");
|
||||
sb.Append(" Status: ").Append(Status).Append("\n");
|
||||
sb.Append(" Complete: ").Append(Complete).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Order);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Order instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Order to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Order other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Id == other.Id ||
|
||||
this.Id != null &&
|
||||
this.Id.Equals(other.Id)
|
||||
) &&
|
||||
(
|
||||
this.PetId == other.PetId ||
|
||||
this.PetId != null &&
|
||||
this.PetId.Equals(other.PetId)
|
||||
) &&
|
||||
(
|
||||
this.Quantity == other.Quantity ||
|
||||
this.Quantity != null &&
|
||||
this.Quantity.Equals(other.Quantity)
|
||||
) &&
|
||||
(
|
||||
this.ShipDate == other.ShipDate ||
|
||||
this.ShipDate != null &&
|
||||
this.ShipDate.Equals(other.ShipDate)
|
||||
) &&
|
||||
(
|
||||
this.Status == other.Status ||
|
||||
this.Status != null &&
|
||||
this.Status.Equals(other.Status)
|
||||
) &&
|
||||
(
|
||||
this.Complete == other.Complete ||
|
||||
this.Complete != null &&
|
||||
this.Complete.Equals(other.Complete)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
if (this.PetId != null)
|
||||
hash = hash * 59 + this.PetId.GetHashCode();
|
||||
if (this.Quantity != null)
|
||||
hash = hash * 59 + this.Quantity.GetHashCode();
|
||||
if (this.ShipDate != null)
|
||||
hash = hash * 59 + this.ShipDate.GetHashCode();
|
||||
if (this.Status != null)
|
||||
hash = hash * 59 + this.Status.GetHashCode();
|
||||
if (this.Complete != null)
|
||||
hash = hash * 59 + this.Complete.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Pet
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Pet : IEquatable<Pet>
|
||||
{
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
/// <value>pet status in the store</value>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum StatusEnum
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum Available for "available"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "available")]
|
||||
Available,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Pending for "pending"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "pending")]
|
||||
Pending,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Sold for "sold"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "sold")]
|
||||
Sold
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
/// <value>pet status in the store</value>
|
||||
[DataMember(Name="status", EmitDefaultValue=false)]
|
||||
public StatusEnum? Status { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Pet" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id.</param>
|
||||
/// <param name="Category">Category.</param>
|
||||
/// <param name="Name">Name (required).</param>
|
||||
/// <param name="PhotoUrls">PhotoUrls (required).</param>
|
||||
/// <param name="Tags">Tags.</param>
|
||||
/// <param name="Status">pet status in the store.</param>
|
||||
public Pet(long? Id = null, Category Category = null, string Name = null, List<string> PhotoUrls = null, List<Tag> Tags = null, StatusEnum? Status = null)
|
||||
{
|
||||
// to ensure "Name" is required (not null)
|
||||
if (Name == null)
|
||||
{
|
||||
throw new InvalidDataException("Name is a required property for Pet and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Name = Name;
|
||||
}
|
||||
// to ensure "PhotoUrls" is required (not null)
|
||||
if (PhotoUrls == null)
|
||||
{
|
||||
throw new InvalidDataException("PhotoUrls is a required property for Pet and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PhotoUrls = PhotoUrls;
|
||||
}
|
||||
|
||||
|
||||
this.Id = Id;
|
||||
|
||||
this.Category = Category;
|
||||
|
||||
this.Tags = Tags;
|
||||
|
||||
this.Status = Status;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Category
|
||||
/// </summary>
|
||||
[DataMember(Name="category", EmitDefaultValue=false)]
|
||||
public Category Category { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets PhotoUrls
|
||||
/// </summary>
|
||||
[DataMember(Name="photoUrls", EmitDefaultValue=false)]
|
||||
public List<string> PhotoUrls { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Tags
|
||||
/// </summary>
|
||||
[DataMember(Name="tags", EmitDefaultValue=false)]
|
||||
public List<Tag> Tags { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Pet {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Category: ").Append(Category).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n");
|
||||
sb.Append(" Tags: ").Append(Tags).Append("\n");
|
||||
sb.Append(" Status: ").Append(Status).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Pet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Pet instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Pet to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Pet other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Id == other.Id ||
|
||||
this.Id != null &&
|
||||
this.Id.Equals(other.Id)
|
||||
) &&
|
||||
(
|
||||
this.Category == other.Category ||
|
||||
this.Category != null &&
|
||||
this.Category.Equals(other.Category)
|
||||
) &&
|
||||
(
|
||||
this.Name == other.Name ||
|
||||
this.Name != null &&
|
||||
this.Name.Equals(other.Name)
|
||||
) &&
|
||||
(
|
||||
this.PhotoUrls == other.PhotoUrls ||
|
||||
this.PhotoUrls != null &&
|
||||
this.PhotoUrls.SequenceEqual(other.PhotoUrls)
|
||||
) &&
|
||||
(
|
||||
this.Tags == other.Tags ||
|
||||
this.Tags != null &&
|
||||
this.Tags.SequenceEqual(other.Tags)
|
||||
) &&
|
||||
(
|
||||
this.Status == other.Status ||
|
||||
this.Status != null &&
|
||||
this.Status.Equals(other.Status)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
if (this.Category != null)
|
||||
hash = hash * 59 + this.Category.GetHashCode();
|
||||
if (this.Name != null)
|
||||
hash = hash * 59 + this.Name.GetHashCode();
|
||||
if (this.PhotoUrls != null)
|
||||
hash = hash * 59 + this.PhotoUrls.GetHashCode();
|
||||
if (this.Tags != null)
|
||||
hash = hash * 59 + this.Tags.GetHashCode();
|
||||
if (this.Status != null)
|
||||
hash = hash * 59 + this.Status.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// SpecialModelName
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class SpecialModelName : IEquatable<SpecialModelName>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SpecialModelName" /> class.
|
||||
/// </summary>
|
||||
/// <param name="SpecialPropertyName">SpecialPropertyName.</param>
|
||||
public SpecialModelName(long? SpecialPropertyName = null)
|
||||
{
|
||||
|
||||
|
||||
this.SpecialPropertyName = SpecialPropertyName;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets SpecialPropertyName
|
||||
/// </summary>
|
||||
[DataMember(Name="$special[property.name]", EmitDefaultValue=false)]
|
||||
public long? SpecialPropertyName { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class SpecialModelName {\n");
|
||||
sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as SpecialModelName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if SpecialModelName instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of SpecialModelName to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(SpecialModelName other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.SpecialPropertyName == other.SpecialPropertyName ||
|
||||
this.SpecialPropertyName != null &&
|
||||
this.SpecialPropertyName.Equals(other.SpecialPropertyName)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.SpecialPropertyName != null)
|
||||
hash = hash * 59 + this.SpecialPropertyName.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Tag
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Tag : IEquatable<Tag>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Tag" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id.</param>
|
||||
/// <param name="Name">Name.</param>
|
||||
public Tag(long? Id = null, string Name = null)
|
||||
{
|
||||
|
||||
|
||||
this.Id = Id;
|
||||
|
||||
this.Name = Name;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Tag {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Tag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Tag instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Tag to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Tag other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Id == other.Id ||
|
||||
this.Id != null &&
|
||||
this.Id.Equals(other.Id)
|
||||
) &&
|
||||
(
|
||||
this.Name == other.Name ||
|
||||
this.Name != null &&
|
||||
this.Name.Equals(other.Name)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
if (this.Name != null)
|
||||
hash = hash * 59 + this.Name.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// User
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class User : IEquatable<User>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="User" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id.</param>
|
||||
/// <param name="Username">Username.</param>
|
||||
/// <param name="FirstName">FirstName.</param>
|
||||
/// <param name="LastName">LastName.</param>
|
||||
/// <param name="Email">Email.</param>
|
||||
/// <param name="Password">Password.</param>
|
||||
/// <param name="Phone">Phone.</param>
|
||||
/// <param name="UserStatus">User Status.</param>
|
||||
public User(long? Id = null, string Username = null, string FirstName = null, string LastName = null, string Email = null, string Password = null, string Phone = null, int? UserStatus = null)
|
||||
{
|
||||
|
||||
|
||||
this.Id = Id;
|
||||
|
||||
this.Username = Username;
|
||||
|
||||
this.FirstName = FirstName;
|
||||
|
||||
this.LastName = LastName;
|
||||
|
||||
this.Email = Email;
|
||||
|
||||
this.Password = Password;
|
||||
|
||||
this.Phone = Phone;
|
||||
|
||||
this.UserStatus = UserStatus;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Username
|
||||
/// </summary>
|
||||
[DataMember(Name="username", EmitDefaultValue=false)]
|
||||
public string Username { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets FirstName
|
||||
/// </summary>
|
||||
[DataMember(Name="firstName", EmitDefaultValue=false)]
|
||||
public string FirstName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets LastName
|
||||
/// </summary>
|
||||
[DataMember(Name="lastName", EmitDefaultValue=false)]
|
||||
public string LastName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Email
|
||||
/// </summary>
|
||||
[DataMember(Name="email", EmitDefaultValue=false)]
|
||||
public string Email { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Password
|
||||
/// </summary>
|
||||
[DataMember(Name="password", EmitDefaultValue=false)]
|
||||
public string Password { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Phone
|
||||
/// </summary>
|
||||
[DataMember(Name="phone", EmitDefaultValue=false)]
|
||||
public string Phone { get; set; }
|
||||
/// <summary>
|
||||
/// User Status
|
||||
/// </summary>
|
||||
/// <value>User Status</value>
|
||||
[DataMember(Name="userStatus", EmitDefaultValue=false)]
|
||||
public int? UserStatus { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class User {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Username: ").Append(Username).Append("\n");
|
||||
sb.Append(" FirstName: ").Append(FirstName).Append("\n");
|
||||
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
||||
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
sb.Append(" Phone: ").Append(Phone).Append("\n");
|
||||
sb.Append(" UserStatus: ").Append(UserStatus).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as User);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if User instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of User to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(User other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Id == other.Id ||
|
||||
this.Id != null &&
|
||||
this.Id.Equals(other.Id)
|
||||
) &&
|
||||
(
|
||||
this.Username == other.Username ||
|
||||
this.Username != null &&
|
||||
this.Username.Equals(other.Username)
|
||||
) &&
|
||||
(
|
||||
this.FirstName == other.FirstName ||
|
||||
this.FirstName != null &&
|
||||
this.FirstName.Equals(other.FirstName)
|
||||
) &&
|
||||
(
|
||||
this.LastName == other.LastName ||
|
||||
this.LastName != null &&
|
||||
this.LastName.Equals(other.LastName)
|
||||
) &&
|
||||
(
|
||||
this.Email == other.Email ||
|
||||
this.Email != null &&
|
||||
this.Email.Equals(other.Email)
|
||||
) &&
|
||||
(
|
||||
this.Password == other.Password ||
|
||||
this.Password != null &&
|
||||
this.Password.Equals(other.Password)
|
||||
) &&
|
||||
(
|
||||
this.Phone == other.Phone ||
|
||||
this.Phone != null &&
|
||||
this.Phone.Equals(other.Phone)
|
||||
) &&
|
||||
(
|
||||
this.UserStatus == other.UserStatus ||
|
||||
this.UserStatus != null &&
|
||||
this.UserStatus.Equals(other.UserStatus)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
if (this.Username != null)
|
||||
hash = hash * 59 + this.Username.GetHashCode();
|
||||
if (this.FirstName != null)
|
||||
hash = hash * 59 + this.FirstName.GetHashCode();
|
||||
if (this.LastName != null)
|
||||
hash = hash * 59 + this.LastName.GetHashCode();
|
||||
if (this.Email != null)
|
||||
hash = hash * 59 + this.Email.GetHashCode();
|
||||
if (this.Password != null)
|
||||
hash = hash * 59 + this.Password.GetHashCode();
|
||||
if (this.Phone != null)
|
||||
hash = hash * 59 + this.Phone.GetHashCode();
|
||||
if (this.UserStatus != null)
|
||||
hash = hash * 59 + this.UserStatus.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Swagger Library")]
|
||||
[assembly: AssemblyDescription("A library generated from a Swagger doc")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Swagger")]
|
||||
[assembly: AssemblyProduct("SwaggerLibrary")]
|
||||
[assembly: AssemblyCopyright("No Copyright")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0")]
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user