[csharp-netcore] Add generichost samples (#11451)

* added generichost samples

* build samples

* added guid

* build samples
This commit is contained in:
devhl-labs 2022-02-05 04:53:26 -05:00 committed by GitHub
parent 194b3fda26
commit fcce44ab9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
844 changed files with 102969 additions and 0 deletions

View File

@ -48,6 +48,12 @@ build_script:
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCoreAndNet47\Org.OpenAPITools.sln
# build C# API client (httpclient)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-httpclient\Org.OpenAPITools.sln
# build C# API client (generichost)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-netstandard2.0\Org.OpenAPITools.sln
# build C# API client (generichost)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0\Org.OpenAPITools.sln
# build C# API client (generichost)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0-nrt\Org.OpenAPITools.sln
# build C# API client (netcore)
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient\Org.OpenAPITools.sln
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCore\Org.OpenAPITools.sln
@ -75,6 +81,12 @@ test_script:
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCoreAndNet47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client (httpclient)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-httpclient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client (generichost)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-netstandard2.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client (generichost)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client (generichost)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-generichost-net6.0-nrt\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
# test c# API client (netcore)
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj

View File

@ -0,0 +1,11 @@
# for csharp-netcore generichost
generatorName: csharp-netcore
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
library: generichost
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
targetFramework: net6.0
nullableReferenceTypes: true

View File

@ -0,0 +1,11 @@
# for csharp-netcore generichost
generatorName: csharp-netcore
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
library: generichost
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
targetFramework: net6.0
nullableReferenceTypes: false

View File

@ -0,0 +1,10 @@
# for csharp-netcore generichost
generatorName: csharp-netcore
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
library: generichost
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
targetFramework: netstandard2.0

View File

@ -0,0 +1,362 @@
## 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

View File

@ -0,0 +1,23 @@
# 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

View File

@ -0,0 +1,193 @@
.gitignore
Org.OpenAPITools.sln
README.md
appveyor.yml
docs/apis/AnotherFakeApi.md
docs/apis/DefaultApi.md
docs/apis/FakeApi.md
docs/apis/FakeClassnameTags123Api.md
docs/apis/PetApi.md
docs/apis/StoreApi.md
docs/apis/UserApi.md
docs/models/AdditionalPropertiesClass.md
docs/models/Animal.md
docs/models/ApiResponse.md
docs/models/Apple.md
docs/models/AppleReq.md
docs/models/ArrayOfArrayOfNumberOnly.md
docs/models/ArrayOfNumberOnly.md
docs/models/ArrayTest.md
docs/models/Banana.md
docs/models/BananaReq.md
docs/models/BasquePig.md
docs/models/Capitalization.md
docs/models/Cat.md
docs/models/CatAllOf.md
docs/models/Category.md
docs/models/ChildCat.md
docs/models/ChildCatAllOf.md
docs/models/ClassModel.md
docs/models/ComplexQuadrilateral.md
docs/models/DanishPig.md
docs/models/DeprecatedObject.md
docs/models/Dog.md
docs/models/DogAllOf.md
docs/models/Drawing.md
docs/models/EnumArrays.md
docs/models/EnumClass.md
docs/models/EnumTest.md
docs/models/EquilateralTriangle.md
docs/models/File.md
docs/models/FileSchemaTestClass.md
docs/models/Foo.md
docs/models/FormatTest.md
docs/models/Fruit.md
docs/models/FruitReq.md
docs/models/GmFruit.md
docs/models/GrandparentAnimal.md
docs/models/HasOnlyReadOnly.md
docs/models/HealthCheckResult.md
docs/models/InlineResponseDefault.md
docs/models/IsoscelesTriangle.md
docs/models/List.md
docs/models/Mammal.md
docs/models/MapTest.md
docs/models/MixedPropertiesAndAdditionalPropertiesClass.md
docs/models/Model200Response.md
docs/models/ModelClient.md
docs/models/Name.md
docs/models/NullableClass.md
docs/models/NullableShape.md
docs/models/NumberOnly.md
docs/models/ObjectWithDeprecatedFields.md
docs/models/Order.md
docs/models/OuterComposite.md
docs/models/OuterEnum.md
docs/models/OuterEnumDefaultValue.md
docs/models/OuterEnumInteger.md
docs/models/OuterEnumIntegerDefaultValue.md
docs/models/ParentPet.md
docs/models/Pet.md
docs/models/Pig.md
docs/models/Quadrilateral.md
docs/models/QuadrilateralInterface.md
docs/models/ReadOnlyFirst.md
docs/models/Return.md
docs/models/ScaleneTriangle.md
docs/models/Shape.md
docs/models/ShapeInterface.md
docs/models/ShapeOrNull.md
docs/models/SimpleQuadrilateral.md
docs/models/SpecialModelName.md
docs/models/Tag.md
docs/models/Triangle.md
docs/models/TriangleInterface.md
docs/models/User.md
docs/models/Whale.md
docs/models/Zebra.md
docs/scripts/git_push.ps1
docs/scripts/git_push.sh
src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
src/Org.OpenAPITools/Api/DefaultApi.cs
src/Org.OpenAPITools/Api/FakeApi.cs
src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs
src/Org.OpenAPITools/Api/PetApi.cs
src/Org.OpenAPITools/Api/StoreApi.cs
src/Org.OpenAPITools/Api/UserApi.cs
src/Org.OpenAPITools/Client/ApiException.cs
src/Org.OpenAPITools/Client/ApiKeyToken.cs
src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs
src/Org.OpenAPITools/Client/ApiResponse`1.cs
src/Org.OpenAPITools/Client/BasicToken.cs
src/Org.OpenAPITools/Client/BearerToken.cs
src/Org.OpenAPITools/Client/ClientUtils.cs
src/Org.OpenAPITools/Client/HostConfiguration.cs
src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs
src/Org.OpenAPITools/Client/HttpSigningToken.cs
src/Org.OpenAPITools/Client/IApi.cs
src/Org.OpenAPITools/Client/OAuthToken.cs
src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
src/Org.OpenAPITools/Client/RateLimitProvider`1.cs
src/Org.OpenAPITools/Client/TokenBase.cs
src/Org.OpenAPITools/Client/TokenContainer`1.cs
src/Org.OpenAPITools/Client/TokenProvider`1.cs
src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs
src/Org.OpenAPITools/Model/Animal.cs
src/Org.OpenAPITools/Model/ApiResponse.cs
src/Org.OpenAPITools/Model/Apple.cs
src/Org.OpenAPITools/Model/AppleReq.cs
src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs
src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs
src/Org.OpenAPITools/Model/ArrayTest.cs
src/Org.OpenAPITools/Model/Banana.cs
src/Org.OpenAPITools/Model/BananaReq.cs
src/Org.OpenAPITools/Model/BasquePig.cs
src/Org.OpenAPITools/Model/Capitalization.cs
src/Org.OpenAPITools/Model/Cat.cs
src/Org.OpenAPITools/Model/CatAllOf.cs
src/Org.OpenAPITools/Model/Category.cs
src/Org.OpenAPITools/Model/ChildCat.cs
src/Org.OpenAPITools/Model/ChildCatAllOf.cs
src/Org.OpenAPITools/Model/ClassModel.cs
src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs
src/Org.OpenAPITools/Model/DanishPig.cs
src/Org.OpenAPITools/Model/DeprecatedObject.cs
src/Org.OpenAPITools/Model/Dog.cs
src/Org.OpenAPITools/Model/DogAllOf.cs
src/Org.OpenAPITools/Model/Drawing.cs
src/Org.OpenAPITools/Model/EnumArrays.cs
src/Org.OpenAPITools/Model/EnumClass.cs
src/Org.OpenAPITools/Model/EnumTest.cs
src/Org.OpenAPITools/Model/EquilateralTriangle.cs
src/Org.OpenAPITools/Model/File.cs
src/Org.OpenAPITools/Model/FileSchemaTestClass.cs
src/Org.OpenAPITools/Model/Foo.cs
src/Org.OpenAPITools/Model/FormatTest.cs
src/Org.OpenAPITools/Model/Fruit.cs
src/Org.OpenAPITools/Model/FruitReq.cs
src/Org.OpenAPITools/Model/GmFruit.cs
src/Org.OpenAPITools/Model/GrandparentAnimal.cs
src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs
src/Org.OpenAPITools/Model/HealthCheckResult.cs
src/Org.OpenAPITools/Model/InlineResponseDefault.cs
src/Org.OpenAPITools/Model/IsoscelesTriangle.cs
src/Org.OpenAPITools/Model/List.cs
src/Org.OpenAPITools/Model/Mammal.cs
src/Org.OpenAPITools/Model/MapTest.cs
src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs
src/Org.OpenAPITools/Model/Model200Response.cs
src/Org.OpenAPITools/Model/ModelClient.cs
src/Org.OpenAPITools/Model/Name.cs
src/Org.OpenAPITools/Model/NullableClass.cs
src/Org.OpenAPITools/Model/NullableShape.cs
src/Org.OpenAPITools/Model/NumberOnly.cs
src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs
src/Org.OpenAPITools/Model/Order.cs
src/Org.OpenAPITools/Model/OuterComposite.cs
src/Org.OpenAPITools/Model/OuterEnum.cs
src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs
src/Org.OpenAPITools/Model/OuterEnumInteger.cs
src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs
src/Org.OpenAPITools/Model/ParentPet.cs
src/Org.OpenAPITools/Model/Pet.cs
src/Org.OpenAPITools/Model/Pig.cs
src/Org.OpenAPITools/Model/Quadrilateral.cs
src/Org.OpenAPITools/Model/QuadrilateralInterface.cs
src/Org.OpenAPITools/Model/ReadOnlyFirst.cs
src/Org.OpenAPITools/Model/Return.cs
src/Org.OpenAPITools/Model/ScaleneTriangle.cs
src/Org.OpenAPITools/Model/Shape.cs
src/Org.OpenAPITools/Model/ShapeInterface.cs
src/Org.OpenAPITools/Model/ShapeOrNull.cs
src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs
src/Org.OpenAPITools/Model/SpecialModelName.cs
src/Org.OpenAPITools/Model/Tag.cs
src/Org.OpenAPITools/Model/Triangle.cs
src/Org.OpenAPITools/Model/TriangleInterface.cs
src/Org.OpenAPITools/Model/User.cs
src/Org.OpenAPITools/Model/Whale.cs
src/Org.OpenAPITools/Model/Zebra.cs
src/Org.OpenAPITools/Org.OpenAPITools.csproj

View File

@ -0,0 +1,27 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,259 @@
# Created with Openapi Generator
<a name="cli"></a>
## Run the following powershell command to generate the library
```ps1
$properties = @(
'apiName=Api',
'targetFramework=net6.0',
'validatable=true',
'nullableReferenceTypes=true',
'hideGenerationTimestamp=true',
'packageVersion=1.0.0',
'packageAuthors=OpenAPI',
'packageCompany=OpenAPI',
'packageCopyright=No Copyright',
'packageDescription=A library generated from a OpenAPI doc',
'packageName=Org.OpenAPITools',
'packageTags=',
'packageTitle=OpenAPI Library'
) -join ","
$global = @(
'apiDocs=true',
'modelDocs=true',
'apiTests=true',
'modelTests=true'
) -join ","
java -jar "<path>/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate `
-g csharp-netcore `
-i <your-swagger-file>.yaml `
-o <your-output-folder> `
--library generichost `
--additional-properties $properties `
--global-property $global `
--git-host "github.com" `
--git-repo-id "GIT_REPO_ID" `
--git-user-id "GIT_USER_ID" `
--release-note "Minor update"
# -t templates
```
<a name="usage"></a>
## Using the library in your project
```cs
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace YourProject
{
public class Program
{
public static async Task Main(string[] args)
{
var host = CreateHostBuilder(args).Build();
var api = host.Services.GetRequiredService<IAnotherFakeApi>();
ApiResponse<ModelClient?> foo = await api.Call123TestSpecialTagsWithHttpInfoAsync("todo");
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
.ConfigureApi((context, options) =>
{
// the type of token here depends on the api security specifications
ApiKeyToken token = new("<your token>");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
options.UseProvider<RateLimitProvider<ApiKeyToken>, ApiKeyToken>();
// the type of token here depends on the api security specifications
ApiKeyToken token = new("<your token>");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
options.UseProvider<RateLimitProvider<ApiKeyToken>, ApiKeyToken>();
// the type of token here depends on the api security specifications
ApiKeyToken token = new("<your token>");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
options.UseProvider<RateLimitProvider<ApiKeyToken>, ApiKeyToken>();
// the type of token here depends on the api security specifications
ApiKeyToken token = new("<your token>");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
options.UseProvider<RateLimitProvider<ApiKeyToken>, ApiKeyToken>();
// the type of token here depends on the api security specifications
ApiKeyToken token = new("<your token>");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
options.UseProvider<RateLimitProvider<ApiKeyToken>, ApiKeyToken>();
// the type of token here depends on the api security specifications
ApiKeyToken token = new("<your token>");
options.AddTokens(token);
// optionally choose the method the tokens will be provided with, default is RateLimitProvider
options.UseProvider<RateLimitProvider<ApiKeyToken>, ApiKeyToken>();
options.ConfigureJsonOptions((jsonOptions) =>
{
// your custom converters if any
});
options.AddApiHttpClients(builder: builder => builder
.AddRetryPolicy(2)
.AddTimeoutPolicy(TimeSpan.FromSeconds(5))
.AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30))
// add whatever middleware you prefer
);
});
}
}
```
<a name="questions"></a>
## Questions
- What about HttpRequest failures and retries?
If supportsRetry is enabled, you can configure Polly in the ConfigureClients method.
- How are tokens used?
Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting.
Other providers can be used with the UseProvider method.
- Does an HttpRequest throw an error when the server response is not Ok?
It depends how you made the request. If the return type is ApiResponse<T> no error will be thrown, though the Content property will be null.
StatusCode and ReasonPhrase will contain information about the error.
If the return type is T, then it will throw. If the return type is TOrDefault, it will return null.
<a name="dependencies"></a>
## Dependencies
- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later
- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later
- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later
- [Polly](https://www.nuget.org/packages/Polly/) - 7.2.2 or later
- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later
<a name="documentation-for-authorization"></a>
## Documentation for Authorization
Authentication schemes defined for the API:
<a name="api_key"></a>
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
<a name="api_key_query"></a>
### api_key_query
- **Type**: API key
- **API key parameter name**: api_key_query
- **Location**: URL query string
<a name="bearer_test"></a>
### bearer_test
- **Type**: Bearer Authentication
<a name="http_basic_test"></a>
### http_basic_test
- **Type**: HTTP basic authentication
<a name="http_signature_test"></a>
### http_signature_test
<a name="petstore_auth"></a>
### 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
## Build
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen
## Api Information
- appName: OpenAPI Petstore
- appVersion: 1.0.0
- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \&quot; \\
## [OpenApi Global properties](https://openapi-generator.tech/docs/globals)
- generateAliasAsModel:
- supportingFiles:
- models: omitted for brevity
- apis: omitted for brevity
- apiDocs: true
- modelDocs: true
- apiTests: true
- modelTests: true
- withXml:
## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore)
- allowUnicodeIdentifiers:
- apiName: Api
- caseInsensitiveResponseHeaders:
- conditionalSerialization: false
- disallowAdditionalPropertiesIfNotPresent: false
- gitHost: github.com
- gitRepoId: GIT_REPO_ID
- gitUserId: GIT_USER_ID
- hideGenerationTimestamp: true
- interfacePrefix: I
- library: generichost
- licenseId:
- modelPropertyNaming:
- netCoreProjectFile: false
- nonPublicApi: false
- nullableReferenceTypes: true
- optionalAssemblyInfo:
- optionalEmitDefaultValues: false
- optionalMethodArgument: true
- optionalProjectFile:
- packageAuthors: OpenAPI
- packageCompany: OpenAPI
- packageCopyright: No Copyright
- packageDescription: A library generated from a OpenAPI doc
- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C}
- packageName: Org.OpenAPITools
- packageTags:
- packageTitle: OpenAPI Library
- packageVersion: 1.0.0
- releaseNote: Minor update
- returnICollection: false
- sortParamsByRequiredFlag:
- sourceFolder: src
- targetFramework: net6.0
- useCollection: false
- useDateTimeOffset: false
- useOneOfDiscriminatorLookup: false
- validatable: true
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.

View File

@ -0,0 +1,9 @@
# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator)
#
image: Visual Studio 2019
clone_depth: 1
build_script:
- dotnet build -c Release
- dotnet test -c Release
after_build:
- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build

View File

@ -0,0 +1,80 @@
# Org.OpenAPITools.Api.AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
<a name="call123testspecialtags"></a>
# **Call123TestSpecialTags**
> ModelClient Call123TestSpecialTags (ModelClient modelClient)
To test special tags
To test special tags and operation ID starting with number
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class Call123TestSpecialTagsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[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)

View File

@ -0,0 +1,73 @@
# Org.OpenAPITools.Api.DefaultApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**FooGet**](DefaultApi.md#fooget) | **GET** /foo |
<a name="fooget"></a>
# **FooGet**
> InlineResponseDefault FooGet ()
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class FooGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
InlineResponseDefault result = apiInstance.FooGet();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**InlineResponseDefault**](InlineResponseDefault.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | response | - |
[[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)

View File

@ -0,0 +1,85 @@
# Org.OpenAPITools.Api.FakeClassnameTags123Api
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testclassname"></a>
# **TestClassname**
> ModelClient TestClassname (ModelClient modelClient)
To test class name in snake case
To test class name in snake case
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class TestClassnameExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key_query", "Bearer");
var apiInstance = new FakeClassnameTags123Api(config);
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test class name in snake case
ModelClient result = apiInstance.TestClassname(modelClient);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
[api_key_query](../README.md#api_key_query)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[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)

View File

@ -0,0 +1,689 @@
# Org.OpenAPITools.Api.PetApi
All URIs are relative to *http://petstore.swagger.io:80/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
[**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
<a name="addpet"></a>
# **AddPet**
> void AddPet (Pet pet)
Add a new pet to the store
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class AddPetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
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 (ApiException e)
{
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **405** | Invalid input | - |
[[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)
<a name="deletepet"></a>
# **DeletePet**
> void DeletePet (long petId, string? apiKey = null)
Deletes a pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class DeletePetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // long | Pet id to delete
var apiKey = "apiKey_example"; // string? | (optional)
try
{
// Deletes a pet
apiInstance.DeletePet(petId, apiKey);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid pet value | - |
[[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)
<a name="findpetsbystatus"></a>
# **FindPetsByStatus**
> List&lt;Pet&gt; FindPetsByStatus (List<string> status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class FindPetsByStatusExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var status = new List<string>(); // List<string> | Status values that need to be considered for filter
try
{
// Finds Pets by status
List<Pet> result = apiInstance.FindPetsByStatus(status);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List&lt;string&gt;**](string.md)| Status values that need to be considered for filter |
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid status value | - |
[[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)
<a name="findpetsbytags"></a>
# **FindPetsByTags**
> List&lt;Pet&gt; FindPetsByTags (List<string> tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class FindPetsByTagsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var tags = new List<string>(); // List<string> | Tags to filter by
try
{
// Finds Pets by tags
List<Pet> result = apiInstance.FindPetsByTags(tags);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;string&gt;**](string.md)| Tags to filter by |
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid tag value | - |
[[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)
<a name="getpetbyid"></a>
# **GetPetById**
> Pet GetPetById (long petId)
Find pet by ID
Returns a single pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class GetPetByIdExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet to return
try
{
// Find pet by ID
Pet result = apiInstance.GetPetById(petId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid ID supplied | - |
| **404** | Pet not found | - |
[[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)
<a name="updatepet"></a>
# **UpdatePet**
> void UpdatePet (Pet pet)
Update an existing pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class UpdatePetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Update an existing pet
apiInstance.UpdatePet(pet);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid ID supplied | - |
| **404** | Pet not found | - |
| **405** | Validation exception | - |
[[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)
<a name="updatepetwithform"></a>
# **UpdatePetWithForm**
> void UpdatePetWithForm (long petId, string? name = null, string? status = null)
Updates a pet in the store with form data
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class UpdatePetWithFormExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // 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 (ApiException e)
{
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **405** | Invalid input | - |
[[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)
<a name="uploadfile"></a>
# **UploadFile**
> ApiResponse UploadFile (long petId, string? additionalMetadata = null, System.IO.Stream? file = null)
uploads an image
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class UploadFileExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet to update
var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional)
var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream? | file to upload (optional)
try
{
// uploads an image
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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?****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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[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)
<a name="uploadfilewithrequiredfile"></a>
# **UploadFileWithRequiredFile**
> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string? additionalMetadata = null)
uploads an image (required)
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class UploadFileWithRequiredFileExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet to update
var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload
var additionalMetadata = "additionalMetadata_example"; // string? | Additional data to pass to server (optional)
try
{
// uploads an image (required)
ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **long**| ID of pet to update |
**requiredFile** | **System.IO.Stream****System.IO.Stream**| file to upload |
**additionalMetadata** | **string?**| Additional data to pass to server | [optional]
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[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)

View File

@ -0,0 +1,298 @@
# Org.OpenAPITools.Api.StoreApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
<a name="deleteorder"></a>
# **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.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class DeleteOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = "orderId_example"; // string | ID of the order that needs to be deleted
try
{
// Delete purchase order by ID
apiInstance.DeleteOrder(orderId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid ID supplied | - |
| **404** | Order not found | - |
[[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)
<a name="getinventory"></a>
# **GetInventory**
> Dictionary&lt;string, int&gt; GetInventory ()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class GetInventoryExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new StoreApi(config);
try
{
// Returns pet inventories by status
Dictionary<string, int> result = apiInstance.GetInventory();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**Dictionary<string, int>**
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[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)
<a name="getorderbyid"></a>
# **GetOrderById**
> Order GetOrderById (long orderId)
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class GetOrderByIdExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = 789L; // long | ID of pet that needs to be fetched
try
{
// Find purchase order by ID
Order result = apiInstance.GetOrderById(orderId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid ID supplied | - |
| **404** | Order not found | - |
[[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)
<a name="placeorder"></a>
# **PlaceOrder**
> Order PlaceOrder (Order order)
Place an order for a pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class PlaceOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
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 (ApiException e)
{
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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**: application/json
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid Order | - |
[[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)

View File

@ -0,0 +1,573 @@
# Org.OpenAPITools.Api.UserApi
All URIs are relative to *http://petstore.swagger.io:80/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
<a name="createuser"></a>
# **CreateUser**
> void CreateUser (User user)
Create user
This can only be done by the logged in user.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class CreateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new User(); // User | Created user object
try
{
// Create user
apiInstance.CreateUser(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[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)
<a name="createuserswitharrayinput"></a>
# **CreateUsersWithArrayInput**
> void CreateUsersWithArrayInput (List<User> user)
Creates list of users with given input array
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class CreateUsersWithArrayInputExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithArrayInput(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**List&lt;User&gt;**](User.md)| List of user object |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[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)
<a name="createuserswithlistinput"></a>
# **CreateUsersWithListInput**
> void CreateUsersWithListInput (List<User> user)
Creates list of users with given input array
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class CreateUsersWithListInputExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithListInput(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**List&lt;User&gt;**](User.md)| List of user object |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[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)
<a name="deleteuser"></a>
# **DeleteUser**
> void DeleteUser (string username)
Delete user
This can only be done by the logged in user.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class DeleteUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = "username_example"; // string | The name that needs to be deleted
try
{
// Delete user
apiInstance.DeleteUser(username);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid username supplied | - |
| **404** | User not found | - |
[[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)
<a name="getuserbyname"></a>
# **GetUserByName**
> User GetUserByName (string username)
Get user by user name
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class GetUserByNameExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
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 (ApiException e)
{
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid username supplied | - |
| **404** | User not found | - |
[[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)
<a name="loginuser"></a>
# **LoginUser**
> string LoginUser (string username, string password)
Logs user into the system
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class LoginUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
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 (ApiException e)
{
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[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)
<a name="logoutuser"></a>
# **LogoutUser**
> void LogoutUser ()
Logs out current logged in user session
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class LogoutUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
try
{
// Logs out current logged in user session
apiInstance.LogoutUser();
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[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)
<a name="updateuser"></a>
# **UpdateUser**
> void UpdateUser (string username, User user)
Updated user
This can only be done by the logged in user.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class UpdateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
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 (ApiException e)
{
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
### 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**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid user supplied | - |
| **404** | User not found | - |
[[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)

View File

@ -0,0 +1,17 @@
# Org.OpenAPITools.Model.AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapProperty** | **Dictionary&lt;string, string&gt;** | | [optional]
**MapOfMapProperty** | **Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;** | | [optional]
**Anytype1** | **Object** | | [optional]
**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional]
**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional]
**MapWithUndeclaredPropertiesAnytype3** | **Dictionary&lt;string, Object&gt;** | | [optional]
**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it&#39;s an empty map. | [optional]
**MapWithUndeclaredPropertiesString** | **Dictionary&lt;string, string&gt;** | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# 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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Apple
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cultivar** | **string** | | [optional]
**Origin** | **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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.AppleReq
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cultivar** | **string** | |
**Mealy** | **bool** | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayArrayNumber** | **List&lt;List&lt;decimal&gt;&gt;** | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayNumber** | **List&lt;decimal&gt;** | | [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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayOfString** | **List&lt;string&gt;** | | [optional]
**ArrayArrayOfInteger** | **List&lt;List&lt;long&gt;&gt;** | | [optional]
**ArrayArrayOfModel** | **List&lt;List&lt;ReadOnlyFirst&gt;&gt;** | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.Banana
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**LengthCm** | **decimal** | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.BananaReq
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**LengthCm** | **decimal** | |
**Sweet** | **bool** | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.BasquePig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,15 @@
# Org.OpenAPITools.Model.Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SmallCamel** | **string** | | [optional]
**CapitalCamel** | **string** | | [optional]
**SmallSnake** | **string** | | [optional]
**CapitalSnake** | **string** | | [optional]
**SCAETHFlowPoints** | **string** | | [optional]
**ATT_NAME** | **string** | Name 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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**Declawed** | **bool** | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.CatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Declawed** | **bool** | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **long** | | [optional]
**Name** | **string** | | [default to "default-name"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ChildCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ChildCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ClassModel
Model for testing model with \"_class\" property
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Class** | **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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ComplexQuadrilateral
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.DanishPig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.DeprecatedObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**Breed** | **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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.DogAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Breed** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.Drawing
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MainShape** | [**Shape**](Shape.md) | | [optional]
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
**Shapes** | [**List&lt;Shape&gt;**](Shape.md) | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustSymbol** | **string** | | [optional]
**ArrayEnum** | **List&lt;string&gt;** | | [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)

View File

@ -0,0 +1,9 @@
# Org.OpenAPITools.Model.EnumClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,18 @@
# Org.OpenAPITools.Model.EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EnumString** | **string** | | [optional]
**EnumStringRequired** | **string** | |
**EnumInteger** | **int** | | [optional]
**EnumIntegerOnly** | **int** | | [optional]
**EnumNumber** | **double** | | [optional]
**OuterEnum** | **OuterEnum** | | [optional]
**OuterEnumInteger** | **OuterEnumInteger** | | [optional]
**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional]
**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.EquilateralTriangle
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.File
Must be named `File` for test.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SourceURI** | **string** | Test capitalization | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**File** | [**File**](File.md) | | [optional]
**Files** | [**List&lt;File&gt;**](File.md) | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.Foo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [default to "bar"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,25 @@
# Org.OpenAPITools.Model.FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Integer** | **int** | | [optional]
**Int32** | **int** | | [optional]
**Int64** | **long** | | [optional]
**Number** | **decimal** | |
**Float** | **float** | | [optional]
**Double** | **double** | | [optional]
**Decimal** | **decimal** | | [optional]
**String** | **string** | | [optional]
**Byte** | **byte[]** | |
**Binary** | **System.IO.Stream** | | [optional]
**Date** | **DateTime** | |
**DateTime** | **DateTime** | | [optional]
**Uuid** | **Guid** | | [optional]
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.Fruit
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Color** | **string** | | [optional]
**Cultivar** | **string** | | [optional]
**Origin** | **string** | | [optional]
**LengthCm** | **decimal** | | [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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.FruitReq
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cultivar** | **string** | |
**Mealy** | **bool** | | [optional]
**LengthCm** | **decimal** | |
**Sweet** | **bool** | | [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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.GmFruit
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Color** | **string** | | [optional]
**Cultivar** | **string** | | [optional]
**Origin** | **string** | | [optional]
**LengthCm** | **decimal** | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.GrandparentAnimal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**PetType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [readonly]
**Foo** | **string** | | [optional] [readonly]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.HealthCheckResult
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**NullableMessage** | [**string?**](string?.md) | | [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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.InlineResponseDefault
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**String** | [**Foo**](Foo.md) | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.IsoscelesTriangle
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.List
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_123List** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.Mammal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**HasBaleen** | **bool** | | [optional]
**HasTeeth** | **bool** | | [optional]
**ClassName** | **string** | |
**Type** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapMapOfString** | **Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;** | | [optional]
**MapOfEnumString** | **Dictionary&lt;string, string&gt;** | | [optional]
**DirectMap** | **Dictionary&lt;string, bool&gt;** | | [optional]
**IndirectMap** | **Dictionary&lt;string, bool&gt;** | | [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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.Model200Response
Model for testing model name starting with number
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **int** | | [optional]
**Class** | **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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.ModelClient
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_Client** | **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)

View File

@ -0,0 +1,14 @@
# Org.OpenAPITools.Model.Name
Model for testing model name same as property name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_Name** | **int** | |
**SnakeCase** | **int** | | [optional] [readonly]
**Property** | **string** | | [optional]
**_123Number** | **int** | | [optional] [readonly]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,21 @@
# Org.OpenAPITools.Model.NullableClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**IntegerProp** | **int?** | | [optional]
**NumberProp** | **decimal?** | | [optional]
**BooleanProp** | **bool?** | | [optional]
**StringProp** | [**string?**](string?.md) | | [optional]
**DateProp** | **DateTime?** | | [optional]
**DatetimeProp** | **DateTime?** | | [optional]
**ArrayNullableProp** | **List&lt;Object&gt;** | | [optional]
**ArrayAndItemsNullableProp** | **List&lt;Object&gt;** | | [optional]
**ArrayItemsNullable** | **List&lt;Object&gt;** | | [optional]
**ObjectNullableProp** | **Dictionary&lt;string, Object&gt;** | | [optional]
**ObjectAndItemsNullableProp** | **Dictionary&lt;string, Object&gt;** | | [optional]
**ObjectItemsNullable** | **Dictionary&lt;string, Object&gt;** | | [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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.NullableShape
The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustNumber** | **decimal** | | [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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.ObjectWithDeprecatedFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | **string** | | [optional]
**Id** | **decimal** | | [optional]
**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
**Bars** | **List&lt;string&gt;** | | [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)

View File

@ -0,0 +1,15 @@
# 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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.OuterComposite
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MyNumber** | **decimal** | | [optional]
**MyString** | **string** | | [optional]
**MyBoolean** | **bool** | | [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)

View File

@ -0,0 +1,9 @@
# Org.OpenAPITools.Model.OuterEnum
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# Org.OpenAPITools.Model.OuterEnumDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# Org.OpenAPITools.Model.OuterEnumInteger
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.ParentPet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**PetType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,15 @@
# Org.OpenAPITools.Model.Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **long** | | [optional]
**Category** | [**Category**](Category.md) | | [optional]
**Name** | **string** | |
**PhotoUrls** | **List&lt;string&gt;** | |
**Tags** | [**List&lt;Tag&gt;**](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)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.Pig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Quadrilateral
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.QuadrilateralInterface
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [readonly]
**Baz** | **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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Return
Model for testing reserved words
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_Return** | **int** | | [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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.ScaleneTriangle
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Shape
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.ShapeInterface
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.ShapeOrNull
The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.SimpleQuadrilateral
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.SpecialModelName
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SpecialPropertyName** | **long** | | [optional]
**_SpecialModelName** | **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)

View File

@ -0,0 +1,11 @@
# 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)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Triangle
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.TriangleInterface
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,21 @@
# 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]
**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the &#39;null&#39; value. | [optional]
**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the &#39;null&#39; value. | [optional]
**AnyTypeProp** | **Object** | test code generation for any type Here the &#39;type&#39; attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional]
**AnyTypePropNullable** | **Object** | test code generation for any type Here the &#39;type&#39; attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The &#39;nullable&#39; attribute does not change the allowed values. | [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)

View File

@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.Whale
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**HasBaleen** | **bool** | | [optional]
**HasTeeth** | **bool** | | [optional]
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.Zebra
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Type** | **string** | | [optional]
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,75 @@
param(
[Parameter()][Alias("g")][String]$GitHost = "github.com",
[Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID",
[Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID",
[Parameter()][Alias("m")][string]$Message = "Minor update",
[Parameter()][Alias("h")][switch]$Help
)
function Publish-ToGitHost{
if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){
# it seems unlikely that we would want our git commit message to be the default, so lets prompt the user
$Message = Read-Host -Prompt "Please provide a commit message or press enter"
$Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message }
}
git init
git add .
git commit -am "${Message}"
$branchName=$(git rev-parse --abbrev-ref HEAD)
$gitRemote=$(git remote)
if([string]::IsNullOrWhiteSpace($gitRemote)){
git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git
}
Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git"
git pull origin $branchName --ff-only
if ($LastExitCode -ne 0){
if (${GitHost} -eq "github.com"){
Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI."
gh auth login --hostname github.com --web
gh repo create $GitRepoId --private
# sleep 2 seconds to ensure git finishes creation of the repo
Start-Sleep -Seconds 2
}
else{
throw "There was an issue pulling the origin branch. The remote repository may not exist yet."
}
}
Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git"
git push origin $branchName
}
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 3.0
if ($Help){
Write-Output "
This script will initialize a git repository, then add and commit all files.
The local repository will then be pushed to your prefered git provider.
If the remote repository does not exist yet and you are using GitHub,
the repository will be created for you provided you have the GitHub CLI installed.
Parameters:
-g | -GitHost -> ex: github.com
-m | -Message -> the git commit message
-r | -GitRepoId -> the name of the repository
-u | -GitUserId -> your user id
"
return
}
$rootPath=Resolve-Path -Path $PSScriptRoot/../..
Push-Location $rootPath
try {
Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message
}
finally{
Pop-Location
}

View File

@ -0,0 +1,49 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=${1:-GIT_USER_ID}
git_repo_id=${2:-GIT_REPO_ID}
release_note=${3:-Minor update}
git_host=${4:-github.com}
starting_directory=$(pwd)
script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
cd $script_root
cd ../..
if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then
# it seems unlikely that we would want our git commit message to be the default, so lets prompt the user
echo "Please provide a commit message or press enter"
read user_input
release_note=$user_input
if [ "$release_note" = "" ]; then
release_note="no message provided"
fi
fi
git init
git add .
git commit -am "$release_note"
branch_name=$(git rev-parse --abbrev-ref HEAD)
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git"
git pull origin $branch_name --ff-only
echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin $branch_name
cd $starting_directory

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
/* *********************************************************************************
* Follow these manual steps to construct tests.
* This file will not be overwritten.
* *********************************************************************************
* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly.
* Take care not to commit credentials to any repository.
*
* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients.
* To mock the client, use the generic AddApiHttpClients.
* To mock the server, change the client's BaseAddress.
*
* 3. Locate the test you want below
* - remove the skip property from the Fact attribute
* - set the value of any variables if necessary
*
* 4. Run the tests and ensure they work.
*
*/
namespace Org.OpenAPITools.Test.Api
{
/// <summary>
/// Class for testing AnotherFakeApi
/// </summary>
public sealed class AnotherFakeApiTests : ApiTestsBase
{
private readonly IAnotherFakeApi _instance;
public AnotherFakeApiTests(): base(Array.Empty<string>())
{
_instance = _host.Services.GetRequiredService<IAnotherFakeApi>();
}
/// <summary>
/// Test Call123TestSpecialTags
/// </summary>
[Fact (Skip = "not implemented")]
public async Task Call123TestSpecialTagsAsyncTest()
{
ModelClient modelClient = default;
var response = await _instance.Call123TestSpecialTagsAsync(modelClient);
Assert.IsType<ModelClient>(response);
}
}
}

View File

@ -0,0 +1,71 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using Microsoft.Extensions.Hosting;
using Org.OpenAPITools.Client;
/* *********************************************************************************
* Follow these manual steps to construct tests.
* This file will not be overwritten.
* *********************************************************************************
* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly.
* Take care not to commit credentials to any repository.
*
* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients.
* To mock the client, use the generic AddApiHttpClients.
* To mock the server, change the client's BaseAddress.
*
* 3. Locate the test you want below
* - remove the skip property from the Fact attribute
* - set the value of any variables if necessary
*
* 4. Run the tests and ensure they work.
*
*/
namespace Org.OpenAPITools.Test.Api
{
/// <summary>
/// Base class for API tests
/// </summary>
public class ApiTestsBase
{
protected readonly IHost _host;
public ApiTestsBase(string[] args)
{
_host = CreateHostBuilder(args).Build();
}
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
.ConfigureApi((context, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration["<token>"], timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken(context.Configuration["<token>"], timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken(context.Configuration["<username>"], context.Configuration["<password>"], timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken(context.Configuration["<token>"], timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
});
}
}

View File

@ -0,0 +1,64 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
using Microsoft.Extensions.DependencyInjection;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
/* *********************************************************************************
* Follow these manual steps to construct tests.
* This file will not be overwritten.
* *********************************************************************************
* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly.
* Take care not to commit credentials to any repository.
*
* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients.
* To mock the client, use the generic AddApiHttpClients.
* To mock the server, change the client's BaseAddress.
*
* 3. Locate the test you want below
* - remove the skip property from the Fact attribute
* - set the value of any variables if necessary
*
* 4. Run the tests and ensure they work.
*
*/
namespace Org.OpenAPITools.Test.Api
{
/// <summary>
/// Class for testing DefaultApi
/// </summary>
public sealed class DefaultApiTests : ApiTestsBase
{
private readonly IDefaultApi _instance;
public DefaultApiTests(): base(Array.Empty<string>())
{
_instance = _host.Services.GetRequiredService<IDefaultApi>();
}
/// <summary>
/// Test FooGet
/// </summary>
[Fact (Skip = "not implemented")]
public async Task FooGetAsyncTest()
{
var response = await _instance.FooGetAsync();
Assert.IsType<InlineResponseDefault>(response);
}
}
}

View File

@ -0,0 +1,230 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Security.Cryptography;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Api;
using Xunit;
namespace Org.OpenAPITools.Test.Api
{
/// <summary>
/// Tests the dependency injection.
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})
.Build();
/// <summary>
/// Test dependency injection when using the configure method
/// </summary>
[Fact]
public void ConfigureApiWithAClientTest()
{
var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
/// <summary>
/// Test dependency injection when using the configure method
/// </summary>
[Fact]
public void ConfigureApiWithoutAClientTest()
{
var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
/// <summary>
/// Test dependency injection when using the add method
/// </summary>
[Fact]
public void AddApiWithAClientTest()
{
var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingAddWithAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingAddWithAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
/// <summary>
/// Test dependency injection when using the add method
/// </summary>
[Fact]
public void AddApiWithoutAClientTest()
{
var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
}
}

Some files were not shown because too many files have changed in this diff Show More