diff --git a/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml deleted file mode 100644 index 76c07c772d6..00000000000 --- a/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: csharp-dotnet2 -outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-dotnet2 -additionalProperties: - hideGenerationTimestamp: "true" diff --git a/docs/generators.md b/docs/generators.md index a21693e18e0..2596227ea37 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -19,7 +19,6 @@ The following generators are available: * [cpp-ue4 (beta)](generators/cpp-ue4.md) * [crystal (beta)](generators/crystal.md) * [csharp](generators/csharp.md) -* [csharp-dotnet2 (deprecated)](generators/csharp-dotnet2.md) * [csharp-netcore](generators/csharp-netcore.md) * [dart](generators/dart.md) * [dart-dio](generators/dart-dio.md) diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md deleted file mode 100644 index 5e4c904382c..00000000000 --- a/docs/generators/csharp-dotnet2.md +++ /dev/null @@ -1,293 +0,0 @@ ---- -title: Documentation for the csharp-dotnet2 Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | csharp-dotnet2 | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | CLIENT | | -| generator language | C# | | -| generator default templating engine | mustache | | -| helpTxt | Generates a C# .Net 2.0 client library (beta). | | - -## CONFIG OPTIONS -These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|clientPackage|C# client package name (convention: Camel.Case).| |Org.OpenAPITools.Client| -|packageName|C# package name (convention: Camel.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | -|array|List| -|list|List| -|map|Dictionary| - - -## LANGUAGE PRIMITIVES - - - -## RESERVED WORDS - - - -## FEATURE SET - - -### Client Modification Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasePath|✗|ToolingExtension -|Authorizations|✗|ToolingExtension -|UserAgent|✗|ToolingExtension -|MockServer|✗|ToolingExtension - -### Data Type Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Custom|✗|OAS2,OAS3 -|Int32|✓|OAS2,OAS3 -|Int64|✓|OAS2,OAS3 -|Float|✓|OAS2,OAS3 -|Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension -|String|✓|OAS2,OAS3 -|Byte|✓|OAS2,OAS3 -|Binary|✓|OAS2,OAS3 -|Boolean|✓|OAS2,OAS3 -|Date|✓|OAS2,OAS3 -|DateTime|✓|OAS2,OAS3 -|Password|✓|OAS2,OAS3 -|File|✓|OAS2 -|Uuid|✗| -|Array|✓|OAS2,OAS3 -|Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 -|Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 -|Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension - -### Documentation Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Readme|✓|ToolingExtension -|Model|✓|ToolingExtension -|Api|✓|ToolingExtension - -### Global Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 -|Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✓|OAS3 -|LinkObjects|✗|OAS3 - -### Parameter Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✓|OAS3 - -### Schema Support Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✓|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 - -### Security Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 -|ApiKey|✓|OAS2,OAS3 -|OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 -|OAuth2_Password|✓|OAS2,OAS3 -|OAuth2_ClientCredentials|✓|OAS2,OAS3 -|OAuth2_AuthorizationCode|✓|OAS2,OAS3 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java deleted file mode 100644 index d9b2f5d5c22..00000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.SupportingFile; - -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.DocumentationFeature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; - -public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen { - private final Logger LOGGER = LoggerFactory.getLogger(CSharpDotNet2ClientCodegen.class); - - public static final String CLIENT_PACKAGE = "clientPackage"; - protected String clientPackage = "Org.OpenAPITools.Client"; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - - public CSharpDotNet2ClientCodegen() { - super(); - - modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - // clear import mapping (from default generator) as C# (2.0) does not use it - // at the moment - importMapping.clear(); - - modelTemplateFiles.put("model.mustache", ".cs"); - apiTemplateFiles.put("api.mustache", ".cs"); - - setApiPackage(packageName + ".Api"); - setModelPackage(packageName + ".Model"); - setClientPackage(packageName + ".Client"); - setSourceFolder("src" + File.separator + "main" + File.separator + "CsharpDotNet2"); - - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - - cliOptions.clear(); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, - "C# package name (convention: Camel.Case).") - .defaultValue(packageName)); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, - "C# package version.") - .defaultValue(packageVersion)); - cliOptions.add(new CliOption(CLIENT_PACKAGE, - "C# client package name (convention: Camel.Case).") - .defaultValue(clientPackage)); - } - - @Override - public void processOpts() { - LOGGER.warn("Per Microsoft Product Lifecycle (https://support.microsoft.com/en-us/lifecycle/search?sort=PN&alpha=.NET%20Framework&Filter=FilterNO), support for .NET Framework 2.0 ended in 2011 so there may be security issues using the auto-generated C# 2.0 source code."); - - super.processOpts(); - - if (additionalProperties.containsKey(CLIENT_PACKAGE)) { - setClientPackage((String) additionalProperties.get(CLIENT_PACKAGE)); - } else { - additionalProperties.put(CLIENT_PACKAGE, getClientPackage()); - } - - final String clientPackage = getClientPackage(); - final String clientPackagePath = clientPackage.replace(".", java.io.File.separator); - - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - supportingFiles.add(new SupportingFile("Configuration.mustache", - sourceFolder + File.separator + clientPackagePath, "Configuration.cs")); - supportingFiles.add(new SupportingFile("ApiClient.mustache", - sourceFolder + File.separator + clientPackagePath, "ApiClient.cs")); - supportingFiles.add(new SupportingFile("ApiException.mustache", - sourceFolder + File.separator + clientPackagePath, "ApiException.cs")); - supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config")); - supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh")); - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); - } - - @Override - public String apiPackage() { - return packageName + ".Api"; - } - - @Override - public String modelPackage() { - return packageName + ".Model"; - } - - public String getClientPackage() { - return clientPackage; - } - - public void setClientPackage(String clientPackage) { - this.clientPackage = clientPackage; - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "csharp-dotnet2"; - } - - @Override - public String getHelp() { - return "Generates a C# .Net 2.0 client library (beta)."; - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar); - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); - } - - @Override - public String apiDocFileFolder() { - return outputFolder + File.separator + apiDocPath.replace('/', File.separatorChar); - } - - @Override - public String modelDocFileFolder() { - return outputFolder + File.separator + modelDocPath.replace('/', File.separatorChar); - } - -} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index bac277ba6d2..633534b8f5f 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -22,7 +22,6 @@ org.openapitools.codegen.languages.CppTizenClientCodegen org.openapitools.codegen.languages.CppUE4ClientCodegen org.openapitools.codegen.languages.CSharpClientCodegen org.openapitools.codegen.languages.CSharpNetCoreClientCodegen -org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen org.openapitools.codegen.languages.DartClientCodegen org.openapitools.codegen.languages.DartDioClientCodegen @@ -140,4 +139,4 @@ org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen -org.openapitools.codegen.languages.WsdlSchemaCodegen \ No newline at end of file +org.openapitools.codegen.languages.WsdlSchemaCodegen diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.gitignore b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.gitignore deleted file mode 100644 index 1ee53850b84..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.gitignore +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator-ignore b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES deleted file mode 100644 index bf325d51202..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES +++ /dev/null @@ -1,25 +0,0 @@ -.gitignore -README.md -compile-mono.sh -docs/ApiResponse.md -docs/Category.md -docs/Order.md -docs/Pet.md -docs/PetApi.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs -vendor/packages.config diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md deleted file mode 100644 index 5296503208a..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# Org.OpenAPITools - the C# library for the OpenAPI Petstore - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- SDK version: 1.0.0 -- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen - - -## Frameworks supported -- .NET 2.0 - - -## Dependencies -- Mono compiler -- Newtonsoft.Json.7.0.1 -- RestSharp.Net2.1.1.11 - -Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator - - -## Installation -Run the following command to generate the DLL -- [Mac/Linux] `/bin/sh compile-mono.sh` -- [Windows] TODO - -Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: -```csharp -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; -``` - -## Getting Started - -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class Example - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add 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* | [**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* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*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 - - - [Org.OpenAPITools.Model.ApiResponse](docs/ApiResponse.md) - - [Org.OpenAPITools.Model.Category](docs/Category.md) - - [Org.OpenAPITools.Model.Order](docs/Order.md) - - [Org.OpenAPITools.Model.Pet](docs/Pet.md) - - [Org.OpenAPITools.Model.Tag](docs/Tag.md) - - [Org.OpenAPITools.Model.User](docs/User.md) - - - -## Documentation for Authorization - -Authentication schemes defined for the API: - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### 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 - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/compile-mono.sh b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/compile-mono.sh deleted file mode 100644 index 8e6e23eba08..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/compile-mono.sh +++ /dev/null @@ -1,12 +0,0 @@ -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; -mozroots --import --sync -mono nuget.exe install vendor/packages.config -o vendor; -mkdir -p bin; -mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ -vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ -System.Runtime.Serialization.dll \ --target:library \ --out:bin/Org.OpenAPITools.dll \ --recurse:'src/*.cs' \ --doc:bin/Org.OpenAPITools.xml \ --platform:anycpu diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/ApiResponse.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/ApiResponse.md deleted file mode 100644 index 01b35815bd4..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/ApiResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# Org.OpenAPITools.Model.ApiResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] -**Type** | **string** | | [optional] -**Message** | **string** | | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Category.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Category.md deleted file mode 100644 index 860a468e35c..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Category.md +++ /dev/null @@ -1,10 +0,0 @@ -# Org.OpenAPITools.Model.Category -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Name** | **string** | | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object.md deleted file mode 100644 index 40e16da1bb7..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object.md +++ /dev/null @@ -1,10 +0,0 @@ -# Org.OpenAPITools.Model.InlineObject -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | Updated name of the pet | [optional] -**Status** | **string** | Updated status of the pet | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object_1.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object_1.md deleted file mode 100644 index 2e6d226754e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object_1.md +++ /dev/null @@ -1,10 +0,0 @@ -# Org.OpenAPITools.Model.InlineObject1 -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] -**File** | **System.IO.Stream** | file to upload | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Order.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Order.md deleted file mode 100644 index 984bd5ca063..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Order.md +++ /dev/null @@ -1,14 +0,0 @@ -# Org.OpenAPITools.Model.Order -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] -**Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Pet.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Pet.md deleted file mode 100644 index ce9fe873cd2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Pet.md +++ /dev/null @@ -1,14 +0,0 @@ -# Org.OpenAPITools.Model.Pet -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] -**Name** | **string** | | -**PhotoUrls** | **List** | | -**Tags** | [**List**](Tag.md) | | [optional] -**Status** | **string** | pet status in the store | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md deleted file mode 100644 index 373f0348fe7..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md +++ /dev/null @@ -1,526 +0,0 @@ -# Org.OpenAPITools.Api.PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **AddPet** -> void AddPet (Pet body) - -Add a new pet to the store - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class AddPetExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[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) - - -# **DeletePet** -> void DeletePet (long? petId, string apiKey) - -Deletes a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeletePetExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete - var apiKey = apiKey_example; // string | (optional) - - try - { - // Deletes a pet - apiInstance.DeletePet(petId, apiKey); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | - **apiKey** | **string**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **FindPetsByStatus** -> List FindPetsByStatus (List status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByStatusExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var status = status_example; // List | Status values that need to be considered for filter - - try - { - // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **List**| Status values that need to be considered for filter | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### 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) - - -# **FindPetsByTags** -> List FindPetsByTags (List tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByTagsExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var tags = new List(); // List | Tags to filter by - - try - { - // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List**](string.md)| Tags to filter by | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### 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) - - -# **GetPetById** -> Pet GetPetById (long? petId) - -Find pet by ID - -Returns a single pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetPetByIdExample - { - public void main() - { - // 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"); - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return - - try - { - // Find pet by ID - Pet result = apiInstance.GetPetById(petId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### 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) - - -# **UpdatePet** -> void UpdatePet (Pet body) - -Update an existing pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Update an existing pet - apiInstance.UpdatePet(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[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) - - -# **UpdatePetWithForm** -> void UpdatePetWithForm (long? petId, string name, string status) - -Updates a pet in the store with form data - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetWithFormExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) - - try - { - // Updates a pet in the store with form data - apiInstance.UpdatePetWithForm(petId, name, status); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | - **name** | **string**| Updated name of the pet | [optional] - **status** | **string**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[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) - - -# **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) - -uploads an image - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UploadFileExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) - - try - { - // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | - **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: 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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md deleted file mode 100644 index d68fa5efb81..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md +++ /dev/null @@ -1,254 +0,0 @@ -# Org.OpenAPITools.Api.StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - - -# **DeleteOrder** -> void DeleteOrder (string orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteOrderExample - { - public void main() - { - var apiInstance = new StoreApi(); - var orderId = orderId_example; // string | ID of the order that needs to be deleted - - try - { - // Delete purchase order by ID - apiInstance.DeleteOrder(orderId); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **string**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **GetInventory** -> Dictionary GetInventory () - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetInventoryExample - { - public void main() - { - // 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"); - - var apiInstance = new StoreApi(); - - try - { - // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); - } - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Dictionary** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: 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) - - -# **GetOrderById** -> Order GetOrderById (long? orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetOrderByIdExample - { - public void main() - { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched - - try - { - // Find purchase order by ID - Order result = apiInstance.GetOrderById(orderId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### 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) - - -# **PlaceOrder** -> Order PlaceOrder (Order body) - -Place an order for a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class PlaceOrderExample - { - public void main() - { - var apiInstance = new StoreApi(); - var body = new Order(); // Order | order placed for purchasing the pet - - try - { - // Place an order for a pet - Order result = apiInstance.PlaceOrder(body); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### 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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Tag.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Tag.md deleted file mode 100644 index 6a76c28595f..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Tag.md +++ /dev/null @@ -1,10 +0,0 @@ -# Org.OpenAPITools.Model.Tag -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Name** | **string** | | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/User.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/User.md deleted file mode 100644 index 04dd24a3423..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/User.md +++ /dev/null @@ -1,16 +0,0 @@ -# Org.OpenAPITools.Model.User -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md deleted file mode 100644 index 74ca98353aa..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md +++ /dev/null @@ -1,488 +0,0 @@ -# Org.OpenAPITools.Api.UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user -[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - -# **CreateUser** -> void CreateUser (User body) - -Create user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var body = new User(); // User | Created user object - - try - { - // Create user - apiInstance.CreateUser(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List body) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithArrayInputExample - { - public void main() - { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **CreateUsersWithListInput** -> void CreateUsersWithListInput (List body) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithListInputExample - { - public void main() - { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **DeleteUser** -> void DeleteUser (string username) - -Delete user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be deleted - - try - { - // Delete user - apiInstance.DeleteUser(username); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **GetUserByName** -> User GetUserByName (string username) - -Get user by user name - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetUserByNameExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. - - try - { - // Get user by user name - User result = apiInstance.GetUserByName(username); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### 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) - - -# **LoginUser** -> string LoginUser (string username, string password) - -Logs user into the system - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LoginUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text - - try - { - // Logs user into the system - string result = apiInstance.LoginUser(username, password); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The user name for login | - **password** | **string**| The password for login in clear text | - -### Return type - -**string** - -### 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) - - -# **LogoutUser** -> void LogoutUser () - -Logs out current logged in user session - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LogoutUserExample - { - public void main() - { - var apiInstance = new UserApi(); - - try - { - // Logs out current logged in user session - apiInstance.LogoutUser(); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); - } - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **UpdateUser** -> void UpdateUser (string username, User body) - -Updated user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdateUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | name that need to be deleted - var body = new User(); // User | Updated user object - - try - { - // Updated user - apiInstance.UpdateUser(username, body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/nuget.exe b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/nuget.exe deleted file mode 100644 index 0cc40884a0d..00000000000 Binary files a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/nuget.exe and /dev/null differ diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs deleted file mode 100644 index 7a6131e249e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs +++ /dev/null @@ -1,431 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IPetApi - { - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - void AddPet (Pet body); - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - void DeletePet (long? petId, string apiKey); - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - List FindPetsByStatus (List status); - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - [Obsolete] - List FindPetsByTags (List tags); - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - Pet GetPetById (long? petId); - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - void UpdatePet (Pet body); - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - void UpdatePetWithForm (long? petId, string name, string status); - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class PetApi : IPetApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public PetApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public PetApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - public void AddPet (Pet body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling AddPet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - public void DeletePet (long? petId, string apiKey) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - public List FindPetsByStatus (List status) - { - - // verify the required parameter 'status' is set - if (status == null) throw new ApiException(400, "Missing required parameter 'status' when calling FindPetsByStatus"); - - - var path = "/pet/findByStatus"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - [Obsolete] - public List FindPetsByTags (List tags) - { - - // verify the required parameter 'tags' is set - if (tags == null) throw new ApiException(400, "Missing required parameter 'tags' when calling FindPetsByTags"); - - - var path = "/pet/findByTags"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - public Pet GetPetById (long? petId) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage); - - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - public void UpdatePet (Pet body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdatePet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - public void UpdatePetWithForm (long? petId, string name, string status) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter -if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - - - var path = "/pet/{petId}/uploadImage"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter -if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage); - - return (ApiResponse) ApiClient.Deserialize(response.Content, typeof(ApiResponse), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs deleted file mode 100644 index 423d179cdbe..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IStoreApi - { - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - void DeleteOrder (string orderId); - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - Dictionary GetInventory (); - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - Order GetOrderById (long? orderId); - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - Order PlaceOrder (Order body); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class StoreApi : IStoreApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public StoreApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public StoreApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - public void DeleteOrder (string orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - public Dictionary GetInventory () - { - - - var path = "/store/inventory"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage); - - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); - } - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - public Order GetOrderById (long? orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - public Order PlaceOrder (Order body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling PlaceOrder"); - - - var path = "/store/order"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs deleted file mode 100644 index 3f453e6b9b2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs +++ /dev/null @@ -1,420 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IUserApi - { - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - void CreateUser (User body); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithArrayInput (List body); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithListInput (List body); - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - void DeleteUser (string username); - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName (string username); - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser (string username, string password); - /// - /// Logs out current logged in user session - /// - /// - void LogoutUser (); - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - void UpdateUser (string username, User body); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class UserApi : IUserApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public UserApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public UserApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - public void CreateUser (User body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUser"); - - - var path = "/user"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithArrayInput (List body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithArrayInput"); - - - var path = "/user/createWithArray"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithListInput (List body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithListInput"); - - - var path = "/user/createWithList"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - public void DeleteUser (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - public User GetUserByName (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage); - - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - public string LoginUser (string username, string password) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling LoginUser"); - - // verify the required parameter 'password' is set - if (password == null) throw new ApiException(400, "Missing required parameter 'password' when calling LoginUser"); - - - var path = "/user/login"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter - if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage); - - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); - } - - /// - /// Logs out current logged in user session - /// - /// - public void LogoutUser () - { - - - var path = "/user/logout"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - public void UpdateUser (string username, User body) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdateUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs deleted file mode 100644 index 7b0d472a06e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.IO; -using System.Web; -using System.Linq; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using RestSharp; -using RestSharp.Extensions; - -namespace Org.OpenAPITools.Client -{ - /// - /// API client is mainly responsible for making the HTTP call to the API backend. - /// - public class ApiClient - { - private readonly Dictionary _defaultHeaderMap = new Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// The base path. - public ApiClient(String basePath="http://petstore.swagger.io/v2") - { - BasePath = basePath; - RestClient = new RestClient(BasePath); - } - - /// - /// Gets or sets the base path. - /// - /// The base path - public string BasePath { get; set; } - - /// - /// Gets or sets the RestClient. - /// - /// An instance of the RestClient - public RestClient RestClient { get; set; } - - /// - /// Gets the default header. - /// - public Dictionary DefaultHeader - { - get { return _defaultHeaderMap; } - } - - /// - /// Makes the HTTP request (Sync). - /// - /// URL path. - /// HTTP method. - /// Query parameters. - /// HTTP body (POST request). - /// Header parameters. - /// Form parameters. - /// File parameters. - /// Authentication settings. - /// Object - public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, String[] authSettings) - { - - var request = new RestRequest(path, method); - - UpdateParamsForAuth(queryParams, headerParams, authSettings); - - // add default header, if any - foreach(var defaultHeader in _defaultHeaderMap) - request.AddHeader(defaultHeader.Key, defaultHeader.Value); - - // add header parameter, if any - foreach(var param in headerParams) - request.AddHeader(param.Key, param.Value); - - // add query parameter, if any - foreach(var param in queryParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add form parameter, if any - foreach(var param in formParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add file parameter, if any - foreach(var param in fileParams) - request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - - if (postBody != null) // http body (model) parameter - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - - return (Object)RestClient.Execute(request); - - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - public void AddDefaultHeader(string key, string value) - { - _defaultHeaderMap.Add(key, value); - } - - /// - /// Escape string (url-encoded). - /// - /// String to be escaped. - /// Escaped string. - public string EscapeString(string str) - { - return RestSharp.Contrib.HttpUtility.UrlEncode(str); - } - - /// - /// Create FileParameter based on Stream. - /// - /// Parameter name. - /// Input stream. - /// FileParameter. - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) - return FileParameter.Create(name, stream.ReadAsBytes(), Path.GetFileName(((FileStream)stream).Name)); - else - return FileParameter.Create(name, stream.ReadAsBytes(), "no_file_name_provided"); - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list of string, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// Formatted string. - public string ParameterToString(object obj) - { - if (obj is DateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString (Configuration.DateTimeFormat); - else if (obj is bool) - return (bool)obj ? "true" : "false"; - else if (obj is List) - return String.Join(",", (obj as List).ToArray()); - else - return Convert.ToString (obj); - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// HTTP body (e.g. string, JSON). - /// Object type. - /// HTTP headers. - /// Object representation of the JSON string. - public object Deserialize(string content, Type type, IList headers=null) - { - if (type == typeof(Object)) // return an object - { - return content; - } - - if (type == typeof(Stream)) - { - var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) - ? Path.GetTempPath() - : Configuration.TempFolderPath; - - var fileName = filePath + Guid.NewGuid(); - if (headers != null) - { - var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); - var match = regex.Match(headers.ToString()); - if (match.Success) - fileName = filePath + match.Value.Replace("\"", "").Replace("'", ""); - } - File.WriteAllText(fileName, content); - return new FileStream(fileName, FileMode.Open); - - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return ConvertType(content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(content, type); - } - catch (IOException e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Serialize an object into JSON string. - /// - /// Object. - /// JSON string. - public string Serialize(object obj) - { - try - { - return obj != null ? JsonConvert.SerializeObject(obj) : null; - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Get the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix (string apiKeyIdentifier) - { - var apiKeyValue = ""; - Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) - return apiKeyPrefix + " " + apiKeyValue; - else - return apiKeyValue; - } - - /// - /// Update parameters based on authentication. - /// - /// Query parameters. - /// Header parameters. - /// Authentication settings. - public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) - { - if (authSettings == null || authSettings.Length == 0) - return; - - foreach (string auth in authSettings) - { - // determine which one to use - switch(auth) - { - case "api_key": - headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); - break; - case "petstore_auth": - headerParams["Authorization"] = "Bearer " + Configuration.AccessToken; - break; - default: - //TODO show warning about security definition not found - break; - } - } - } - - /// - /// Encode string in base64 format. - /// - /// String to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - var textByte = System.Text.Encoding.UTF8.GetBytes(text); - return System.Convert.ToBase64String(textByte); - } - - /// - /// Dynamically cast the object into target type. - /// - /// Object to be casted - /// Target type - /// Casted object - public static Object ConvertType(Object fromObject, Type toObject) { - return Convert.ChangeType(fromObject, toObject); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs deleted file mode 100644 index 7985897b93e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Org.OpenAPITools.Client { - /// - /// API Exception - /// - public class ApiException : Exception { - /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public Object ErrorContent { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public ApiException() {} - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - public ApiException(int errorCode, string message) : base(message) { - this.ErrorCode = errorCode; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - public ApiException(int errorCode, string message, Object errorContent = null) : base(message) { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - } - - } - -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs deleted file mode 100644 index 10bd0088bb7..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System; -using System.Reflection; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace Org.OpenAPITools.Client -{ - /// - /// Represents a set of configuration settings - /// - public class Configuration - { - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.0"; - - /// - /// Gets or sets the default API client for making HTTP calls. - /// - /// The API client. - public static ApiClient DefaultApiClient = new ApiClient(); - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public static String Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public static String Password { get; set; } - - /// - /// Gets or sets the access token (Bearer/OAuth authentication). - /// - /// The access token. - public static String AccessToken { get; set; } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public static Dictionary ApiKey = new Dictionary(); - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - public static Dictionary ApiKeyPrefix = new Dictionary(); - - private static string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public static String TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (String.IsNullOrEmpty(value)) - { - _tempFolderPath = value; - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - Directory.CreateDirectory(value); - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - _tempFolderPath = value; - else - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - - private const string ISO8601_DATETIME_FORMAT = "o"; - - private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public static String DateTimeFormat - { - get - { - return _dateTimeFormat; - } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Returns a string with essential information for debugging. - /// - public static String ToDebugReport() - { - String report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; - report += " OS: " + Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + Assembly - .GetExecutingAssembly() - .GetReferencedAssemblies() - .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n"; - report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0\n"; - - return report; - } - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs deleted file mode 100644 index 648aaeba5b1..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// Describes the result of uploading an image resource - /// - [DataContract] - public class ApiResponse { - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "code")] - public int? Code { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class ApiResponse {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs deleted file mode 100644 index 847279502e2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A category for a pet - /// - [DataContract] - public class Category { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject.cs deleted file mode 100644 index 2de88324c58..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// - /// - [DataContract] - public class InlineObject { - /// - /// Updated name of the pet - /// - /// Updated name of the pet - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Updated status of the pet - /// - /// Updated status of the pet - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class InlineObject {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject1.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject1.cs deleted file mode 100644 index 03d1fa0c786..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject1.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// - /// - [DataContract] - public class InlineObject1 { - /// - /// Additional data to pass to server - /// - /// Additional data to pass to server - [DataMember(Name="additionalMetadata", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "additionalMetadata")] - public string AdditionalMetadata { get; set; } - - /// - /// file to upload - /// - /// file to upload - [DataMember(Name="file", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "file")] - public System.IO.Stream File { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class InlineObject1 {\n"); - sb.Append(" AdditionalMetadata: ").Append(AdditionalMetadata).Append("\n"); - sb.Append(" File: ").Append(File).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs deleted file mode 100644 index c19511ca3f8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// An order for a pets from the pet store - /// - [DataContract] - public class Order { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets PetId - /// - [DataMember(Name="petId", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "petId")] - public long? PetId { get; set; } - - /// - /// Gets or Sets Quantity - /// - [DataMember(Name="quantity", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "quantity")] - public int? Quantity { get; set; } - - /// - /// Gets or Sets ShipDate - /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "shipDate")] - public DateTime? ShipDate { get; set; } - - /// - /// Order Status - /// - /// Order Status - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or Sets Complete - /// - [DataMember(Name="complete", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "complete")] - public bool? Complete { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs deleted file mode 100644 index 71ec62aa9c8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A pet for sale in the pet store - /// - [DataContract] - public class Pet { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name="category", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "category")] - public Category Category { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or Sets PhotoUrls - /// - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "photoUrls")] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Tags - /// - [DataMember(Name="tags", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "tags")] - public List Tags { get; set; } - - /// - /// pet status in the store - /// - /// pet status in the store - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs deleted file mode 100644 index 6399695a50a..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A tag for a pet - /// - [DataContract] - public class Tag { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs deleted file mode 100644 index c6af059dcdc..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A User who is purchasing from the pet store - /// - [DataContract] - public class User { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Username - /// - [DataMember(Name="username", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or Sets FirstName - /// - [DataMember(Name="firstName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "firstName")] - public string FirstName { get; set; } - - /// - /// Gets or Sets LastName - /// - [DataMember(Name="lastName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "lastName")] - public string LastName { get; set; } - - /// - /// Gets or Sets Email - /// - [DataMember(Name="email", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name="password", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or Sets Phone - /// - [DataMember(Name="phone", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "phone")] - public string Phone { get; set; } - - /// - /// User Status - /// - /// User Status - [DataMember(Name="userStatus", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "userStatus")] - public int? UserStatus { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class User {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/vendor/packages.config b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/vendor/packages.config deleted file mode 100644 index 7b9cf186303..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/vendor/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md deleted file mode 100644 index 6b861dfd723..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Org.OpenAPITools - the C# library for the OpenAPI Petstore - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- SDK version: 1.0.0 -- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen - - -## Frameworks supported -- .NET 2.0 - - -## Dependencies -- Mono compiler -- Newtonsoft.Json.7.0.1 -- RestSharp.Net2.1.1.11 - -Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator - - -## Installation -Run the following command to generate the DLL -- [Mac/Linux] `/bin/sh compile-mono.sh` -- [Windows] TODO - -Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: -```csharp -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; -``` - -## Getting Started - -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class Example - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(pet); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add 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* | [**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* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*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 - - - [Org.OpenAPITools.Model.ApiResponse](docs/ApiResponse.md) - - [Org.OpenAPITools.Model.Category](docs/Category.md) - - [Org.OpenAPITools.Model.Order](docs/Order.md) - - [Org.OpenAPITools.Model.Pet](docs/Pet.md) - - [Org.OpenAPITools.Model.Tag](docs/Tag.md) - - [Org.OpenAPITools.Model.User](docs/User.md) - - - -## Documentation for Authorization - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### 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 - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh deleted file mode 100644 index 8e6e23eba08..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh +++ /dev/null @@ -1,12 +0,0 @@ -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; -mozroots --import --sync -mono nuget.exe install vendor/packages.config -o vendor; -mkdir -p bin; -mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ -vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ -System.Runtime.Serialization.dll \ --target:library \ --out:bin/Org.OpenAPITools.dll \ --recurse:'src/*.cs' \ --doc:bin/Org.OpenAPITools.xml \ --platform:anycpu diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md deleted file mode 100644 index 01b35815bd4..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# Org.OpenAPITools.Model.ApiResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] -**Type** | **string** | | [optional] -**Message** | **string** | | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md deleted file mode 100644 index 860a468e35c..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md +++ /dev/null @@ -1,10 +0,0 @@ -# Org.OpenAPITools.Model.Category -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Name** | **string** | | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md deleted file mode 100644 index 984bd5ca063..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md +++ /dev/null @@ -1,14 +0,0 @@ -# Org.OpenAPITools.Model.Order -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] -**Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md deleted file mode 100644 index ce9fe873cd2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md +++ /dev/null @@ -1,14 +0,0 @@ -# Org.OpenAPITools.Model.Pet -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] -**Name** | **string** | | -**PhotoUrls** | **List** | | -**Tags** | [**List**](Tag.md) | | [optional] -**Status** | **string** | pet status in the store | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md deleted file mode 100644 index 0051c617a1d..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md +++ /dev/null @@ -1,534 +0,0 @@ -# Org.OpenAPITools.Api.PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **AddPet** -> void AddPet (Pet pet) - -Add a new pet to the store - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class AddPetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(pet); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[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) - - -# **DeletePet** -> void DeletePet (long? petId, string apiKey) - -Deletes a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeletePetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete - var apiKey = apiKey_example; // string | (optional) - - try - { - // Deletes a pet - apiInstance.DeletePet(petId, apiKey); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | - **apiKey** | **string**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **FindPetsByStatus** -> List FindPetsByStatus (List status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByStatusExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var status = status_example; // List | Status values that need to be considered for filter - - try - { - // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **List**| Status values that need to be considered for filter | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### 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) - - -# **FindPetsByTags** -> List FindPetsByTags (List tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByTagsExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var tags = new List(); // List | Tags to filter by - - try - { - // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List**](string.md)| Tags to filter by | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### 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) - - -# **GetPetById** -> Pet GetPetById (long? petId) - -Find pet by ID - -Returns a single pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetPetByIdExample - { - public void main() - { - - // 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"); - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return - - try - { - // Find pet by ID - Pet result = apiInstance.GetPetById(petId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### 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) - - -# **UpdatePet** -> void UpdatePet (Pet pet) - -Update an existing pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Update an existing pet - apiInstance.UpdatePet(pet); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[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) - - -# **UpdatePetWithForm** -> void UpdatePetWithForm (long? petId, string name, string status) - -Updates a pet in the store with form data - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetWithFormExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) - - try - { - // Updates a pet in the store with form data - apiInstance.UpdatePetWithForm(petId, name, status); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | - **name** | **string**| Updated name of the pet | [optional] - **status** | **string**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[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) - - -# **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) - -uploads an image - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UploadFileExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) - - try - { - // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | - **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: 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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md deleted file mode 100644 index 58e85fb6eb6..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md +++ /dev/null @@ -1,258 +0,0 @@ -# Org.OpenAPITools.Api.StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - - -# **DeleteOrder** -> void DeleteOrder (string orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteOrderExample - { - public void main() - { - - var apiInstance = new StoreApi(); - var orderId = orderId_example; // string | ID of the order that needs to be deleted - - try - { - // Delete purchase order by ID - apiInstance.DeleteOrder(orderId); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **string**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **GetInventory** -> Dictionary GetInventory () - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetInventoryExample - { - public void main() - { - - // 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"); - - var apiInstance = new StoreApi(); - - try - { - // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); - } - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Dictionary** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: 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) - - -# **GetOrderById** -> Order GetOrderById (long? orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetOrderByIdExample - { - public void main() - { - - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched - - try - { - // Find purchase order by ID - Order result = apiInstance.GetOrderById(orderId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### 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) - - -# **PlaceOrder** -> Order PlaceOrder (Order order) - -Place an order for a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class PlaceOrderExample - { - public void main() - { - - var apiInstance = new StoreApi(); - var order = new Order(); // Order | order placed for purchasing the pet - - try - { - // Place an order for a pet - Order result = apiInstance.PlaceOrder(order); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### 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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md deleted file mode 100644 index 6a76c28595f..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md +++ /dev/null @@ -1,10 +0,0 @@ -# Org.OpenAPITools.Model.Tag -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Name** | **string** | | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md deleted file mode 100644 index 04dd24a3423..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md +++ /dev/null @@ -1,16 +0,0 @@ -# Org.OpenAPITools.Model.User -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md deleted file mode 100644 index dad1e505005..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md +++ /dev/null @@ -1,496 +0,0 @@ -# Org.OpenAPITools.Api.UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user -[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - -# **CreateUser** -> void CreateUser (User user) - -Create user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var user = new User(); // User | Created user object - - try - { - // Create user - apiInstance.CreateUser(user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List user) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithArrayInputExample - { - public void main() - { - - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List**](List.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **CreateUsersWithListInput** -> void CreateUsersWithListInput (List user) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithListInputExample - { - public void main() - { - - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List**](List.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **DeleteUser** -> void DeleteUser (string username) - -Delete user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be deleted - - try - { - // Delete user - apiInstance.DeleteUser(username); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **GetUserByName** -> User GetUserByName (string username) - -Get user by user name - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetUserByNameExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. - - try - { - // Get user by user name - User result = apiInstance.GetUserByName(username); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### 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) - - -# **LoginUser** -> string LoginUser (string username, string password) - -Logs user into the system - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LoginUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text - - try - { - // Logs user into the system - string result = apiInstance.LoginUser(username, password); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The user name for login | - **password** | **string**| The password for login in clear text | - -### Return type - -**string** - -### 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) - - -# **LogoutUser** -> void LogoutUser () - -Logs out current logged in user session - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LogoutUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - - try - { - // Logs out current logged in user session - apiInstance.LogoutUser(); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); - } - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - - -# **UpdateUser** -> void UpdateUser (string username, User user) - -Updated user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdateUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | name that need to be deleted - var user = new User(); // User | Updated user object - - try - { - // Updated user - apiInstance.UpdateUser(username, user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[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) - diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs deleted file mode 100644 index 66e0f6ab5cc..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs +++ /dev/null @@ -1,429 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IPetApi - { - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - void AddPet (Pet pet); - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - void DeletePet (long? petId, string apiKey); - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - List FindPetsByStatus (List status); - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - List FindPetsByTags (List tags); - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - Pet GetPetById (long? petId); - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - void UpdatePet (Pet pet); - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - void UpdatePetWithForm (long? petId, string name, string status); - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class PetApi : IPetApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public PetApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public PetApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - public void AddPet (Pet pet) - { - - // verify the required parameter 'pet' is set - if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling AddPet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(pet); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - public void DeletePet (long? petId, string apiKey) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - public List FindPetsByStatus (List status) - { - - // verify the required parameter 'status' is set - if (status == null) throw new ApiException(400, "Missing required parameter 'status' when calling FindPetsByStatus"); - - - var path = "/pet/findByStatus"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - public List FindPetsByTags (List tags) - { - - // verify the required parameter 'tags' is set - if (tags == null) throw new ApiException(400, "Missing required parameter 'tags' when calling FindPetsByTags"); - - - var path = "/pet/findByTags"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - public Pet GetPetById (long? petId) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage); - - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - public void UpdatePet (Pet pet) - { - - // verify the required parameter 'pet' is set - if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling UpdatePet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(pet); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - public void UpdatePetWithForm (long? petId, string name, string status) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter -if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - - - var path = "/pet/{petId}/uploadImage"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter -if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage); - - return (ApiResponse) ApiClient.Deserialize(response.Content, typeof(ApiResponse), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs deleted file mode 100644 index c23c321d637..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IStoreApi - { - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - void DeleteOrder (string orderId); - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - Dictionary GetInventory (); - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - Order GetOrderById (long? orderId); - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - Order PlaceOrder (Order order); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class StoreApi : IStoreApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public StoreApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public StoreApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - public void DeleteOrder (string orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - public Dictionary GetInventory () - { - - - var path = "/store/inventory"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage); - - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); - } - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - public Order GetOrderById (long? orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - public Order PlaceOrder (Order order) - { - - // verify the required parameter 'order' is set - if (order == null) throw new ApiException(400, "Missing required parameter 'order' when calling PlaceOrder"); - - - var path = "/store/order"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(order); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs deleted file mode 100644 index 60a0ccac599..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs +++ /dev/null @@ -1,420 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IUserApi - { - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - void CreateUser (User user); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithArrayInput (List user); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithListInput (List user); - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - void DeleteUser (string username); - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName (string username); - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser (string username, string password); - /// - /// Logs out current logged in user session - /// - /// - void LogoutUser (); - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - void UpdateUser (string username, User user); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class UserApi : IUserApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public UserApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public UserApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - public void CreateUser (User user) - { - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUser"); - - - var path = "/user"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithArrayInput (List user) - { - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithArrayInput"); - - - var path = "/user/createWithArray"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithListInput (List user) - { - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithListInput"); - - - var path = "/user/createWithList"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - public void DeleteUser (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - public User GetUserByName (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage); - - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - public string LoginUser (string username, string password) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling LoginUser"); - - // verify the required parameter 'password' is set - if (password == null) throw new ApiException(400, "Missing required parameter 'password' when calling LoginUser"); - - - var path = "/user/login"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter - if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage); - - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); - } - - /// - /// Logs out current logged in user session - /// - /// - public void LogoutUser () - { - - - var path = "/user/logout"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - public void UpdateUser (string username, User user) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling UpdateUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs deleted file mode 100644 index 5903fde02ad..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.IO; -using System.Web; -using System.Linq; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using RestSharp; -using RestSharp.Extensions; - -namespace Org.OpenAPITools.Client -{ - /// - /// API client is mainly responsible for making the HTTP call to the API backend. - /// - public class ApiClient - { - private readonly Dictionary _defaultHeaderMap = new Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// The base path. - public ApiClient(String basePath="http://petstore.swagger.io/v2") - { - BasePath = basePath; - RestClient = new RestClient(BasePath); - } - - /// - /// Gets or sets the base path. - /// - /// The base path - public string BasePath { get; set; } - - /// - /// Gets or sets the RestClient. - /// - /// An instance of the RestClient - public RestClient RestClient { get; set; } - - /// - /// Gets the default header. - /// - public Dictionary DefaultHeader - { - get { return _defaultHeaderMap; } - } - - /// - /// Makes the HTTP request (Sync). - /// - /// URL path. - /// HTTP method. - /// Query parameters. - /// HTTP body (POST request). - /// Header parameters. - /// Form parameters. - /// File parameters. - /// Authentication settings. - /// Object - public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, String[] authSettings) - { - - var request = new RestRequest(path, method); - - UpdateParamsForAuth(queryParams, headerParams, authSettings); - - // add default header, if any - foreach(var defaultHeader in _defaultHeaderMap) - request.AddHeader(defaultHeader.Key, defaultHeader.Value); - - // add header parameter, if any - foreach(var param in headerParams) - request.AddHeader(param.Key, param.Value); - - // add query parameter, if any - foreach(var param in queryParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add form parameter, if any - foreach(var param in formParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add file parameter, if any - foreach(var param in fileParams) - request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - - if (postBody != null) // http body (model) parameter - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - - return (Object)RestClient.Execute(request); - - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - public void AddDefaultHeader(string key, string value) - { - _defaultHeaderMap.Add(key, value); - } - - /// - /// Escape string (url-encoded). - /// - /// String to be escaped. - /// Escaped string. - public string EscapeString(string str) - { - return RestSharp.Contrib.HttpUtility.UrlEncode(str); - } - - /// - /// Create FileParameter based on Stream. - /// - /// Parameter name. - /// Input stream. - /// FileParameter. - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) - return FileParameter.Create(name, stream.ReadAsBytes(), Path.GetFileName(((FileStream)stream).Name)); - else - return FileParameter.Create(name, stream.ReadAsBytes(), "no_file_name_provided"); - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list of string, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// Formatted string. - public string ParameterToString(object obj) - { - if (obj is DateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString (Configuration.DateTimeFormat); - else if (obj is List) - return String.Join(",", (obj as List).ToArray()); - else - return Convert.ToString (obj); - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// HTTP body (e.g. string, JSON). - /// Object type. - /// HTTP headers. - /// Object representation of the JSON string. - public object Deserialize(string content, Type type, IList headers=null) - { - if (type == typeof(Object)) // return an object - { - return content; - } - - if (type == typeof(Stream)) - { - var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) - ? Path.GetTempPath() - : Configuration.TempFolderPath; - - var fileName = filePath + Guid.NewGuid(); - if (headers != null) - { - var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); - var match = regex.Match(headers.ToString()); - if (match.Success) - fileName = filePath + match.Value.Replace("\"", "").Replace("'", ""); - } - File.WriteAllText(fileName, content); - return new FileStream(fileName, FileMode.Open); - - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return ConvertType(content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(content, type); - } - catch (IOException e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Serialize an object into JSON string. - /// - /// Object. - /// JSON string. - public string Serialize(object obj) - { - try - { - return obj != null ? JsonConvert.SerializeObject(obj) : null; - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Get the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix (string apiKeyIdentifier) - { - var apiKeyValue = ""; - Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) - return apiKeyPrefix + " " + apiKeyValue; - else - return apiKeyValue; - } - - /// - /// Update parameters based on authentication. - /// - /// Query parameters. - /// Header parameters. - /// Authentication settings. - public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) - { - if (authSettings == null || authSettings.Length == 0) - return; - - foreach (string auth in authSettings) - { - // determine which one to use - switch(auth) - { - case "api_key": - headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); - - break; - case "petstore_auth": - - //TODO support oauth - break; - default: - //TODO show warning about security definition not found - break; - } - } - } - - /// - /// Encode string in base64 format. - /// - /// String to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - var textByte = System.Text.Encoding.UTF8.GetBytes(text); - return System.Convert.ToBase64String(textByte); - } - - /// - /// Dynamically cast the object into target type. - /// - /// Object to be casted - /// Target type - /// Casted object - public static Object ConvertType(Object fromObject, Type toObject) { - return Convert.ChangeType(fromObject, toObject); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs deleted file mode 100644 index 7985897b93e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Org.OpenAPITools.Client { - /// - /// API Exception - /// - public class ApiException : Exception { - /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public Object ErrorContent { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public ApiException() {} - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - public ApiException(int errorCode, string message) : base(message) { - this.ErrorCode = errorCode; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - public ApiException(int errorCode, string message, Object errorContent = null) : base(message) { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - } - - } - -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs deleted file mode 100644 index 7546607fa99..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Reflection; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace Org.OpenAPITools.Client -{ - /// - /// Represents a set of configuration settings - /// - public class Configuration - { - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.0"; - - /// - /// Gets or sets the default API client for making HTTP calls. - /// - /// The API client. - public static ApiClient DefaultApiClient = new ApiClient(); - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public static String Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public static String Password { get; set; } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public static Dictionary ApiKey = new Dictionary(); - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - public static Dictionary ApiKeyPrefix = new Dictionary(); - - private static string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public static String TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (String.IsNullOrEmpty(value)) - { - _tempFolderPath = value; - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - Directory.CreateDirectory(value); - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - _tempFolderPath = value; - else - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - - private const string ISO8601_DATETIME_FORMAT = "o"; - - private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public static String DateTimeFormat - { - get - { - return _dateTimeFormat; - } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Returns a string with essential information for debugging. - /// - public static String ToDebugReport() - { - String report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; - report += " OS: " + Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + Assembly - .GetExecutingAssembly() - .GetReferencedAssemblies() - .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n"; - report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0\n"; - - return report; - } - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs deleted file mode 100644 index 648aaeba5b1..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// Describes the result of uploading an image resource - /// - [DataContract] - public class ApiResponse { - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "code")] - public int? Code { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class ApiResponse {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs deleted file mode 100644 index 847279502e2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A category for a pet - /// - [DataContract] - public class Category { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs deleted file mode 100644 index c19511ca3f8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// An order for a pets from the pet store - /// - [DataContract] - public class Order { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets PetId - /// - [DataMember(Name="petId", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "petId")] - public long? PetId { get; set; } - - /// - /// Gets or Sets Quantity - /// - [DataMember(Name="quantity", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "quantity")] - public int? Quantity { get; set; } - - /// - /// Gets or Sets ShipDate - /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "shipDate")] - public DateTime? ShipDate { get; set; } - - /// - /// Order Status - /// - /// Order Status - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or Sets Complete - /// - [DataMember(Name="complete", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "complete")] - public bool? Complete { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs deleted file mode 100644 index 71ec62aa9c8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A pet for sale in the pet store - /// - [DataContract] - public class Pet { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name="category", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "category")] - public Category Category { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or Sets PhotoUrls - /// - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "photoUrls")] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Tags - /// - [DataMember(Name="tags", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "tags")] - public List Tags { get; set; } - - /// - /// pet status in the store - /// - /// pet status in the store - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs deleted file mode 100644 index 6399695a50a..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A tag for a pet - /// - [DataContract] - public class Tag { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs deleted file mode 100644 index c6af059dcdc..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A User who is purchasing from the pet store - /// - [DataContract] - public class User { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Username - /// - [DataMember(Name="username", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or Sets FirstName - /// - [DataMember(Name="firstName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "firstName")] - public string FirstName { get; set; } - - /// - /// Gets or Sets LastName - /// - [DataMember(Name="lastName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "lastName")] - public string LastName { get; set; } - - /// - /// Gets or Sets Email - /// - [DataMember(Name="email", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name="password", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or Sets Phone - /// - [DataMember(Name="phone", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "phone")] - public string Phone { get; set; } - - /// - /// User Status - /// - /// User Status - [DataMember(Name="userStatus", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "userStatus")] - public int? UserStatus { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class User {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config deleted file mode 100644 index 7b9cf186303..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file