mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
Merge branch 'jimschubert-csharp_default_paths'
This commit is contained in:
commit
4c0ed319d8
10
.gitignore
vendored
10
.gitignore
vendored
@ -91,13 +91,19 @@ samples/client/petstore/swift/SwaggerClientTests/Pods/Pods.xcodeproj/xcshareddat
|
||||
samples/client/petstore/csharp/SwaggerClientTest/.vs
|
||||
samples/client/petstore/csharp/SwaggerClientTest/obj
|
||||
samples/client/petstore/csharp/SwaggerClientTest/bin
|
||||
samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/vendor/
|
||||
samples/client/petstore/csharp/SwaggerClientTest/packages
|
||||
samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/
|
||||
samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/
|
||||
samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/nuget.exe
|
||||
samples/client/petstore/csharp/SwaggerClientTest/TestResult.xml
|
||||
samples/client/petstore/csharp/SwaggerClientTest/nuget.exe
|
||||
samples/client/petstore/csharp/SwaggerClientTest/testrunner/
|
||||
samples/client/petstore/csharp/SwaggerClient/.vs
|
||||
samples/client/petstore/csharp/SwaggerClient/nuget.exe
|
||||
samples/client/petstore/csharp/SwaggerClient/obj
|
||||
samples/client/petstore/csharp/SwaggerClient/bin
|
||||
samples/client/petstore/csharp/SwaggerClient/obj/Debug/
|
||||
samples/client/petstore/csharp/SwaggerClient/bin/Debug/
|
||||
samples/client/petstore/csharp/SwaggerClient/packages
|
||||
|
||||
# Python
|
||||
*.pyc
|
||||
|
@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient"
|
||||
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClient"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -t modules\swagger-codegen\src\main\resources\csharp -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l csharp -o samples\client\petstore\csharp\SwaggerClientTest\Lib\SwaggerClient
|
||||
set ags=generate -t modules\swagger-codegen\src\main\resources\csharp -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l csharp -o samples\client\petstore\csharp\SwaggerClient
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -12,7 +12,7 @@ import java.util.*;
|
||||
public abstract class AbstractCSharpCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
protected boolean optionalAssemblyInfoFlag = true;
|
||||
protected boolean optionalProjectFileFlag = false;
|
||||
protected boolean optionalProjectFileFlag = true;
|
||||
protected boolean optionalEmitDefaultValue = false;
|
||||
protected boolean optionalMethodArgumentFlag = true;
|
||||
protected boolean useDateTimeOffsetFlag = false;
|
||||
@ -21,7 +21,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
|
||||
protected String packageVersion = "1.0.0";
|
||||
protected String packageName = "IO.Swagger";
|
||||
protected String sourceFolder = "src" + File.separator + packageName;
|
||||
|
||||
protected String sourceFolder = "src";
|
||||
|
||||
// TODO: Add option for test folder output location. Nice to allow e.g. ./test instead of ./src.
|
||||
// This would require updating relative paths (e.g. path to main project file in test project file)
|
||||
protected String testFolder = sourceFolder;
|
||||
|
||||
protected Set<String> collectionTypes;
|
||||
protected Set<String> mapTypes;
|
||||
@ -273,12 +278,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
|
||||
@Override
|
||||
public String apiFileFolder() {
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + apiPackage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar);
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + modelPackage();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -528,7 +533,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
return toModelName(name) + "Tests";
|
||||
}
|
||||
|
||||
|
||||
public void setPackageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
}
|
||||
@ -541,7 +545,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
this.sourceFolder = sourceFolder;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toEnumVarName(String name, String datatype) {
|
||||
String enumName = sanitizeName(name);
|
||||
@ -590,4 +593,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public String testPackageName() {
|
||||
return this.packageName + ".Test";
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import java.util.*;
|
||||
|
||||
public class AspNet5ServerCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
protected String sourceFolder = "src" + File.separator + packageName;
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
protected Logger LOGGER = LoggerFactory.getLogger(AspNet5ServerCodegen.class);
|
||||
|
||||
|
@ -68,9 +68,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||
|
||||
// C# client default
|
||||
setSourceFolder("src" + File.separator + "main" + File.separator + "csharp");
|
||||
|
||||
cliOptions.clear();
|
||||
|
||||
// CLI options
|
||||
@ -141,9 +138,9 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
apiPackage = packageName + ".Api";
|
||||
modelPackage = packageName + ".Model";
|
||||
clientPackage = packageName + ".Client";
|
||||
apiPackage = "Api";
|
||||
modelPackage = "Model";
|
||||
clientPackage = "Client";
|
||||
|
||||
additionalProperties.put("clientPackage", clientPackage);
|
||||
|
||||
@ -157,6 +154,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.DOTNET_FRAMEWORK)) {
|
||||
setTargetFramework((String) additionalProperties.get(CodegenConstants.DOTNET_FRAMEWORK));
|
||||
} else {
|
||||
// Ensure default is set.
|
||||
setTargetFramework(NET45);
|
||||
additionalProperties.put("targetFramework", this.targetFramework);
|
||||
}
|
||||
|
||||
if (NET35.equals(this.targetFramework)) {
|
||||
@ -201,8 +202,12 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
.get(CodegenConstants.OPTIONAL_ASSEMBLY_INFO).toString()));
|
||||
}
|
||||
|
||||
String packageFolder = sourceFolder + File.separator + packageName.replace(".", java.io.File.separator);
|
||||
String clientPackageDir = sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator);
|
||||
final String testPackageName = testPackageName();
|
||||
String packageFolder = sourceFolder + File.separator + packageName;
|
||||
String clientPackageDir = packageFolder + File.separator + clientPackage;
|
||||
String testPackageFolder = testFolder + File.separator + testPackageName;
|
||||
|
||||
additionalProperties.put("testPackageName", testPackageName);
|
||||
|
||||
//Compute the relative path to the bin directory where the external assemblies live
|
||||
//This is necessary to properly generate the project file
|
||||
@ -210,7 +215,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
String binRelativePath = "..\\";
|
||||
for (int i = 0; i < packageDepth; i = i + 1)
|
||||
binRelativePath += "..\\";
|
||||
binRelativePath += "vendor\\";
|
||||
binRelativePath += "vendor";
|
||||
additionalProperties.put("binRelativePath", binRelativePath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("Configuration.mustache",
|
||||
@ -222,9 +227,13 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
supportingFiles.add(new SupportingFile("ApiResponse.mustache",
|
||||
clientPackageDir, "ApiResponse.cs"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat"));
|
||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
||||
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config"));
|
||||
supportingFiles.add(new SupportingFile("compile.mustache", "", "build.bat"));
|
||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "build.sh"));
|
||||
|
||||
// copy package.config to nuget's standard location for project-level installs
|
||||
supportingFiles.add(new SupportingFile("packages.config.mustache", packageFolder + File.separator, "packages.config"));
|
||||
supportingFiles.add(new SupportingFile("packages_test.config.mustache", testPackageFolder + File.separator, "packages.config"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||
@ -233,7 +242,14 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
supportingFiles.add(new SupportingFile("AssemblyInfo.mustache", packageFolder + File.separator + "Properties", "AssemblyInfo.cs"));
|
||||
}
|
||||
if (optionalProjectFileFlag) {
|
||||
supportingFiles.add(new SupportingFile("Project.mustache", packageFolder, clientPackage + ".csproj"));
|
||||
supportingFiles.add(new SupportingFile("Solution.mustache", "", packageName + ".sln"));
|
||||
supportingFiles.add(new SupportingFile("Project.mustache", packageFolder, packageName + ".csproj"));
|
||||
|
||||
// TODO: Check if test project output is enabled, partially related to #2506. Should have options for:
|
||||
// 1) No test project
|
||||
// 2) No model tests
|
||||
// 3) No api tests
|
||||
supportingFiles.add(new SupportingFile("TestProject.mustache", testPackageFolder, testPackageName + ".csproj"));
|
||||
}
|
||||
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
@ -439,4 +455,13 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiTestFileFolder() {
|
||||
return outputFolder + File.separator + testFolder + File.separator + testPackageName() + File.separator + apiPackage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelTestFileFolder() {
|
||||
return outputFolder + File.separator + testFolder + File.separator + testPackageName() + File.separator + modelPackage();
|
||||
}
|
||||
}
|
||||
|
@ -39,8 +39,6 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@ -48,18 +46,23 @@
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>{{binRelativePath}}/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath>{{binRelativePath}}/RestSharp.105.2.3/lib/{{targetFrameworkNuget}}/RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs"/>
|
||||
<Compile Include="Api\*.cs"/>
|
||||
<Compile Include="Client\*.cs"/>
|
||||
<Compile Include="Model\*.cs"/>
|
||||
<Compile Include="**\*.cs"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
@ -37,8 +37,8 @@ NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploa
|
||||
|
||||
## Installation
|
||||
Run the following command to generate the DLL
|
||||
- [Mac/Linux] `/bin/sh compile-mono.sh`
|
||||
- [Windows] `compile.bat`
|
||||
- [Mac/Linux] `/bin/sh build.sh`
|
||||
- [Windows] `build.bat`
|
||||
|
||||
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
|
||||
```csharp
|
||||
|
@ -0,0 +1,27 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
VisualStudioVersion = 12.0.0.0
|
||||
MinimumVisualStudioVersion = 10.0.0.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -0,0 +1,81 @@
|
||||
<?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>{{testPackageName}}</RootNamespace>
|
||||
<AssemblyName>{{testPackageName}}</AssemblyName>
|
||||
{{^supportsUWP}}
|
||||
<TargetFrameworkVersion>{{targetFramework}}</TargetFrameworkVersion>
|
||||
{{/supportsUWP}}
|
||||
{{#supportsUWP}}
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
{{/supportsUWP}}
|
||||
<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\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\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('{{binRelativePath}}')">{{binRelativePath}}\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="..\{{packageName}}\{{packageName}}.csproj">
|
||||
<Project>{{packageGuid}}</Project>
|
||||
<Name>{{packageName}}</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -4,17 +4,17 @@ netfx=${frameworkVersion#net}
|
||||
|
||||
wget -nc https://nuget.org/nuget.exe;
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install vendor/packages.config -o vendor;
|
||||
mono nuget.exe install src/{{packageName}}/packages.config -o packages;
|
||||
mkdir -p bin;
|
||||
|
||||
cp vendor/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp vendor/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll;
|
||||
cp packages/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll;
|
||||
|
||||
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
|
||||
bin/RestSharp.dll,\
|
||||
System.Runtime.Serialization.dll \
|
||||
-target:library \
|
||||
-out:bin/{{packageName}}.dll \
|
||||
-recurse:'src/*.cs' \
|
||||
-recurse:'src/{{packageName}}/*.cs' \
|
||||
-doc:bin/{{packageName}}.xml \
|
||||
-platform:anycpu
|
||||
|
@ -4,11 +4,11 @@
|
||||
{{^supportsAsync}}SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v3.5{{/supportsAsync}}
|
||||
|
||||
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
|
||||
.\nuget.exe install vendor/packages.config -o vendor
|
||||
.\nuget.exe install src\{{packageName}}\packages.config -o packages
|
||||
|
||||
if not exist ".\bin" mkdir bin
|
||||
|
||||
copy vendor\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy vendor\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll bin\RestSharp.dll
|
||||
copy packages\Newtonsoft.Json.8.0.2\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll bin\RestSharp.dll
|
||||
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\{{packageName}}.dll /recurse:src\*.cs /doc:bin\{{packageName}}.xml
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml
|
||||
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnit" version="2.6.3" targetFramework="{{targetFrameworkNuget}}" />
|
||||
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
|
||||
</packages>
|
27
samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
Normal file
27
samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
Normal file
@ -0,0 +1,27 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
VisualStudioVersion = 12.0.0.0
|
||||
MinimumVisualStudioVersion = 10.0.0.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{AC0D0300-7030-473F-B672-17C40187815A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AC0D0300-7030-473F-B672-17C40187815A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AC0D0300-7030-473F-B672-17C40187815A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AC0D0300-7030-473F-B672-17C40187815A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AC0D0300-7030-473F-B672-17C40187815A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
||||
|
||||
- API version: 1.0.0
|
||||
- SDK version: 1.0.0
|
||||
- Build date: 2016-04-27T22:04:12.906+08:00
|
||||
- Build date: 2016-05-07T17:39:09.181+08:00
|
||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||
|
||||
## Frameworks supported
|
||||
@ -27,14 +27,14 @@ NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploa
|
||||
|
||||
## Installation
|
||||
Run the following command to generate the DLL
|
||||
- [Mac/Linux] `/bin/sh compile-mono.sh`
|
||||
- [Windows] `compile.bat`
|
||||
- [Mac/Linux] `/bin/sh build.sh`
|
||||
- [Windows] `build.bat`
|
||||
|
||||
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
|
||||
```csharp
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Model;
|
||||
using Model;
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
@ -44,7 +44,7 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Model;
|
||||
using Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
@ -54,7 +54,7 @@ namespace Example
|
||||
{
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var number = number_example; // string | None
|
||||
var number = 3.4; // double? | None
|
||||
var _double = 1.2; // double? | None
|
||||
var _string = _string_example; // string | None
|
||||
var _byte = B; // byte[] | None
|
||||
@ -112,22 +112,23 @@ Class | Method | HTTP request | Description
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [IO.Swagger.Model.Animal](docs/Animal.md)
|
||||
- [IO.Swagger.Model.ApiResponse](docs/ApiResponse.md)
|
||||
- [IO.Swagger.Model.Cat](docs/Cat.md)
|
||||
- [IO.Swagger.Model.Category](docs/Category.md)
|
||||
- [IO.Swagger.Model.Dog](docs/Dog.md)
|
||||
- [IO.Swagger.Model.EnumClass](docs/EnumClass.md)
|
||||
- [IO.Swagger.Model.EnumTest](docs/EnumTest.md)
|
||||
- [IO.Swagger.Model.FormatTest](docs/FormatTest.md)
|
||||
- [IO.Swagger.Model.Model200Response](docs/Model200Response.md)
|
||||
- [IO.Swagger.Model.ModelReturn](docs/ModelReturn.md)
|
||||
- [IO.Swagger.Model.Name](docs/Name.md)
|
||||
- [IO.Swagger.Model.Order](docs/Order.md)
|
||||
- [IO.Swagger.Model.Pet](docs/Pet.md)
|
||||
- [IO.Swagger.Model.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [IO.Swagger.Model.Tag](docs/Tag.md)
|
||||
- [IO.Swagger.Model.User](docs/User.md)
|
||||
- [Model.Animal](docs/Animal.md)
|
||||
- [Model.AnimalFarm](docs/AnimalFarm.md)
|
||||
- [Model.ApiResponse](docs/ApiResponse.md)
|
||||
- [Model.Cat](docs/Cat.md)
|
||||
- [Model.Category](docs/Category.md)
|
||||
- [Model.Dog](docs/Dog.md)
|
||||
- [Model.EnumClass](docs/EnumClass.md)
|
||||
- [Model.EnumTest](docs/EnumTest.md)
|
||||
- [Model.FormatTest](docs/FormatTest.md)
|
||||
- [Model.Model200Response](docs/Model200Response.md)
|
||||
- [Model.ModelReturn](docs/ModelReturn.md)
|
||||
- [Model.Name](docs/Name.md)
|
||||
- [Model.Order](docs/Order.md)
|
||||
- [Model.Pet](docs/Pet.md)
|
||||
- [Model.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [Model.Tag](docs/Tag.md)
|
||||
- [Model.User](docs/User.md)
|
||||
|
||||
|
||||
## Documentation for Authorization
|
14
samples/client/petstore/csharp/SwaggerClient/build.bat
Normal file
14
samples/client/petstore/csharp/SwaggerClient/build.bat
Normal file
@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
|
||||
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
|
||||
|
||||
|
||||
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
|
||||
.\nuget.exe install src\IO.Swagger\packages.config -o packages
|
||||
|
||||
if not exist ".\bin" mkdir bin
|
||||
|
||||
copy packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
|
||||
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml
|
@ -4,17 +4,17 @@ netfx=${frameworkVersion#net}
|
||||
|
||||
wget -nc https://nuget.org/nuget.exe;
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install vendor/packages.config -o vendor;
|
||||
mono nuget.exe install src/IO.Swagger/packages.config -o packages;
|
||||
mkdir -p bin;
|
||||
|
||||
cp vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
|
||||
cp packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
|
||||
|
||||
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
|
||||
bin/RestSharp.dll,\
|
||||
System.Runtime.Serialization.dll \
|
||||
-target:library \
|
||||
-out:bin/IO.Swagger.dll \
|
||||
-recurse:'src/*.cs' \
|
||||
-recurse:'src/IO.Swagger/*.cs' \
|
||||
-doc:bin/IO.Swagger.xml \
|
||||
-platform:anycpu
|
@ -0,0 +1,8 @@
|
||||
# IO.Swagger.Model.AnimalFarm
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,8 @@
|
||||
# IO.Swagger.Model.EnumClass
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# IO.Swagger.Model.EnumTest
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**EnumString** | **string** | | [optional]
|
||||
**EnumInteger** | **int?** | | [optional]
|
||||
**EnumNumber** | **double?** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
91
samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
Normal file
91
samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
Normal file
@ -0,0 +1,91 @@
|
||||
# IO.Swagger.Api.FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters
|
||||
|
||||
|
||||
# **TestEndpointParameters**
|
||||
> 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)
|
||||
|
||||
Fake endpoint for testing various parameters
|
||||
|
||||
Fake endpoint for testing various parameters
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class TestEndpointParametersExample
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var number = 3.4; // double? | None
|
||||
var _double = 1.2; // double? | None
|
||||
var _string = _string_example; // string | None
|
||||
var _byte = B; // byte[] | None
|
||||
var integer = 56; // int? | None (optional)
|
||||
var int32 = 56; // int? | None (optional)
|
||||
var int64 = 789; // long? | None (optional)
|
||||
var _float = 3.4; // float? | None (optional)
|
||||
var binary = B; // byte[] | None (optional)
|
||||
var date = 2013-10-20; // DateTime? | None (optional)
|
||||
var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional)
|
||||
var password = password_example; // string | None (optional)
|
||||
|
||||
try
|
||||
{
|
||||
// Fake endpoint for testing various parameters
|
||||
apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **double?**| None |
|
||||
**_double** | **double?**| None |
|
||||
**_string** | **string**| None |
|
||||
**_byte** | **byte[]**| None |
|
||||
**integer** | **int?**| None | [optional]
|
||||
**int32** | **int?**| None | [optional]
|
||||
**int64** | **long?**| None | [optional]
|
||||
**_float** | **float?**| None | [optional]
|
||||
**binary** | **byte[]**| None | [optional]
|
||||
**date** | **DateTime?**| None | [optional]
|
||||
**dateTime** | **DateTime?**| None | [optional]
|
||||
**password** | **string**| None | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
@ -14,6 +14,7 @@ Name | Type | Description | Notes
|
||||
**Binary** | **byte[]** | | [optional]
|
||||
**Date** | **DateTime?** | |
|
||||
**DateTime** | **DateTime?** | | [optional]
|
||||
**Uuid** | **Guid?** | | [optional]
|
||||
**Password** | **string** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
@ -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,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>{AC0D0300-7030-473F-B672-17C40187815A}</Project>
|
||||
<Name>IO.Swagger</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -0,0 +1,56 @@
|
||||
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 AnimalFarm
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class AnimalFarmTests
|
||||
{
|
||||
private AnimalFarm instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new AnimalFarm();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of AnimalFarm
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void AnimalFarmInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<AnimalFarm> (instance, "instance is a AnimalFarm");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
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 EnumClass
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class EnumClassTests
|
||||
{
|
||||
private EnumClass instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new EnumClass();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of EnumClass
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void EnumClassInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<EnumClass> (instance, "instance is a EnumClass");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -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 EnumTest
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class EnumTestTests
|
||||
{
|
||||
private EnumTest instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new EnumTest();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of EnumTest
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void EnumTestInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<EnumTest> (instance, "instance is a EnumTest");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'EnumString'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void EnumStringTest()
|
||||
{
|
||||
// TODO: unit test for the property 'EnumString'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'EnumInteger'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void EnumIntegerTest()
|
||||
{
|
||||
// TODO: unit test for the property 'EnumInteger'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'EnumNumber'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void EnumNumberTest()
|
||||
{
|
||||
// TODO: unit test for the property 'EnumNumber'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -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>{AC0D0300-7030-473F-B672-17C40187815A}</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>
|
||||
|
@ -12,31 +12,20 @@ using Newtonsoft.Json.Converters;
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// AnimalFarm
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class Task : IEquatable<Task>
|
||||
{
|
||||
|
||||
public partial class AnimalFarm : List<Animal>, IEquatable<AnimalFarm>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Task" /> class.
|
||||
/// Initializes a new instance of the <see cref="Task" />class.
|
||||
/// Initializes a new instance of the <see cref="AnimalFarm" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_Return">_Return.</param>
|
||||
|
||||
public Task(int? _Return = null)
|
||||
public AnimalFarm()
|
||||
{
|
||||
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>
|
||||
@ -44,10 +33,8 @@ namespace IO.Swagger.Model
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class Task {\n");
|
||||
sb.Append(" _Return: ").Append(_Return).Append("\n");
|
||||
|
||||
sb.Append("}\n");
|
||||
sb.Append("class AnimalFarm {\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@ -55,7 +42,7 @@ namespace IO.Swagger.Model
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
public new string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
@ -68,26 +55,21 @@ namespace IO.Swagger.Model
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as Task);
|
||||
return this.Equals(obj as AnimalFarm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Task instances are equal
|
||||
/// Returns true if AnimalFarm instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of Task to be compared</param>
|
||||
/// <param name="other">Instance of AnimalFarm to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Task other)
|
||||
public bool Equals(AnimalFarm 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)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -101,13 +83,9 @@ namespace IO.Swagger.Model
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
|
||||
if (this._Return != null)
|
||||
hash = hash * 59 + this._Return.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
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>
|
||||
/// Gets or Sets EnumClass
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumClass
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum Abc for "_abc"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "_abc")]
|
||||
Abc,
|
||||
|
||||
/// <summary>
|
||||
/// Enum efg for "-efg"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "-efg")]
|
||||
efg,
|
||||
|
||||
/// <summary>
|
||||
/// Enum xyz for "(xyz)"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "(xyz)")]
|
||||
xyz
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
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>
|
||||
/// EnumTest
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class EnumTest : IEquatable<EnumTest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumString
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumStringEnum
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum Upper for "UPPER"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "UPPER")]
|
||||
Upper,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Lower for "lower"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "lower")]
|
||||
Lower
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumInteger
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumIntegerEnum
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum NUMBER_1 for 1
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1")]
|
||||
NUMBER_1 = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NUMBER_MINUS_1 for -1
|
||||
/// </summary>
|
||||
[EnumMember(Value = "-1")]
|
||||
NUMBER_MINUS_1 = -1
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumNumber
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumNumberEnum
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum NUMBER_1_DOT_1 for 1.1
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1.1")]
|
||||
NUMBER_1_DOT_1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NUMBER_MINUS_1_DOT_2 for -1.2
|
||||
/// </summary>
|
||||
[EnumMember(Value = "-1.2")]
|
||||
NUMBER_MINUS_1_DOT_2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumString
|
||||
/// </summary>
|
||||
[DataMember(Name="enum_string", EmitDefaultValue=false)]
|
||||
public EnumStringEnum? EnumString { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumInteger
|
||||
/// </summary>
|
||||
[DataMember(Name="enum_integer", EmitDefaultValue=false)]
|
||||
public EnumIntegerEnum? EnumInteger { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumNumber
|
||||
/// </summary>
|
||||
[DataMember(Name="enum_number", EmitDefaultValue=false)]
|
||||
public EnumNumberEnum? EnumNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnumTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="EnumString">EnumString.</param>
|
||||
/// <param name="EnumInteger">EnumInteger.</param>
|
||||
/// <param name="EnumNumber">EnumNumber.</param>
|
||||
public EnumTest(EnumStringEnum? EnumString = null, EnumIntegerEnum? EnumInteger = null, EnumNumberEnum? EnumNumber = null)
|
||||
{
|
||||
|
||||
|
||||
this.EnumString = EnumString;
|
||||
|
||||
this.EnumInteger = EnumInteger;
|
||||
|
||||
this.EnumNumber = EnumNumber;
|
||||
|
||||
}
|
||||
|
||||
/// <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 EnumTest {\n");
|
||||
sb.Append(" EnumString: ").Append(EnumString).Append("\n");
|
||||
sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n");
|
||||
sb.Append(" EnumNumber: ").Append(EnumNumber).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 EnumTest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if EnumTest instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of EnumTest to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(EnumTest other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.EnumString == other.EnumString ||
|
||||
this.EnumString != null &&
|
||||
this.EnumString.Equals(other.EnumString)
|
||||
) &&
|
||||
(
|
||||
this.EnumInteger == other.EnumInteger ||
|
||||
this.EnumInteger != null &&
|
||||
this.EnumInteger.Equals(other.EnumInteger)
|
||||
) &&
|
||||
(
|
||||
this.EnumNumber == other.EnumNumber ||
|
||||
this.EnumNumber != null &&
|
||||
this.EnumNumber.Equals(other.EnumNumber)
|
||||
);
|
||||
}
|
||||
|
||||
/// <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.EnumString != null)
|
||||
hash = hash * 59 + this.EnumString.GetHashCode();
|
||||
if (this.EnumInteger != null)
|
||||
hash = hash * 59 + this.EnumInteger.GetHashCode();
|
||||
if (this.EnumNumber != null)
|
||||
hash = hash * 59 + this.EnumNumber.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -31,8 +31,9 @@ namespace IO.Swagger.Model
|
||||
/// <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, string Password = null)
|
||||
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)
|
||||
@ -88,6 +89,8 @@ namespace IO.Swagger.Model
|
||||
|
||||
this.DateTime = DateTime;
|
||||
|
||||
this.Uuid = Uuid;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -146,6 +149,11 @@ namespace IO.Swagger.Model
|
||||
[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)]
|
||||
@ -169,6 +177,7 @@ 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();
|
||||
@ -261,6 +270,11 @@ sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
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 &&
|
||||
@ -301,6 +315,8 @@ sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
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;
|
@ -1,104 +0,0 @@
|
||||
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 InlineResponse200
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class InlineResponse200Tests
|
||||
{
|
||||
private InlineResponse200 instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new InlineResponse200();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of InlineResponse200
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void InlineResponse200InstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<InlineResponse200> (instance, "instance is a InlineResponse200");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'PhotoUrls'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PhotoUrlsTest()
|
||||
{
|
||||
// TODO: unit test for the property 'PhotoUrls'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Name'
|
||||
}
|
||||
/// <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 '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'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,184 +0,0 @@
|
||||
- the C# library for the Swagger Petstore
|
||||
|
||||
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||
|
||||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version:
|
||||
- Build date: 2016-04-14T06:55:47.468-04:00
|
||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||
|
||||
## Frameworks supported
|
||||
- .NET 4.0 or later
|
||||
- Windows Phone 7.1 (Mango)
|
||||
|
||||
## Dependencies
|
||||
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
|
||||
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
|
||||
|
||||
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
|
||||
```
|
||||
Install-Package RestSharp
|
||||
Install-Package Newtonsoft.Json
|
||||
```
|
||||
|
||||
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
|
||||
|
||||
## Installation
|
||||
Run the following command to generate the DLL
|
||||
- [Mac/Linux] compile-mono.sh
|
||||
- [Windows] compile.bat
|
||||
|
||||
Then include the DLL (under the `bin` folder) in the C# project
|
||||
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Module;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class Example
|
||||
{
|
||||
public void main(){
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||
// Configure API key authorization: test_api_client_id
|
||||
Configuration.Default.ApiKey.Add('x-test_api_client_id', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add('x-test_api_client_id', 'BEARER');
|
||||
// Configure API key authorization: test_api_client_secret
|
||||
Configuration.Default.ApiKey.Add('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add('x-test_api_client_secret', 'BEARER');
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'BEARER');
|
||||
// Configure HTTP basic authorization: test_http_basic
|
||||
Configuration.Default.Username = 'YOUR_USERNAME';
|
||||
Configuration.Default.Password = 'YOUR_PASSWORD';
|
||||
// Configure API key authorization: test_api_key_query
|
||||
Configuration.Default.ApiKey.Add('test_api_key_query', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add('test_api_key_query', 'BEARER');
|
||||
// Configure API key authorization: test_api_key_header
|
||||
Configuration.Default.ApiKey.Add('test_api_key_header', 'YOUR_API_KEY');
|
||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add('test_api_key_header', 'BEARER');
|
||||
|
||||
var apiInstance = new ();
|
||||
|
||||
try {
|
||||
apiInstance.();
|
||||
} catch (Exception e) {
|
||||
Debug.Print("Exception when calling .: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*::PetApi* | [**AddPet**](docs/PetApi.md#AddPet) | **POST** /pet | Add a new pet to the store
|
||||
*::PetApi* | [**AddPetUsingByteArray**](docs/PetApi.md#AddPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
*::PetApi* | [**DeletePet**](docs/PetApi.md#DeletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*::PetApi* | [**FindPetsByStatus**](docs/PetApi.md#FindPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*::PetApi* | [**FindPetsByTags**](docs/PetApi.md#FindPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*::PetApi* | [**GetPetById**](docs/PetApi.md#GetPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
*::PetApi* | [**GetPetByIdInObject**](docs/PetApi.md#GetPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
*::PetApi* | [**PetPetIdtestingByteArraytrueGet**](docs/PetApi.md#PetPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
*::PetApi* | [**UpdatePet**](docs/PetApi.md#UpdatePet) | **PUT** /pet | Update an existing pet
|
||||
*::PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#UpdatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*::PetApi* | [**UploadFile**](docs/PetApi.md#UploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*::StoreApi* | [**DeleteOrder**](docs/StoreApi.md#DeleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||
*::StoreApi* | [**FindOrdersByStatus**](docs/StoreApi.md#FindOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||
*::StoreApi* | [**GetInventory**](docs/StoreApi.md#GetInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*::StoreApi* | [**GetInventoryInObject**](docs/StoreApi.md#GetInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
*::StoreApi* | [**GetOrderById**](docs/StoreApi.md#GetOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||
*::StoreApi* | [**PlaceOrder**](docs/StoreApi.md#PlaceOrder) | **POST** /store/order | Place an order for a pet
|
||||
*::UserApi* | [**CreateUser**](docs/UserApi.md#CreateUser) | **POST** /user | Create user
|
||||
*::UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#CreateUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
*::UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#CreateUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
*::UserApi* | [**DeleteUser**](docs/UserApi.md#DeleteUser) | **DELETE** /user/{username} | Delete user
|
||||
*::UserApi* | [**GetUserByName**](docs/UserApi.md#GetUserByName) | **GET** /user/{username} | Get user by user name
|
||||
*::UserApi* | [**LoginUser**](docs/UserApi.md#LoginUser) | **GET** /user/login | Logs user into the system
|
||||
*::UserApi* | [**LogoutUser**](docs/UserApi.md#LogoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*::UserApi* | [**UpdateUser**](docs/UserApi.md#UpdateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [::Animal](docs/Animal.md)
|
||||
- [::Cat](docs/Cat.md)
|
||||
- [::Category](docs/Category.md)
|
||||
- [::Dog](docs/Dog.md)
|
||||
- [::FormatTest](docs/FormatTest.md)
|
||||
- [::InlineResponse200](docs/InlineResponse200.md)
|
||||
- [::Model200Response](docs/Model200Response.md)
|
||||
- [::ModelReturn](docs/ModelReturn.md)
|
||||
- [::Name](docs/Name.md)
|
||||
- [::Order](docs/Order.md)
|
||||
- [::Pet](docs/Pet.md)
|
||||
- [::SpecialModelName](docs/SpecialModelName.md)
|
||||
- [::Tag](docs/Tag.md)
|
||||
- [::User](docs/User.md)
|
||||
|
||||
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
||||
### test_api_client_id
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_id
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_api_client_secret
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: x-test_api_client_secret
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
### test_http_basic
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### test_api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### test_api_key_header
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: test_api_key_header
|
||||
- **Location**: HTTP header
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,14 +0,0 @@
|
||||
@echo off
|
||||
|
||||
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
|
||||
|
||||
|
||||
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
|
||||
.\nuget.exe install vendor/packages.config -o vendor
|
||||
|
||||
if not exist ".\bin" mkdir bin
|
||||
|
||||
copy vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
|
||||
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\*.cs /doc:bin\IO.Swagger.xml
|
@ -1,14 +0,0 @@
|
||||
# InlineResponse200
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**PhotoUrls** | **List<string>** | | [optional]
|
||||
**Name** | **string** | | [optional]
|
||||
**Id** | **long?** | |
|
||||
**Category** | **Object** | | [optional]
|
||||
**Tags** | [**List<Tag>**](Tag.md) | | [optional]
|
||||
**Status** | **string** | pet status in the store | [optional]
|
||||
|
||||
|
@ -1,235 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// InlineResponse200
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class InlineResponse200 : IEquatable<InlineResponse200>
|
||||
{
|
||||
/// <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="InlineResponse200" /> class.
|
||||
/// Initializes a new instance of the <see cref="InlineResponse200" />class.
|
||||
/// </summary>
|
||||
/// <param name="Tags">Tags.</param>
|
||||
/// <param name="Id">Id (required).</param>
|
||||
/// <param name="Category">Category.</param>
|
||||
/// <param name="Status">pet status in the store.</param>
|
||||
/// <param name="Name">Name.</param>
|
||||
/// <param name="PhotoUrls">PhotoUrls.</param>
|
||||
|
||||
public InlineResponse200(List<Tag> Tags = null, long? Id = null, Object Category = null, StatusEnum? Status = null, string Name = null, List<string> PhotoUrls = null)
|
||||
{
|
||||
// to ensure "Id" is required (not null)
|
||||
if (Id == null)
|
||||
{
|
||||
throw new InvalidDataException("Id is a required property for InlineResponse200 and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Id = Id;
|
||||
}
|
||||
this.Tags = Tags;
|
||||
this.Category = Category;
|
||||
this.Status = Status;
|
||||
this.Name = Name;
|
||||
this.PhotoUrls = PhotoUrls;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Tags
|
||||
/// </summary>
|
||||
[DataMember(Name="tags", EmitDefaultValue=false)]
|
||||
public List<Tag> Tags { get; set; }
|
||||
|
||||
/// <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 Object 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>
|
||||
/// 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 InlineResponse200 {\n");
|
||||
sb.Append(" Tags: ").Append(Tags).Append("\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Category: ").Append(Category).Append("\n");
|
||||
sb.Append(" Status: ").Append(Status).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" PhotoUrls: ").Append(PhotoUrls).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 InlineResponse200);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if InlineResponse200 instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of InlineResponse200 to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(InlineResponse200 other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Tags == other.Tags ||
|
||||
this.Tags != null &&
|
||||
this.Tags.SequenceEqual(other.Tags)
|
||||
) &&
|
||||
(
|
||||
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.Status == other.Status ||
|
||||
this.Status != null &&
|
||||
this.Status.Equals(other.Status)
|
||||
) &&
|
||||
(
|
||||
this.Name == other.Name ||
|
||||
this.Name != null &&
|
||||
this.Name.Equals(other.Name)
|
||||
) &&
|
||||
(
|
||||
this.PhotoUrls == other.PhotoUrls ||
|
||||
this.PhotoUrls != null &&
|
||||
this.PhotoUrls.SequenceEqual(other.PhotoUrls)
|
||||
);
|
||||
}
|
||||
|
||||
/// <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.Tags != null)
|
||||
hash = hash * 59 + this.Tags.GetHashCode();
|
||||
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
|
||||
if (this.Category != null)
|
||||
hash = hash * 59 + this.Category.GetHashCode();
|
||||
|
||||
if (this.Status != null)
|
||||
hash = hash * 59 + this.Status.GetHashCode();
|
||||
|
||||
if (this.Name != null)
|
||||
hash = hash * 59 + this.Name.GetHashCode();
|
||||
|
||||
if (this.PhotoUrls != null)
|
||||
hash = hash * 59 + this.PhotoUrls.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
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 ObjectReturn : IEquatable<ObjectReturn>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ObjectReturn" /> class.
|
||||
/// Initializes a new instance of the <see cref="ObjectReturn" />class.
|
||||
/// </summary>
|
||||
/// <param name="_Return">_Return.</param>
|
||||
|
||||
public ObjectReturn(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 ObjectReturn {\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 ObjectReturn);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ObjectReturn instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of ObjectReturn to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ObjectReturn 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user