From e5b9f723f5e6eb6092758be4df3c304ae2a5354e Mon Sep 17 00:00:00 2001 From: Scott Phillips Date: Tue, 4 Jun 2024 07:16:25 -0400 Subject: [PATCH] build: Connect Typescript/CSharp SDK (#1644) Co-authored-by: fundthmcalculus --- .../workflows/build-connect-typescript.yaml | 31 + connect/csharp/.gitignore | 362 ++++++ connect/csharp/.openapi-generator-ignore | 23 + connect/csharp/.openapi-generator/FILES | 92 ++ connect/csharp/.openapi-generator/VERSION | 1 + connect/csharp/Org.OpenAPITools.sln | 27 + connect/csharp/README.md | 161 +++ connect/csharp/api/openapi.yaml | 780 ++++++++++++ connect/csharp/appveyor.yml | 9 + connect/csharp/docs/CancelSessionResponse.md | 10 + connect/csharp/docs/CreateSessionRequest.md | 10 + connect/csharp/docs/CreateSessionResponse.md | 10 + .../csharp/docs/DebugIdvProviderSelection.md | 9 + connect/csharp/docs/FailureMessage.md | 10 + connect/csharp/docs/GetSessionResponseV1.md | 10 + connect/csharp/docs/GovernmentIDOptions.md | 17 + connect/csharp/docs/IDVSessionState.md | 9 + connect/csharp/docs/ListSessionsRequest.md | 13 + connect/csharp/docs/ListSessionsResponseV1.md | 10 + .../csharp/docs/NormalizedGovernmentIdData.md | 17 + connect/csharp/docs/OrderDirection.md | 9 + connect/csharp/docs/RequestedVerification.md | 11 + connect/csharp/docs/Session.md | 17 + connect/csharp/docs/SessionApi.md | 395 +++++++ connect/csharp/docs/SessionFailCode.md | 9 + connect/csharp/docs/SessionOrdering.md | 9 + connect/csharp/docs/ValidationResult.md | 11 + connect/csharp/docs/Verification.md | 17 + connect/csharp/docs/VerificationFailCode.md | 9 + connect/csharp/docs/VerificationState.md | 9 + connect/csharp/docs/VerificationType.md | 9 + connect/csharp/git_push.sh | 57 + .../Api/SessionApiTests.cs | 109 ++ .../Model/CancelSessionResponseTests.cs | 66 ++ .../Model/CreateSessionRequestTests.cs | 66 ++ .../Model/CreateSessionResponseTests.cs | 66 ++ .../Model/DebugIdvProviderSelectionTests.cs | 57 + .../Model/FailureMessageTests.cs | 66 ++ .../Model/GetSessionResponseV1Tests.cs | 66 ++ .../Model/GovernmentIDOptionsTests.cs | 129 ++ .../Model/IDVSessionStateTests.cs | 57 + .../Model/ListSessionsRequestTests.cs | 93 ++ .../Model/ListSessionsResponseV1Tests.cs | 66 ++ .../Model/NormalizedGovernmentIdDataTests.cs | 129 ++ .../Model/OrderDirectionTests.cs | 57 + .../Model/RequestedVerificationTests.cs | 75 ++ .../Model/SessionFailCodeTests.cs | 57 + .../Model/SessionOrderingTests.cs | 57 + .../Model/SessionTests.cs | 129 ++ .../Model/ValidationResultTests.cs | 75 ++ .../Model/VerificationFailCodeTests.cs | 57 + .../Model/VerificationStateTests.cs | 57 + .../Model/VerificationTests.cs | 129 ++ .../Model/VerificationTypeTests.cs | 57 + .../Org.OpenAPITools.Test.csproj | 20 + .../src/Org.OpenAPITools/Api/SessionApi.cs | 1043 +++++++++++++++++ .../src/Org.OpenAPITools/Client/ApiClient.cs | 833 +++++++++++++ .../Org.OpenAPITools/Client/ApiException.cs | 68 ++ .../Org.OpenAPITools/Client/ApiResponse.cs | 166 +++ .../Org.OpenAPITools/Client/ClientUtils.cs | 247 ++++ .../Org.OpenAPITools/Client/Configuration.cs | 624 ++++++++++ .../Client/ExceptionFactory.cs | 22 + .../Client/GlobalConfiguration.cs | 67 ++ .../src/Org.OpenAPITools/Client/HttpMethod.cs | 33 + .../Org.OpenAPITools/Client/IApiAccessor.cs | 37 + .../Client/IAsynchronousClient.cs | 100 ++ .../Client/IReadableConfiguration.cs | 141 +++ .../Client/ISynchronousClient.cs | 93 ++ .../src/Org.OpenAPITools/Client/Multimap.cs | 295 +++++ .../Client/OpenAPIDateConverter.cs | 29 + .../Org.OpenAPITools/Client/RequestOptions.cs | 84 ++ .../Client/RetryConfiguration.cs | 31 + .../Model/AbstractOpenAPISchema.cs | 76 ++ .../Model/CancelSessionResponse.cs | 82 ++ .../Model/CreateSessionRequest.cs | 82 ++ .../Model/CreateSessionResponse.cs | 82 ++ .../Model/DebugIdvProviderSelection.cs | 71 ++ .../Org.OpenAPITools/Model/FailureMessage.cs | 82 ++ .../Model/GetSessionResponseV1.cs | 82 ++ .../Model/GovernmentIDOptions.cs | 145 +++ .../Org.OpenAPITools/Model/IDVSessionState.cs | 71 ++ .../Model/ListSessionsRequest.cs | 138 +++ .../Model/ListSessionsResponseV1.cs | 82 ++ .../Model/NormalizedGovernmentIdData.cs | 145 +++ .../Org.OpenAPITools/Model/OrderDirection.cs | 47 + .../Model/RequestedVerification.cs | 91 ++ .../src/Org.OpenAPITools/Model/Session.cs | 145 +++ .../Org.OpenAPITools/Model/SessionFailCode.cs | 77 ++ .../Org.OpenAPITools/Model/SessionOrdering.cs | 53 + .../Model/ValidationResult.cs | 97 ++ .../Org.OpenAPITools/Model/Verification.cs | 145 +++ .../Model/VerificationFailCode.cs | 65 + .../Model/VerificationState.cs | 53 + .../Model/VerificationType.cs | 41 + .../Org.OpenAPITools/Org.OpenAPITools.csproj | 37 + connect/typescript/.openapi-generator-ignore | 23 + connect/typescript/.openapi-generator/FILES | 27 + connect/typescript/.openapi-generator/VERSION | 1 + connect/typescript/apis/SessionApi.ts | 257 ++++ connect/typescript/apis/index.ts | 3 + connect/typescript/index.ts | 5 + .../models/CancelSessionResponse.ts | 67 ++ .../typescript/models/CreateSessionRequest.ts | 67 ++ .../models/CreateSessionResponse.ts | 67 ++ .../models/DebugIdvProviderSelection.ts | 53 + connect/typescript/models/FailureMessage.ts | 60 + .../typescript/models/GetSessionResponseV1.ts | 67 ++ .../typescript/models/GovernmentIDOptions.ts | 116 ++ connect/typescript/models/IDVSessionState.ts | 53 + .../typescript/models/ListSessionsRequest.ts | 99 ++ .../models/ListSessionsResponseV1.ts | 67 ++ .../models/NormalizedGovernmentIdData.ts | 116 ++ connect/typescript/models/OrderDirection.ts | 49 + .../models/RequestedVerification.ts | 81 ++ connect/typescript/models/Session.ts | 135 +++ connect/typescript/models/SessionFailCode.ts | 54 + connect/typescript/models/SessionOrdering.ts | 50 + connect/typescript/models/ValidationResult.ts | 67 ++ connect/typescript/models/Verification.ts | 147 +++ .../typescript/models/VerificationFailCode.ts | 52 + .../typescript/models/VerificationState.ts | 50 + connect/typescript/models/VerificationType.ts | 48 + connect/typescript/models/index.ts | 23 + connect/typescript/runtime.ts | 426 +++++++ devops/make-swagger.ps1 | 110 ++ 125 files changed, 12255 insertions(+) create mode 100644 .github/workflows/build-connect-typescript.yaml create mode 100644 connect/csharp/.gitignore create mode 100644 connect/csharp/.openapi-generator-ignore create mode 100644 connect/csharp/.openapi-generator/FILES create mode 100644 connect/csharp/.openapi-generator/VERSION create mode 100644 connect/csharp/Org.OpenAPITools.sln create mode 100644 connect/csharp/README.md create mode 100644 connect/csharp/api/openapi.yaml create mode 100644 connect/csharp/appveyor.yml create mode 100644 connect/csharp/docs/CancelSessionResponse.md create mode 100644 connect/csharp/docs/CreateSessionRequest.md create mode 100644 connect/csharp/docs/CreateSessionResponse.md create mode 100644 connect/csharp/docs/DebugIdvProviderSelection.md create mode 100644 connect/csharp/docs/FailureMessage.md create mode 100644 connect/csharp/docs/GetSessionResponseV1.md create mode 100644 connect/csharp/docs/GovernmentIDOptions.md create mode 100644 connect/csharp/docs/IDVSessionState.md create mode 100644 connect/csharp/docs/ListSessionsRequest.md create mode 100644 connect/csharp/docs/ListSessionsResponseV1.md create mode 100644 connect/csharp/docs/NormalizedGovernmentIdData.md create mode 100644 connect/csharp/docs/OrderDirection.md create mode 100644 connect/csharp/docs/RequestedVerification.md create mode 100644 connect/csharp/docs/Session.md create mode 100644 connect/csharp/docs/SessionApi.md create mode 100644 connect/csharp/docs/SessionFailCode.md create mode 100644 connect/csharp/docs/SessionOrdering.md create mode 100644 connect/csharp/docs/ValidationResult.md create mode 100644 connect/csharp/docs/Verification.md create mode 100644 connect/csharp/docs/VerificationFailCode.md create mode 100644 connect/csharp/docs/VerificationState.md create mode 100644 connect/csharp/docs/VerificationType.md create mode 100644 connect/csharp/git_push.sh create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Api/SessionApiTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/CancelSessionResponseTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionRequestTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionResponseTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/DebugIdvProviderSelectionTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/FailureMessageTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/GetSessionResponseV1Tests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/GovernmentIDOptionsTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/IDVSessionStateTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsRequestTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsResponseV1Tests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/NormalizedGovernmentIdDataTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/OrderDirectionTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/RequestedVerificationTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/SessionFailCodeTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/SessionOrderingTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/SessionTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/ValidationResultTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationFailCodeTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationStateTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTypeTests.cs create mode 100644 connect/csharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj create mode 100644 connect/csharp/src/Org.OpenAPITools/Api/SessionApi.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/ApiClient.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/ApiException.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/ApiResponse.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/ClientUtils.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/Configuration.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/ExceptionFactory.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/GlobalConfiguration.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/HttpMethod.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/IApiAccessor.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/IAsynchronousClient.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/ISynchronousClient.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/Multimap.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/RequestOptions.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Client/RetryConfiguration.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/CancelSessionResponse.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/CreateSessionRequest.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/CreateSessionResponse.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/DebugIdvProviderSelection.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/FailureMessage.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/GetSessionResponseV1.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/GovernmentIDOptions.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/IDVSessionState.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/ListSessionsRequest.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/ListSessionsResponseV1.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/NormalizedGovernmentIdData.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/OrderDirection.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/RequestedVerification.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/Session.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/SessionFailCode.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/SessionOrdering.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/ValidationResult.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/Verification.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/VerificationFailCode.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/VerificationState.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Model/VerificationType.cs create mode 100644 connect/csharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj create mode 100644 connect/typescript/.openapi-generator-ignore create mode 100644 connect/typescript/.openapi-generator/FILES create mode 100644 connect/typescript/.openapi-generator/VERSION create mode 100644 connect/typescript/apis/SessionApi.ts create mode 100644 connect/typescript/apis/index.ts create mode 100644 connect/typescript/index.ts create mode 100644 connect/typescript/models/CancelSessionResponse.ts create mode 100644 connect/typescript/models/CreateSessionRequest.ts create mode 100644 connect/typescript/models/CreateSessionResponse.ts create mode 100644 connect/typescript/models/DebugIdvProviderSelection.ts create mode 100644 connect/typescript/models/FailureMessage.ts create mode 100644 connect/typescript/models/GetSessionResponseV1.ts create mode 100644 connect/typescript/models/GovernmentIDOptions.ts create mode 100644 connect/typescript/models/IDVSessionState.ts create mode 100644 connect/typescript/models/ListSessionsRequest.ts create mode 100644 connect/typescript/models/ListSessionsResponseV1.ts create mode 100644 connect/typescript/models/NormalizedGovernmentIdData.ts create mode 100644 connect/typescript/models/OrderDirection.ts create mode 100644 connect/typescript/models/RequestedVerification.ts create mode 100644 connect/typescript/models/Session.ts create mode 100644 connect/typescript/models/SessionFailCode.ts create mode 100644 connect/typescript/models/SessionOrdering.ts create mode 100644 connect/typescript/models/ValidationResult.ts create mode 100644 connect/typescript/models/Verification.ts create mode 100644 connect/typescript/models/VerificationFailCode.ts create mode 100644 connect/typescript/models/VerificationState.ts create mode 100644 connect/typescript/models/VerificationType.ts create mode 100644 connect/typescript/models/index.ts create mode 100644 connect/typescript/runtime.ts create mode 100644 devops/make-swagger.ps1 diff --git a/.github/workflows/build-connect-typescript.yaml b/.github/workflows/build-connect-typescript.yaml new file mode 100644 index 000000000..8cc6b0587 --- /dev/null +++ b/.github/workflows/build-connect-typescript.yaml @@ -0,0 +1,31 @@ +name: "Connect SDK Build" + +on: + workflow_call: + workflow_dispatch: + pull_request: + paths: + - 'connect/swagger**' + - '.github/workflows/*typescript*' + - "devops/**" + +jobs: + build_test: + strategy: + matrix: + swagger_json: ['connect/swagger_api.json'] + language: [['typescript-fetch', 'connect/typescript'], ['csharp', 'connect/csharp']] + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + name: Setup Node v20 + with: + node-version: 20 + cache: 'npm' + - name: Build Connect TypeScript SDK + run: ./devops/make-swagger.ps1 -language ${{ matrix.language[0] }} -swaggerFile ${{ matrix.swagger_json }} -outputFolder ${{ matrix.language[1] }} + shell: pwsh + + - uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/connect/csharp/.gitignore b/connect/csharp/.gitignore new file mode 100644 index 000000000..1ee53850b --- /dev/null +++ b/connect/csharp/.gitignore @@ -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 diff --git a/connect/csharp/.openapi-generator-ignore b/connect/csharp/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/connect/csharp/.openapi-generator-ignore @@ -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 diff --git a/connect/csharp/.openapi-generator/FILES b/connect/csharp/.openapi-generator/FILES new file mode 100644 index 000000000..d2f55f578 --- /dev/null +++ b/connect/csharp/.openapi-generator/FILES @@ -0,0 +1,92 @@ +.gitignore +.openapi-generator-ignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/CancelSessionResponse.md +docs/CreateSessionRequest.md +docs/CreateSessionResponse.md +docs/DebugIdvProviderSelection.md +docs/FailureMessage.md +docs/GetSessionResponseV1.md +docs/GovernmentIDOptions.md +docs/IDVSessionState.md +docs/ListSessionsRequest.md +docs/ListSessionsResponseV1.md +docs/NormalizedGovernmentIdData.md +docs/OrderDirection.md +docs/RequestedVerification.md +docs/Session.md +docs/SessionApi.md +docs/SessionFailCode.md +docs/SessionOrdering.md +docs/ValidationResult.md +docs/Verification.md +docs/VerificationFailCode.md +docs/VerificationState.md +docs/VerificationType.md +git_push.sh +src/Org.OpenAPITools.Test/Api/SessionApiTests.cs +src/Org.OpenAPITools.Test/Model/CancelSessionResponseTests.cs +src/Org.OpenAPITools.Test/Model/CreateSessionRequestTests.cs +src/Org.OpenAPITools.Test/Model/CreateSessionResponseTests.cs +src/Org.OpenAPITools.Test/Model/DebugIdvProviderSelectionTests.cs +src/Org.OpenAPITools.Test/Model/FailureMessageTests.cs +src/Org.OpenAPITools.Test/Model/GetSessionResponseV1Tests.cs +src/Org.OpenAPITools.Test/Model/GovernmentIDOptionsTests.cs +src/Org.OpenAPITools.Test/Model/IDVSessionStateTests.cs +src/Org.OpenAPITools.Test/Model/ListSessionsRequestTests.cs +src/Org.OpenAPITools.Test/Model/ListSessionsResponseV1Tests.cs +src/Org.OpenAPITools.Test/Model/NormalizedGovernmentIdDataTests.cs +src/Org.OpenAPITools.Test/Model/OrderDirectionTests.cs +src/Org.OpenAPITools.Test/Model/RequestedVerificationTests.cs +src/Org.OpenAPITools.Test/Model/SessionFailCodeTests.cs +src/Org.OpenAPITools.Test/Model/SessionOrderingTests.cs +src/Org.OpenAPITools.Test/Model/SessionTests.cs +src/Org.OpenAPITools.Test/Model/ValidationResultTests.cs +src/Org.OpenAPITools.Test/Model/VerificationFailCodeTests.cs +src/Org.OpenAPITools.Test/Model/VerificationStateTests.cs +src/Org.OpenAPITools.Test/Model/VerificationTests.cs +src/Org.OpenAPITools.Test/Model/VerificationTypeTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools/Api/SessionApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpMethod.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Client/RetryConfiguration.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/CancelSessionResponse.cs +src/Org.OpenAPITools/Model/CreateSessionRequest.cs +src/Org.OpenAPITools/Model/CreateSessionResponse.cs +src/Org.OpenAPITools/Model/DebugIdvProviderSelection.cs +src/Org.OpenAPITools/Model/FailureMessage.cs +src/Org.OpenAPITools/Model/GetSessionResponseV1.cs +src/Org.OpenAPITools/Model/GovernmentIDOptions.cs +src/Org.OpenAPITools/Model/IDVSessionState.cs +src/Org.OpenAPITools/Model/ListSessionsRequest.cs +src/Org.OpenAPITools/Model/ListSessionsResponseV1.cs +src/Org.OpenAPITools/Model/NormalizedGovernmentIdData.cs +src/Org.OpenAPITools/Model/OrderDirection.cs +src/Org.OpenAPITools/Model/RequestedVerification.cs +src/Org.OpenAPITools/Model/Session.cs +src/Org.OpenAPITools/Model/SessionFailCode.cs +src/Org.OpenAPITools/Model/SessionOrdering.cs +src/Org.OpenAPITools/Model/ValidationResult.cs +src/Org.OpenAPITools/Model/Verification.cs +src/Org.OpenAPITools/Model/VerificationFailCode.cs +src/Org.OpenAPITools/Model/VerificationState.cs +src/Org.OpenAPITools/Model/VerificationType.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/connect/csharp/.openapi-generator/VERSION b/connect/csharp/.openapi-generator/VERSION new file mode 100644 index 000000000..7e7b8b9bc --- /dev/null +++ b/connect/csharp/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.7.0-SNAPSHOT diff --git a/connect/csharp/Org.OpenAPITools.sln b/connect/csharp/Org.OpenAPITools.sln new file mode 100644 index 000000000..f0f1b6eac --- /dev/null +++ b/connect/csharp/Org.OpenAPITools.sln @@ -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", "{9EF5FCC1-1BD7-4EC2-BCB6-469A84F66A9B}" +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 + {9EF5FCC1-1BD7-4EC2-BCB6-469A84F66A9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EF5FCC1-1BD7-4EC2-BCB6-469A84F66A9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EF5FCC1-1BD7-4EC2-BCB6-469A84F66A9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EF5FCC1-1BD7-4EC2-BCB6-469A84F66A9B}.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 \ No newline at end of file diff --git a/connect/csharp/README.md b/connect/csharp/README.md new file mode 100644 index 000000000..8dbff15fe --- /dev/null +++ b/connect/csharp/README.md @@ -0,0 +1,161 @@ +# Org.OpenAPITools - the C# library for the Connect API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: v1 +- SDK version: 1.0.0 +- Generator version: 7.7.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + + +## Frameworks supported + + +## Dependencies + +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +Install-Package System.ComponentModel.Annotations +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +``` + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "https://connect-api.trinsic.id"; + // Configure Bearer token for authorization: Bearer + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new SessionApi(config); + var trinsicAuthorization = "\"Bearer \""; // string | Bearer token. Can be left empty on anonymous endpoints (default to "Bearer ") + var sessionId = "sessionId_example"; // string? | (optional) + + try + { + CancelSessionResponse result = apiInstance.SessionCancelSession(trinsicAuthorization, sessionId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SessionApi.SessionCancelSession: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *https://connect-api.trinsic.id* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SessionApi* | [**SessionCancelSession**](docs/SessionApi.md#sessioncancelsession) | **POST** /v1/sessions/cancel | +*SessionApi* | [**SessionCreateSession**](docs/SessionApi.md#sessioncreatesession) | **POST** /v1/sessions | +*SessionApi* | [**SessionGetSession**](docs/SessionApi.md#sessiongetsession) | **GET** /v1/sessions/get | +*SessionApi* | [**SessionListSessions**](docs/SessionApi.md#sessionlistsessions) | **POST** /v1/sessions/list | + + + +## Documentation for Models + + - [Model.CancelSessionResponse](docs/CancelSessionResponse.md) + - [Model.CreateSessionRequest](docs/CreateSessionRequest.md) + - [Model.CreateSessionResponse](docs/CreateSessionResponse.md) + - [Model.DebugIdvProviderSelection](docs/DebugIdvProviderSelection.md) + - [Model.FailureMessage](docs/FailureMessage.md) + - [Model.GetSessionResponseV1](docs/GetSessionResponseV1.md) + - [Model.GovernmentIDOptions](docs/GovernmentIDOptions.md) + - [Model.IDVSessionState](docs/IDVSessionState.md) + - [Model.ListSessionsRequest](docs/ListSessionsRequest.md) + - [Model.ListSessionsResponseV1](docs/ListSessionsResponseV1.md) + - [Model.NormalizedGovernmentIdData](docs/NormalizedGovernmentIdData.md) + - [Model.OrderDirection](docs/OrderDirection.md) + - [Model.RequestedVerification](docs/RequestedVerification.md) + - [Model.Session](docs/Session.md) + - [Model.SessionFailCode](docs/SessionFailCode.md) + - [Model.SessionOrdering](docs/SessionOrdering.md) + - [Model.ValidationResult](docs/ValidationResult.md) + - [Model.Verification](docs/Verification.md) + - [Model.VerificationFailCode](docs/VerificationFailCode.md) + - [Model.VerificationState](docs/VerificationState.md) + - [Model.VerificationType](docs/VerificationType.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### Bearer + +- **Type**: Bearer Authentication + diff --git a/connect/csharp/api/openapi.yaml b/connect/csharp/api/openapi.yaml new file mode 100644 index 000000000..1bd51b85d --- /dev/null +++ b/connect/csharp/api/openapi.yaml @@ -0,0 +1,780 @@ +openapi: 3.0.1 +info: + title: Connect API + version: v1 + x-swaggerexclude: External +servers: +- description: Production server + url: https://connect-api.trinsic.id +- description: Development server + url: https://dev-connect-api.trinsic.id +- description: Staging server + url: https://staging-connect-api.trinsic.id +security: +- Bearer: [] +paths: + /v1/sessions/list: + post: + operationId: Session.ListSessions + parameters: + - description: Bearer token. Can be left empty on anonymous endpoints + explode: false + in: header + name: TrinsicAuthorization + required: true + schema: + default: 'Bearer ' + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListSessionsRequest' + text/json: + schema: + $ref: '#/components/schemas/ListSessionsRequest' + application/*+json: + schema: + $ref: '#/components/schemas/ListSessionsRequest' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/ListSessionsResponseV1' + application/json: + schema: + $ref: '#/components/schemas/ListSessionsResponseV1' + text/json: + schema: + $ref: '#/components/schemas/ListSessionsResponseV1' + description: OK + "400": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ValidationResult' + type: array + description: Validation Failed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/FailureMessage' + description: Unauthorized + "403": + description: Forbidden + "500": + description: Internal Server Error + tags: + - Session + /v1/sessions/get: + get: + operationId: Session.GetSession + parameters: + - explode: true + in: query + name: sessionId + required: false + schema: + maxLength: 100 + minLength: 5 + type: string + style: form + - description: Bearer token. Can be left empty on anonymous endpoints + explode: false + in: header + name: TrinsicAuthorization + required: true + schema: + default: 'Bearer ' + type: string + style: simple + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/GetSessionResponseV1' + application/json: + schema: + $ref: '#/components/schemas/GetSessionResponseV1' + text/json: + schema: + $ref: '#/components/schemas/GetSessionResponseV1' + description: OK + "400": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ValidationResult' + type: array + description: Validation Failed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/FailureMessage' + description: Unauthorized + "403": + description: Forbidden + "500": + description: Internal Server Error + tags: + - Session + /v1/sessions: + post: + operationId: Session.CreateSession + parameters: + - description: Bearer token. Can be left empty on anonymous endpoints + explode: false + in: header + name: TrinsicAuthorization + required: true + schema: + default: 'Bearer ' + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSessionRequest' + text/json: + schema: + $ref: '#/components/schemas/CreateSessionRequest' + application/*+json: + schema: + $ref: '#/components/schemas/CreateSessionRequest' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/CreateSessionResponse' + application/json: + schema: + $ref: '#/components/schemas/CreateSessionResponse' + text/json: + schema: + $ref: '#/components/schemas/CreateSessionResponse' + description: OK + "400": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ValidationResult' + type: array + description: Validation Failed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/FailureMessage' + description: Unauthorized + "403": + description: Forbidden + "500": + description: Internal Server Error + tags: + - Session + /v1/sessions/cancel: + post: + operationId: Session.CancelSession + parameters: + - explode: true + in: query + name: sessionId + required: false + schema: + type: string + style: form + - description: Bearer token. Can be left empty on anonymous endpoints + explode: false + in: header + name: TrinsicAuthorization + required: true + schema: + default: 'Bearer ' + type: string + style: simple + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/CancelSessionResponse' + application/json: + schema: + $ref: '#/components/schemas/CancelSessionResponse' + text/json: + schema: + $ref: '#/components/schemas/CancelSessionResponse' + description: OK + "400": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ValidationResult' + type: array + description: Validation Failed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/FailureMessage' + description: Unauthorized + "403": + description: Forbidden + "500": + description: Internal Server Error + tags: + - Session +components: + schemas: + CancelSessionResponse: + additionalProperties: false + example: + session: + clientToken: clientToken + created: 6 + failCode: SessionFailNone + id: id + state: IdvCreated + resultVp: resultVp + verifications: + key: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + updated: 1 + properties: + session: + $ref: '#/components/schemas/Session' + type: object + CreateSessionRequest: + additionalProperties: false + example: + verifications: + - type: GovernmentId + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + - type: GovernmentId + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + properties: + verifications: + items: + $ref: '#/components/schemas/RequestedVerification' + nullable: true + type: array + type: object + CreateSessionResponse: + additionalProperties: false + example: + session: + clientToken: clientToken + created: 6 + failCode: SessionFailNone + id: id + state: IdvCreated + resultVp: resultVp + verifications: + key: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + updated: 1 + properties: + session: + $ref: '#/components/schemas/Session' + type: object + DebugIdvProviderSelection: + enum: + - Default + - IdVerse + - Argos + - Clear + - Yoti + - EidEasy + type: string + FailureMessage: + additionalProperties: false + example: + message: message + properties: + message: + nullable: true + type: string + type: object + GetSessionResponseV1: + additionalProperties: false + example: + session: + clientToken: clientToken + created: 6 + failCode: SessionFailNone + id: id + state: IdvCreated + resultVp: resultVp + verifications: + key: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + updated: 1 + properties: + session: + $ref: '#/components/schemas/Session' + type: object + GovernmentIDOptions: + additionalProperties: false + example: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + properties: + idNumber: + type: boolean + givenName: + type: boolean + familyName: + type: boolean + address: + type: boolean + dateOfBirth: + type: boolean + country: + type: boolean + issueDate: + type: boolean + expirationDate: + type: boolean + type: object + IDVSessionState: + enum: + - IdvCreated + - IdvInitiated + - IdvAuthenticating + - IdvInProgress + - IdvSuccess + - IdvFailed + type: string + ListSessionsRequest: + additionalProperties: false + example: + orderBy: Created + orderDirection: Ascending + pageSize: 1 + page: 1294386359 + properties: + orderBy: + $ref: '#/components/schemas/SessionOrdering' + orderDirection: + $ref: '#/components/schemas/OrderDirection' + pageSize: + format: int32 + maximum: 10 + minimum: 1 + type: integer + page: + format: int32 + maximum: 2147483647 + minimum: 1 + type: integer + required: + - orderBy + - orderDirection + type: object + ListSessionsResponseV1: + additionalProperties: false + example: + sessions: + - clientToken: clientToken + created: 6 + failCode: SessionFailNone + id: id + state: IdvCreated + resultVp: resultVp + verifications: + key: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + updated: 1 + - clientToken: clientToken + created: 6 + failCode: SessionFailNone + id: id + state: IdvCreated + resultVp: resultVp + verifications: + key: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + updated: 1 + properties: + sessions: + items: + $ref: '#/components/schemas/Session' + nullable: true + type: array + type: object + NormalizedGovernmentIdData: + additionalProperties: false + example: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + properties: + idNumber: + nullable: true + type: string + givenName: + nullable: true + type: string + familyName: + nullable: true + type: string + address: + nullable: true + type: string + dateOfBirth: + nullable: true + type: string + country: + nullable: true + type: string + issueDate: + nullable: true + type: string + expirationDate: + nullable: true + type: string + type: object + OrderDirection: + enum: + - Ascending + - Descending + type: string + RequestedVerification: + additionalProperties: false + example: + type: GovernmentId + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + properties: + type: + $ref: '#/components/schemas/VerificationType' + governmentIdOptions: + $ref: '#/components/schemas/GovernmentIDOptions' + type: object + Session: + additionalProperties: false + example: + clientToken: clientToken + created: 6 + failCode: SessionFailNone + id: id + state: IdvCreated + resultVp: resultVp + verifications: + key: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + updated: 1 + properties: + id: + nullable: true + type: string + clientToken: + nullable: true + type: string + state: + $ref: '#/components/schemas/IDVSessionState' + verifications: + additionalProperties: + $ref: '#/components/schemas/Verification' + nullable: true + type: object + failCode: + $ref: '#/components/schemas/SessionFailCode' + resultVp: + nullable: true + type: string + created: + format: int64 + type: integer + updated: + format: int64 + type: integer + type: object + SessionFailCode: + enum: + - SessionFailNone + - SessionFailInternal + - SessionFailVerificationFailed + - SessionFailAuthentication + - SessionFailExpired + - SessionFailUserCanceled + - SessionFailRpcCanceled + type: string + SessionOrdering: + enum: + - Created + - Updated + - State + type: string + ValidationResult: + additionalProperties: false + example: + memberNames: + - memberNames + - memberNames + errorMessage: errorMessage + properties: + memberNames: + items: + type: string + nullable: true + readOnly: true + type: array + errorMessage: + nullable: true + type: string + type: object + Verification: + additionalProperties: false + example: + failCode: VerificationFailNone + id: id + state: VerificationPending + type: GovernmentId + updated: 0 + reused: true + normalizedGovernmentIdData: + country: country + address: address + givenName: givenName + familyName: familyName + dateOfBirth: dateOfBirth + idNumber: idNumber + issueDate: issueDate + expirationDate: expirationDate + governmentIdOptions: + country: true + address: true + givenName: true + familyName: true + dateOfBirth: true + idNumber: true + issueDate: true + expirationDate: true + properties: + id: + nullable: true + type: string + type: + $ref: '#/components/schemas/VerificationType' + state: + $ref: '#/components/schemas/VerificationState' + failCode: + $ref: '#/components/schemas/VerificationFailCode' + reused: + type: boolean + updated: + format: int64 + type: integer + governmentIdOptions: + $ref: '#/components/schemas/GovernmentIDOptions' + normalizedGovernmentIdData: + $ref: '#/components/schemas/NormalizedGovernmentIdData' + type: object + VerificationFailCode: + enum: + - VerificationFailNone + - VerificationFailInternal + - VerificationFailInvalidImage + - VerificationFailInauthentic + - VerificationFailUnsupportedDocument + type: string + VerificationState: + enum: + - VerificationPending + - VerificationSuccess + - VerificationFailed + type: string + VerificationType: + enum: + - GovernmentId + type: string + securitySchemes: + Bearer: + description: Trinsic Connect API Key + scheme: bearer + type: http + diff --git a/connect/csharp/appveyor.yml b/connect/csharp/appveyor.yml new file mode 100644 index 000000000..f76f63cee --- /dev/null +++ b/connect/csharp/appveyor.yml @@ -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 diff --git a/connect/csharp/docs/CancelSessionResponse.md b/connect/csharp/docs/CancelSessionResponse.md new file mode 100644 index 000000000..794f27c6f --- /dev/null +++ b/connect/csharp/docs/CancelSessionResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CancelSessionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Session** | [**Session**](Session.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) + diff --git a/connect/csharp/docs/CreateSessionRequest.md b/connect/csharp/docs/CreateSessionRequest.md new file mode 100644 index 000000000..dedfe8a67 --- /dev/null +++ b/connect/csharp/docs/CreateSessionRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CreateSessionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Verifications** | [**List<RequestedVerification>**](RequestedVerification.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) + diff --git a/connect/csharp/docs/CreateSessionResponse.md b/connect/csharp/docs/CreateSessionResponse.md new file mode 100644 index 000000000..93ca2c6bf --- /dev/null +++ b/connect/csharp/docs/CreateSessionResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CreateSessionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Session** | [**Session**](Session.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) + diff --git a/connect/csharp/docs/DebugIdvProviderSelection.md b/connect/csharp/docs/DebugIdvProviderSelection.md new file mode 100644 index 000000000..1db93def3 --- /dev/null +++ b/connect/csharp/docs/DebugIdvProviderSelection.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.DebugIdvProviderSelection + +## 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) + diff --git a/connect/csharp/docs/FailureMessage.md b/connect/csharp/docs/FailureMessage.md new file mode 100644 index 000000000..34312dd8d --- /dev/null +++ b/connect/csharp/docs/FailureMessage.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.FailureMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/connect/csharp/docs/GetSessionResponseV1.md b/connect/csharp/docs/GetSessionResponseV1.md new file mode 100644 index 000000000..3f2247604 --- /dev/null +++ b/connect/csharp/docs/GetSessionResponseV1.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GetSessionResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Session** | [**Session**](Session.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) + diff --git a/connect/csharp/docs/GovernmentIDOptions.md b/connect/csharp/docs/GovernmentIDOptions.md new file mode 100644 index 000000000..98d7e618c --- /dev/null +++ b/connect/csharp/docs/GovernmentIDOptions.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.GovernmentIDOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IdNumber** | **bool** | | [optional] +**GivenName** | **bool** | | [optional] +**FamilyName** | **bool** | | [optional] +**Address** | **bool** | | [optional] +**DateOfBirth** | **bool** | | [optional] +**Country** | **bool** | | [optional] +**IssueDate** | **bool** | | [optional] +**ExpirationDate** | **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) + diff --git a/connect/csharp/docs/IDVSessionState.md b/connect/csharp/docs/IDVSessionState.md new file mode 100644 index 000000000..e6d4cd02b --- /dev/null +++ b/connect/csharp/docs/IDVSessionState.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.IDVSessionState + +## 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) + diff --git a/connect/csharp/docs/ListSessionsRequest.md b/connect/csharp/docs/ListSessionsRequest.md new file mode 100644 index 000000000..ac552fcee --- /dev/null +++ b/connect/csharp/docs/ListSessionsRequest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ListSessionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderBy** | **SessionOrdering** | | +**OrderDirection** | **OrderDirection** | | +**PageSize** | **int** | | [optional] +**Page** | **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) + diff --git a/connect/csharp/docs/ListSessionsResponseV1.md b/connect/csharp/docs/ListSessionsResponseV1.md new file mode 100644 index 000000000..9f24f19d7 --- /dev/null +++ b/connect/csharp/docs/ListSessionsResponseV1.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ListSessionsResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sessions** | [**List<Session>**](Session.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) + diff --git a/connect/csharp/docs/NormalizedGovernmentIdData.md b/connect/csharp/docs/NormalizedGovernmentIdData.md new file mode 100644 index 000000000..d48783491 --- /dev/null +++ b/connect/csharp/docs/NormalizedGovernmentIdData.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.NormalizedGovernmentIdData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IdNumber** | **string** | | [optional] +**GivenName** | **string** | | [optional] +**FamilyName** | **string** | | [optional] +**Address** | **string** | | [optional] +**DateOfBirth** | **string** | | [optional] +**Country** | **string** | | [optional] +**IssueDate** | **string** | | [optional] +**ExpirationDate** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/connect/csharp/docs/OrderDirection.md b/connect/csharp/docs/OrderDirection.md new file mode 100644 index 000000000..769ca4415 --- /dev/null +++ b/connect/csharp/docs/OrderDirection.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OrderDirection + +## 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) + diff --git a/connect/csharp/docs/RequestedVerification.md b/connect/csharp/docs/RequestedVerification.md new file mode 100644 index 000000000..2e6239c91 --- /dev/null +++ b/connect/csharp/docs/RequestedVerification.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.RequestedVerification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **VerificationType** | | [optional] +**GovernmentIdOptions** | [**GovernmentIDOptions**](GovernmentIDOptions.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) + diff --git a/connect/csharp/docs/Session.md b/connect/csharp/docs/Session.md new file mode 100644 index 000000000..f242a0453 --- /dev/null +++ b/connect/csharp/docs/Session.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.Session + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] +**ClientToken** | **string** | | [optional] +**State** | **IDVSessionState** | | [optional] +**Verifications** | [**Dictionary<string, Verification>**](Verification.md) | | [optional] +**FailCode** | **SessionFailCode** | | [optional] +**ResultVp** | **string** | | [optional] +**Created** | **long** | | [optional] +**Updated** | **long** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/connect/csharp/docs/SessionApi.md b/connect/csharp/docs/SessionApi.md new file mode 100644 index 000000000..761224cfb --- /dev/null +++ b/connect/csharp/docs/SessionApi.md @@ -0,0 +1,395 @@ +# Org.OpenAPITools.Api.SessionApi + +All URIs are relative to *https://connect-api.trinsic.id* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**SessionCancelSession**](SessionApi.md#sessioncancelsession) | **POST** /v1/sessions/cancel | | +| [**SessionCreateSession**](SessionApi.md#sessioncreatesession) | **POST** /v1/sessions | | +| [**SessionGetSession**](SessionApi.md#sessiongetsession) | **GET** /v1/sessions/get | | +| [**SessionListSessions**](SessionApi.md#sessionlistsessions) | **POST** /v1/sessions/list | | + + +# **SessionCancelSession** +> CancelSessionResponse SessionCancelSession (string trinsicAuthorization, string? sessionId = null) + + + +### 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 SessionCancelSessionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://connect-api.trinsic.id"; + // Configure Bearer token for authorization: Bearer + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new SessionApi(config); + var trinsicAuthorization = "\"Bearer \""; // string | Bearer token. Can be left empty on anonymous endpoints (default to "Bearer ") + var sessionId = "sessionId_example"; // string? | (optional) + + try + { + CancelSessionResponse result = apiInstance.SessionCancelSession(trinsicAuthorization, sessionId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SessionApi.SessionCancelSession: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SessionCancelSessionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.SessionCancelSessionWithHttpInfo(trinsicAuthorization, sessionId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SessionApi.SessionCancelSessionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **trinsicAuthorization** | **string** | Bearer token. Can be left empty on anonymous endpoints | [default to "Bearer "] | +| **sessionId** | **string?** | | [optional] | + +### Return type + +[**CancelSessionResponse**](CancelSessionResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Validation Failed | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **500** | Internal Server Error | - | + +[[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) + + +# **SessionCreateSession** +> CreateSessionResponse SessionCreateSession (string trinsicAuthorization, CreateSessionRequest? createSessionRequest = null) + + + +### 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 SessionCreateSessionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://connect-api.trinsic.id"; + // Configure Bearer token for authorization: Bearer + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new SessionApi(config); + var trinsicAuthorization = "\"Bearer \""; // string | Bearer token. Can be left empty on anonymous endpoints (default to "Bearer ") + var createSessionRequest = new CreateSessionRequest?(); // CreateSessionRequest? | (optional) + + try + { + CreateSessionResponse result = apiInstance.SessionCreateSession(trinsicAuthorization, createSessionRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SessionApi.SessionCreateSession: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SessionCreateSessionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.SessionCreateSessionWithHttpInfo(trinsicAuthorization, createSessionRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SessionApi.SessionCreateSessionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **trinsicAuthorization** | **string** | Bearer token. Can be left empty on anonymous endpoints | [default to "Bearer "] | +| **createSessionRequest** | [**CreateSessionRequest?**](CreateSessionRequest?.md) | | [optional] | + +### Return type + +[**CreateSessionResponse**](CreateSessionResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Validation Failed | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **500** | Internal Server Error | - | + +[[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) + + +# **SessionGetSession** +> GetSessionResponseV1 SessionGetSession (string trinsicAuthorization, string? sessionId = null) + + + +### 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 SessionGetSessionExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://connect-api.trinsic.id"; + // Configure Bearer token for authorization: Bearer + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new SessionApi(config); + var trinsicAuthorization = "\"Bearer \""; // string | Bearer token. Can be left empty on anonymous endpoints (default to "Bearer ") + var sessionId = "sessionId_example"; // string? | (optional) + + try + { + GetSessionResponseV1 result = apiInstance.SessionGetSession(trinsicAuthorization, sessionId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SessionApi.SessionGetSession: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SessionGetSessionWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.SessionGetSessionWithHttpInfo(trinsicAuthorization, sessionId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SessionApi.SessionGetSessionWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **trinsicAuthorization** | **string** | Bearer token. Can be left empty on anonymous endpoints | [default to "Bearer "] | +| **sessionId** | **string?** | | [optional] | + +### Return type + +[**GetSessionResponseV1**](GetSessionResponseV1.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Validation Failed | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **500** | Internal Server Error | - | + +[[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) + + +# **SessionListSessions** +> ListSessionsResponseV1 SessionListSessions (string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = null) + + + +### 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 SessionListSessionsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://connect-api.trinsic.id"; + // Configure Bearer token for authorization: Bearer + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new SessionApi(config); + var trinsicAuthorization = "\"Bearer \""; // string | Bearer token. Can be left empty on anonymous endpoints (default to "Bearer ") + var listSessionsRequest = new ListSessionsRequest?(); // ListSessionsRequest? | (optional) + + try + { + ListSessionsResponseV1 result = apiInstance.SessionListSessions(trinsicAuthorization, listSessionsRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling SessionApi.SessionListSessions: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SessionListSessionsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.SessionListSessionsWithHttpInfo(trinsicAuthorization, listSessionsRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SessionApi.SessionListSessionsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **trinsicAuthorization** | **string** | Bearer token. Can be left empty on anonymous endpoints | [default to "Bearer "] | +| **listSessionsRequest** | [**ListSessionsRequest?**](ListSessionsRequest?.md) | | [optional] | + +### Return type + +[**ListSessionsResponseV1**](ListSessionsResponseV1.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json, text/json, application/*+json + - **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Validation Failed | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/connect/csharp/docs/SessionFailCode.md b/connect/csharp/docs/SessionFailCode.md new file mode 100644 index 000000000..208edb7b8 --- /dev/null +++ b/connect/csharp/docs/SessionFailCode.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.SessionFailCode + +## 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) + diff --git a/connect/csharp/docs/SessionOrdering.md b/connect/csharp/docs/SessionOrdering.md new file mode 100644 index 000000000..26b9b2f6a --- /dev/null +++ b/connect/csharp/docs/SessionOrdering.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.SessionOrdering + +## 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) + diff --git a/connect/csharp/docs/ValidationResult.md b/connect/csharp/docs/ValidationResult.md new file mode 100644 index 000000000..5ffa3fb99 --- /dev/null +++ b/connect/csharp/docs/ValidationResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ValidationResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberNames** | **List<string>** | | [optional] [readonly] +**ErrorMessage** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/connect/csharp/docs/Verification.md b/connect/csharp/docs/Verification.md new file mode 100644 index 000000000..5170029cc --- /dev/null +++ b/connect/csharp/docs/Verification.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.Verification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] +**Type** | **VerificationType** | | [optional] +**State** | **VerificationState** | | [optional] +**FailCode** | **VerificationFailCode** | | [optional] +**Reused** | **bool** | | [optional] +**Updated** | **long** | | [optional] +**GovernmentIdOptions** | [**GovernmentIDOptions**](GovernmentIDOptions.md) | | [optional] +**NormalizedGovernmentIdData** | [**NormalizedGovernmentIdData**](NormalizedGovernmentIdData.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) + diff --git a/connect/csharp/docs/VerificationFailCode.md b/connect/csharp/docs/VerificationFailCode.md new file mode 100644 index 000000000..8fbe36903 --- /dev/null +++ b/connect/csharp/docs/VerificationFailCode.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.VerificationFailCode + +## 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) + diff --git a/connect/csharp/docs/VerificationState.md b/connect/csharp/docs/VerificationState.md new file mode 100644 index 000000000..1707dcc21 --- /dev/null +++ b/connect/csharp/docs/VerificationState.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.VerificationState + +## 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) + diff --git a/connect/csharp/docs/VerificationType.md b/connect/csharp/docs/VerificationType.md new file mode 100644 index 000000000..c6fdac36c --- /dev/null +++ b/connect/csharp/docs/VerificationType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.VerificationType + +## 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) + diff --git a/connect/csharp/git_push.sh b/connect/csharp/git_push.sh new file mode 100644 index 000000000..f53a75d4f --- /dev/null +++ b/connect/csharp/git_push.sh @@ -0,0 +1,57 @@ +#!/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_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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 + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Api/SessionApiTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Api/SessionApiTests.cs new file mode 100644 index 000000000..9524cb752 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Api/SessionApiTests.cs @@ -0,0 +1,109 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing SessionApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class SessionApiTests : IDisposable + { + private SessionApi instance; + + public SessionApiTests() + { + instance = new SessionApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SessionApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' SessionApi + //Assert.IsType(instance); + } + + /// + /// Test SessionCancelSession + /// + [Fact] + public void SessionCancelSessionTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string trinsicAuthorization = null; + //string? sessionId = null; + //var response = instance.SessionCancelSession(trinsicAuthorization, sessionId); + //Assert.IsType(response); + } + + /// + /// Test SessionCreateSession + /// + [Fact] + public void SessionCreateSessionTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string trinsicAuthorization = null; + //CreateSessionRequest? createSessionRequest = null; + //var response = instance.SessionCreateSession(trinsicAuthorization, createSessionRequest); + //Assert.IsType(response); + } + + /// + /// Test SessionGetSession + /// + [Fact] + public void SessionGetSessionTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string trinsicAuthorization = null; + //string? sessionId = null; + //var response = instance.SessionGetSession(trinsicAuthorization, sessionId); + //Assert.IsType(response); + } + + /// + /// Test SessionListSessions + /// + [Fact] + public void SessionListSessionsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string trinsicAuthorization = null; + //ListSessionsRequest? listSessionsRequest = null; + //var response = instance.SessionListSessions(trinsicAuthorization, listSessionsRequest); + //Assert.IsType(response); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/CancelSessionResponseTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/CancelSessionResponseTests.cs new file mode 100644 index 000000000..b8612c347 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/CancelSessionResponseTests.cs @@ -0,0 +1,66 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CancelSessionResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CancelSessionResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CancelSessionResponse + //private CancelSessionResponse instance; + + public CancelSessionResponseTests() + { + // TODO uncomment below to create an instance of CancelSessionResponse + //instance = new CancelSessionResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CancelSessionResponse + /// + [Fact] + public void CancelSessionResponseInstanceTest() + { + // TODO uncomment below to test "IsType" CancelSessionResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Session' + /// + [Fact] + public void SessionTest() + { + // TODO unit test for the property 'Session' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionRequestTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionRequestTests.cs new file mode 100644 index 000000000..4067e260a --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionRequestTests.cs @@ -0,0 +1,66 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CreateSessionRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CreateSessionRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CreateSessionRequest + //private CreateSessionRequest instance; + + public CreateSessionRequestTests() + { + // TODO uncomment below to create an instance of CreateSessionRequest + //instance = new CreateSessionRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CreateSessionRequest + /// + [Fact] + public void CreateSessionRequestInstanceTest() + { + // TODO uncomment below to test "IsType" CreateSessionRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'Verifications' + /// + [Fact] + public void VerificationsTest() + { + // TODO unit test for the property 'Verifications' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionResponseTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionResponseTests.cs new file mode 100644 index 000000000..32aeb7eed --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/CreateSessionResponseTests.cs @@ -0,0 +1,66 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CreateSessionResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CreateSessionResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CreateSessionResponse + //private CreateSessionResponse instance; + + public CreateSessionResponseTests() + { + // TODO uncomment below to create an instance of CreateSessionResponse + //instance = new CreateSessionResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CreateSessionResponse + /// + [Fact] + public void CreateSessionResponseInstanceTest() + { + // TODO uncomment below to test "IsType" CreateSessionResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Session' + /// + [Fact] + public void SessionTest() + { + // TODO unit test for the property 'Session' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/DebugIdvProviderSelectionTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/DebugIdvProviderSelectionTests.cs new file mode 100644 index 000000000..60365c31e --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/DebugIdvProviderSelectionTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DebugIdvProviderSelection + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DebugIdvProviderSelectionTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DebugIdvProviderSelection + //private DebugIdvProviderSelection instance; + + public DebugIdvProviderSelectionTests() + { + // TODO uncomment below to create an instance of DebugIdvProviderSelection + //instance = new DebugIdvProviderSelection(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DebugIdvProviderSelection + /// + [Fact] + public void DebugIdvProviderSelectionInstanceTest() + { + // TODO uncomment below to test "IsType" DebugIdvProviderSelection + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/FailureMessageTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/FailureMessageTests.cs new file mode 100644 index 000000000..7b967fabe --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/FailureMessageTests.cs @@ -0,0 +1,66 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FailureMessage + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FailureMessageTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FailureMessage + //private FailureMessage instance; + + public FailureMessageTests() + { + // TODO uncomment below to create an instance of FailureMessage + //instance = new FailureMessage(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FailureMessage + /// + [Fact] + public void FailureMessageInstanceTest() + { + // TODO uncomment below to test "IsType" FailureMessage + //Assert.IsType(instance); + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/GetSessionResponseV1Tests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/GetSessionResponseV1Tests.cs new file mode 100644 index 000000000..702427d46 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/GetSessionResponseV1Tests.cs @@ -0,0 +1,66 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GetSessionResponseV1 + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GetSessionResponseV1Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for GetSessionResponseV1 + //private GetSessionResponseV1 instance; + + public GetSessionResponseV1Tests() + { + // TODO uncomment below to create an instance of GetSessionResponseV1 + //instance = new GetSessionResponseV1(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GetSessionResponseV1 + /// + [Fact] + public void GetSessionResponseV1InstanceTest() + { + // TODO uncomment below to test "IsType" GetSessionResponseV1 + //Assert.IsType(instance); + } + + /// + /// Test the property 'Session' + /// + [Fact] + public void SessionTest() + { + // TODO unit test for the property 'Session' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/GovernmentIDOptionsTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/GovernmentIDOptionsTests.cs new file mode 100644 index 000000000..e38b24144 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/GovernmentIDOptionsTests.cs @@ -0,0 +1,129 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GovernmentIDOptions + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GovernmentIDOptionsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GovernmentIDOptions + //private GovernmentIDOptions instance; + + public GovernmentIDOptionsTests() + { + // TODO uncomment below to create an instance of GovernmentIDOptions + //instance = new GovernmentIDOptions(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GovernmentIDOptions + /// + [Fact] + public void GovernmentIDOptionsInstanceTest() + { + // TODO uncomment below to test "IsType" GovernmentIDOptions + //Assert.IsType(instance); + } + + /// + /// Test the property 'IdNumber' + /// + [Fact] + public void IdNumberTest() + { + // TODO unit test for the property 'IdNumber' + } + + /// + /// Test the property 'GivenName' + /// + [Fact] + public void GivenNameTest() + { + // TODO unit test for the property 'GivenName' + } + + /// + /// Test the property 'FamilyName' + /// + [Fact] + public void FamilyNameTest() + { + // TODO unit test for the property 'FamilyName' + } + + /// + /// Test the property 'Address' + /// + [Fact] + public void AddressTest() + { + // TODO unit test for the property 'Address' + } + + /// + /// Test the property 'DateOfBirth' + /// + [Fact] + public void DateOfBirthTest() + { + // TODO unit test for the property 'DateOfBirth' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'IssueDate' + /// + [Fact] + public void IssueDateTest() + { + // TODO unit test for the property 'IssueDate' + } + + /// + /// Test the property 'ExpirationDate' + /// + [Fact] + public void ExpirationDateTest() + { + // TODO unit test for the property 'ExpirationDate' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/IDVSessionStateTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/IDVSessionStateTests.cs new file mode 100644 index 000000000..62ed7efdd --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/IDVSessionStateTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing IDVSessionState + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IDVSessionStateTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IDVSessionState + //private IDVSessionState instance; + + public IDVSessionStateTests() + { + // TODO uncomment below to create an instance of IDVSessionState + //instance = new IDVSessionState(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IDVSessionState + /// + [Fact] + public void IDVSessionStateInstanceTest() + { + // TODO uncomment below to test "IsType" IDVSessionState + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsRequestTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsRequestTests.cs new file mode 100644 index 000000000..eb062ec2f --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsRequestTests.cs @@ -0,0 +1,93 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ListSessionsRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListSessionsRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ListSessionsRequest + //private ListSessionsRequest instance; + + public ListSessionsRequestTests() + { + // TODO uncomment below to create an instance of ListSessionsRequest + //instance = new ListSessionsRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ListSessionsRequest + /// + [Fact] + public void ListSessionsRequestInstanceTest() + { + // TODO uncomment below to test "IsType" ListSessionsRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'OrderBy' + /// + [Fact] + public void OrderByTest() + { + // TODO unit test for the property 'OrderBy' + } + + /// + /// Test the property 'OrderDirection' + /// + [Fact] + public void OrderDirectionTest() + { + // TODO unit test for the property 'OrderDirection' + } + + /// + /// Test the property 'PageSize' + /// + [Fact] + public void PageSizeTest() + { + // TODO unit test for the property 'PageSize' + } + + /// + /// Test the property 'Page' + /// + [Fact] + public void PageTest() + { + // TODO unit test for the property 'Page' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsResponseV1Tests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsResponseV1Tests.cs new file mode 100644 index 000000000..1fd2b1186 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/ListSessionsResponseV1Tests.cs @@ -0,0 +1,66 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ListSessionsResponseV1 + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListSessionsResponseV1Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for ListSessionsResponseV1 + //private ListSessionsResponseV1 instance; + + public ListSessionsResponseV1Tests() + { + // TODO uncomment below to create an instance of ListSessionsResponseV1 + //instance = new ListSessionsResponseV1(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ListSessionsResponseV1 + /// + [Fact] + public void ListSessionsResponseV1InstanceTest() + { + // TODO uncomment below to test "IsType" ListSessionsResponseV1 + //Assert.IsType(instance); + } + + /// + /// Test the property 'Sessions' + /// + [Fact] + public void SessionsTest() + { + // TODO unit test for the property 'Sessions' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/NormalizedGovernmentIdDataTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/NormalizedGovernmentIdDataTests.cs new file mode 100644 index 000000000..838606aa4 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/NormalizedGovernmentIdDataTests.cs @@ -0,0 +1,129 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NormalizedGovernmentIdData + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NormalizedGovernmentIdDataTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NormalizedGovernmentIdData + //private NormalizedGovernmentIdData instance; + + public NormalizedGovernmentIdDataTests() + { + // TODO uncomment below to create an instance of NormalizedGovernmentIdData + //instance = new NormalizedGovernmentIdData(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NormalizedGovernmentIdData + /// + [Fact] + public void NormalizedGovernmentIdDataInstanceTest() + { + // TODO uncomment below to test "IsType" NormalizedGovernmentIdData + //Assert.IsType(instance); + } + + /// + /// Test the property 'IdNumber' + /// + [Fact] + public void IdNumberTest() + { + // TODO unit test for the property 'IdNumber' + } + + /// + /// Test the property 'GivenName' + /// + [Fact] + public void GivenNameTest() + { + // TODO unit test for the property 'GivenName' + } + + /// + /// Test the property 'FamilyName' + /// + [Fact] + public void FamilyNameTest() + { + // TODO unit test for the property 'FamilyName' + } + + /// + /// Test the property 'Address' + /// + [Fact] + public void AddressTest() + { + // TODO unit test for the property 'Address' + } + + /// + /// Test the property 'DateOfBirth' + /// + [Fact] + public void DateOfBirthTest() + { + // TODO unit test for the property 'DateOfBirth' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'IssueDate' + /// + [Fact] + public void IssueDateTest() + { + // TODO unit test for the property 'IssueDate' + } + + /// + /// Test the property 'ExpirationDate' + /// + [Fact] + public void ExpirationDateTest() + { + // TODO unit test for the property 'ExpirationDate' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/OrderDirectionTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/OrderDirectionTests.cs new file mode 100644 index 000000000..374881ea2 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/OrderDirectionTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OrderDirection + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderDirectionTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OrderDirection + //private OrderDirection instance; + + public OrderDirectionTests() + { + // TODO uncomment below to create an instance of OrderDirection + //instance = new OrderDirection(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OrderDirection + /// + [Fact] + public void OrderDirectionInstanceTest() + { + // TODO uncomment below to test "IsType" OrderDirection + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/RequestedVerificationTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/RequestedVerificationTests.cs new file mode 100644 index 000000000..7d1e96827 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/RequestedVerificationTests.cs @@ -0,0 +1,75 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RequestedVerification + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequestedVerificationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequestedVerification + //private RequestedVerification instance; + + public RequestedVerificationTests() + { + // TODO uncomment below to create an instance of RequestedVerification + //instance = new RequestedVerification(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequestedVerification + /// + [Fact] + public void RequestedVerificationInstanceTest() + { + // TODO uncomment below to test "IsType" RequestedVerification + //Assert.IsType(instance); + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + /// + /// Test the property 'GovernmentIdOptions' + /// + [Fact] + public void GovernmentIdOptionsTest() + { + // TODO unit test for the property 'GovernmentIdOptions' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionFailCodeTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionFailCodeTests.cs new file mode 100644 index 000000000..549701d57 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionFailCodeTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SessionFailCode + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SessionFailCodeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SessionFailCode + //private SessionFailCode instance; + + public SessionFailCodeTests() + { + // TODO uncomment below to create an instance of SessionFailCode + //instance = new SessionFailCode(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SessionFailCode + /// + [Fact] + public void SessionFailCodeInstanceTest() + { + // TODO uncomment below to test "IsType" SessionFailCode + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionOrderingTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionOrderingTests.cs new file mode 100644 index 000000000..69c8fa735 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionOrderingTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SessionOrdering + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SessionOrderingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SessionOrdering + //private SessionOrdering instance; + + public SessionOrderingTests() + { + // TODO uncomment below to create an instance of SessionOrdering + //instance = new SessionOrdering(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SessionOrdering + /// + [Fact] + public void SessionOrderingInstanceTest() + { + // TODO uncomment below to test "IsType" SessionOrdering + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionTests.cs new file mode 100644 index 000000000..f43ed15f8 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/SessionTests.cs @@ -0,0 +1,129 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Session + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SessionTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Session + //private Session instance; + + public SessionTests() + { + // TODO uncomment below to create an instance of Session + //instance = new Session(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Session + /// + [Fact] + public void SessionInstanceTest() + { + // TODO uncomment below to test "IsType" Session + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'ClientToken' + /// + [Fact] + public void ClientTokenTest() + { + // TODO unit test for the property 'ClientToken' + } + + /// + /// Test the property 'State' + /// + [Fact] + public void StateTest() + { + // TODO unit test for the property 'State' + } + + /// + /// Test the property 'Verifications' + /// + [Fact] + public void VerificationsTest() + { + // TODO unit test for the property 'Verifications' + } + + /// + /// Test the property 'FailCode' + /// + [Fact] + public void FailCodeTest() + { + // TODO unit test for the property 'FailCode' + } + + /// + /// Test the property 'ResultVp' + /// + [Fact] + public void ResultVpTest() + { + // TODO unit test for the property 'ResultVp' + } + + /// + /// Test the property 'Created' + /// + [Fact] + public void CreatedTest() + { + // TODO unit test for the property 'Created' + } + + /// + /// Test the property 'Updated' + /// + [Fact] + public void UpdatedTest() + { + // TODO unit test for the property 'Updated' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/ValidationResultTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/ValidationResultTests.cs new file mode 100644 index 000000000..35d1d273a --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/ValidationResultTests.cs @@ -0,0 +1,75 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ValidationResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ValidationResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ValidationResult + //private ValidationResult instance; + + public ValidationResultTests() + { + // TODO uncomment below to create an instance of ValidationResult + //instance = new ValidationResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ValidationResult + /// + [Fact] + public void ValidationResultInstanceTest() + { + // TODO uncomment below to test "IsType" ValidationResult + //Assert.IsType(instance); + } + + /// + /// Test the property 'MemberNames' + /// + [Fact] + public void MemberNamesTest() + { + // TODO unit test for the property 'MemberNames' + } + + /// + /// Test the property 'ErrorMessage' + /// + [Fact] + public void ErrorMessageTest() + { + // TODO unit test for the property 'ErrorMessage' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationFailCodeTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationFailCodeTests.cs new file mode 100644 index 000000000..6551dbdbb --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationFailCodeTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing VerificationFailCode + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class VerificationFailCodeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for VerificationFailCode + //private VerificationFailCode instance; + + public VerificationFailCodeTests() + { + // TODO uncomment below to create an instance of VerificationFailCode + //instance = new VerificationFailCode(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationFailCode + /// + [Fact] + public void VerificationFailCodeInstanceTest() + { + // TODO uncomment below to test "IsType" VerificationFailCode + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationStateTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationStateTests.cs new file mode 100644 index 000000000..87fa54ce6 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationStateTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing VerificationState + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class VerificationStateTests : IDisposable + { + // TODO uncomment below to declare an instance variable for VerificationState + //private VerificationState instance; + + public VerificationStateTests() + { + // TODO uncomment below to create an instance of VerificationState + //instance = new VerificationState(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationState + /// + [Fact] + public void VerificationStateInstanceTest() + { + // TODO uncomment below to test "IsType" VerificationState + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTests.cs new file mode 100644 index 000000000..e4cbb3600 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTests.cs @@ -0,0 +1,129 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Verification + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class VerificationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Verification + //private Verification instance; + + public VerificationTests() + { + // TODO uncomment below to create an instance of Verification + //instance = new Verification(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Verification + /// + [Fact] + public void VerificationInstanceTest() + { + // TODO uncomment below to test "IsType" Verification + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + /// + /// Test the property 'State' + /// + [Fact] + public void StateTest() + { + // TODO unit test for the property 'State' + } + + /// + /// Test the property 'FailCode' + /// + [Fact] + public void FailCodeTest() + { + // TODO unit test for the property 'FailCode' + } + + /// + /// Test the property 'Reused' + /// + [Fact] + public void ReusedTest() + { + // TODO unit test for the property 'Reused' + } + + /// + /// Test the property 'Updated' + /// + [Fact] + public void UpdatedTest() + { + // TODO unit test for the property 'Updated' + } + + /// + /// Test the property 'GovernmentIdOptions' + /// + [Fact] + public void GovernmentIdOptionsTest() + { + // TODO unit test for the property 'GovernmentIdOptions' + } + + /// + /// Test the property 'NormalizedGovernmentIdData' + /// + [Fact] + public void NormalizedGovernmentIdDataTest() + { + // TODO unit test for the property 'NormalizedGovernmentIdData' + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTypeTests.cs b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTypeTests.cs new file mode 100644 index 000000000..922c1c3cd --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Model/VerificationTypeTests.cs @@ -0,0 +1,57 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing VerificationType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class VerificationTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for VerificationType + //private VerificationType instance; + + public VerificationTypeTests() + { + // TODO uncomment below to create an instance of VerificationType + //instance = new VerificationType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of VerificationType + /// + [Fact] + public void VerificationTypeInstanceTest() + { + // TODO uncomment below to test "IsType" VerificationType + //Assert.IsType(instance); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/connect/csharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 000000000..9e82d9d23 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,20 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net8.0 + false + annotations + + + + + + + + + + + + diff --git a/connect/csharp/src/Org.OpenAPITools/Api/SessionApi.cs b/connect/csharp/src/Org.OpenAPITools/Api/SessionApi.cs new file mode 100644 index 000000000..ebd6e2371 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Api/SessionApi.cs @@ -0,0 +1,1043 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISessionApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// CancelSessionResponse + CancelSessionResponse SessionCancelSession(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of CancelSessionResponse + ApiResponse SessionCancelSessionWithHttpInfo(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// CreateSessionResponse + CreateSessionResponse SessionCreateSession(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of CreateSessionResponse + ApiResponse SessionCreateSessionWithHttpInfo(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// GetSessionResponseV1 + GetSessionResponseV1 SessionGetSession(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of GetSessionResponseV1 + ApiResponse SessionGetSessionWithHttpInfo(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ListSessionsResponseV1 + ListSessionsResponseV1 SessionListSessions(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of ListSessionsResponseV1 + ApiResponse SessionListSessionsWithHttpInfo(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISessionApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CancelSessionResponse + System.Threading.Tasks.Task SessionCancelSessionAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CancelSessionResponse) + System.Threading.Tasks.Task> SessionCancelSessionWithHttpInfoAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CreateSessionResponse + System.Threading.Tasks.Task SessionCreateSessionAsync(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CreateSessionResponse) + System.Threading.Tasks.Task> SessionCreateSessionWithHttpInfoAsync(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GetSessionResponseV1 + System.Threading.Tasks.Task SessionGetSessionAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetSessionResponseV1) + System.Threading.Tasks.Task> SessionGetSessionWithHttpInfoAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ListSessionsResponseV1 + System.Threading.Tasks.Task SessionListSessionsAsync(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ListSessionsResponseV1) + System.Threading.Tasks.Task> SessionListSessionsWithHttpInfoAsync(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface ISessionApi : ISessionApiSync, ISessionApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class SessionApi : ISessionApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public SessionApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public SessionApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public SessionApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public SessionApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// CancelSessionResponse + public CancelSessionResponse SessionCancelSession(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = SessionCancelSessionWithHttpInfo(trinsicAuthorization, sessionId); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of CancelSessionResponse + public Org.OpenAPITools.Client.ApiResponse SessionCancelSessionWithHttpInfo(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionCancelSession"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (sessionId != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "sessionId", sessionId)); + } + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + + localVarRequestOptions.Operation = "SessionApi.SessionCancelSession"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/sessions/cancel", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionCancelSession", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CancelSessionResponse + public async System.Threading.Tasks.Task SessionCancelSessionAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await SessionCancelSessionWithHttpInfoAsync(trinsicAuthorization, sessionId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CancelSessionResponse) + public async System.Threading.Tasks.Task> SessionCancelSessionWithHttpInfoAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionCancelSession"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (sessionId != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "sessionId", sessionId)); + } + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + + localVarRequestOptions.Operation = "SessionApi.SessionCancelSession"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/sessions/cancel", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionCancelSession", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// CreateSessionResponse + public CreateSessionResponse SessionCreateSession(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = SessionCreateSessionWithHttpInfo(trinsicAuthorization, createSessionRequest); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of CreateSessionResponse + public Org.OpenAPITools.Client.ApiResponse SessionCreateSessionWithHttpInfo(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionCreateSession"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + localVarRequestOptions.Data = createSessionRequest; + + localVarRequestOptions.Operation = "SessionApi.SessionCreateSession"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/sessions", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionCreateSession", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of CreateSessionResponse + public async System.Threading.Tasks.Task SessionCreateSessionAsync(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await SessionCreateSessionWithHttpInfoAsync(trinsicAuthorization, createSessionRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (CreateSessionResponse) + public async System.Threading.Tasks.Task> SessionCreateSessionWithHttpInfoAsync(string trinsicAuthorization, CreateSessionRequest? createSessionRequest = default(CreateSessionRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionCreateSession"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + localVarRequestOptions.Data = createSessionRequest; + + localVarRequestOptions.Operation = "SessionApi.SessionCreateSession"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/sessions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionCreateSession", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// GetSessionResponseV1 + public GetSessionResponseV1 SessionGetSession(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = SessionGetSessionWithHttpInfo(trinsicAuthorization, sessionId); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of GetSessionResponseV1 + public Org.OpenAPITools.Client.ApiResponse SessionGetSessionWithHttpInfo(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionGetSession"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (sessionId != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "sessionId", sessionId)); + } + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + + localVarRequestOptions.Operation = "SessionApi.SessionGetSession"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/v1/sessions/get", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionGetSession", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of GetSessionResponseV1 + public async System.Threading.Tasks.Task SessionGetSessionAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await SessionGetSessionWithHttpInfoAsync(trinsicAuthorization, sessionId, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetSessionResponseV1) + public async System.Threading.Tasks.Task> SessionGetSessionWithHttpInfoAsync(string trinsicAuthorization, string? sessionId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionGetSession"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (sessionId != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "sessionId", sessionId)); + } + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + + localVarRequestOptions.Operation = "SessionApi.SessionGetSession"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/v1/sessions/get", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionGetSession", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ListSessionsResponseV1 + public ListSessionsResponseV1 SessionListSessions(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = SessionListSessionsWithHttpInfo(trinsicAuthorization, listSessionsRequest); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// ApiResponse of ListSessionsResponseV1 + public Org.OpenAPITools.Client.ApiResponse SessionListSessionsWithHttpInfo(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionListSessions"); + } + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + localVarRequestOptions.Data = listSessionsRequest; + + localVarRequestOptions.Operation = "SessionApi.SessionListSessions"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v1/sessions/list", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionListSessions", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ListSessionsResponseV1 + public async System.Threading.Tasks.Task SessionListSessionsAsync(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await SessionListSessionsWithHttpInfoAsync(trinsicAuthorization, listSessionsRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Bearer token. Can be left empty on anonymous endpoints + /// (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ListSessionsResponseV1) + public async System.Threading.Tasks.Task> SessionListSessionsWithHttpInfoAsync(string trinsicAuthorization, ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'trinsicAuthorization' is set + if (trinsicAuthorization == null) + { + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'trinsicAuthorization' when calling SessionApi->SessionListSessions"); + } + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "text/json", + "application/*+json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "text/plain", + "application/json", + "text/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.HeaderParameters.Add("TrinsicAuthorization", Org.OpenAPITools.Client.ClientUtils.ParameterToString(trinsicAuthorization)); // header parameter + localVarRequestOptions.Data = listSessionsRequest; + + localVarRequestOptions.Operation = "SessionApi.SessionListSessions"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (Bearer) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/v1/sessions/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SessionListSessions", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/ApiClient.cs b/connect/csharp/src/Org.OpenAPITools/Client/ApiClient.cs new file mode 100644 index 000000000..ec6479be0 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/ApiClient.cs @@ -0,0 +1,833 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using RestSharp.Serializers; +using RestSharpMethod = RestSharp.Method; +using Polly; + +namespace Org.OpenAPITools.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + public partial class ApiClient : ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(RestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(RestRequest request, RestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.Get; + break; + case HttpMethod.Post: + other = RestSharpMethod.Post; + break; + case HttpMethod.Put: + other = RestSharpMethod.Put; + break; + case HttpMethod.Delete: + other = RestSharpMethod.Delete; + break; + case HttpMethod.Head: + other = RestSharpMethod.Head; + break; + case HttpMethod.Options: + other = RestSharpMethod.Options; + break; + case HttpMethod.Patch: + other = RestSharpMethod.Patch; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(path, Method(method)); + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + else + request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); + } + } + } + + return request; + } + + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.ContentHeaders != null) + { + foreach (var responseHeader in response.ContentHeaders) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies.Cast()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + CookieContainer = cookies, + MaxTimeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response; + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + else + { + response = client.Execute(request); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + MaxTimeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response; + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + else + { + response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/ApiException.cs b/connect/csharp/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 000000000..c949d0fc8 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/ApiResponse.cs b/connect/csharp/src/Org.OpenAPITools/Client/ApiResponse.cs new file mode 100644 index 000000000..f59910fee --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/ClientUtils.cs b/connect/csharp/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 000000000..4c21c7845 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,247 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// Serializes the given object when not null. Otherwise return null. + /// + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Is the Enum decorated with EnumMember Attribute + /// + /// + /// true if found + private static bool HasEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// + /// Get the EnumMember value + /// + /// + /// EnumMember value as string otherwise null + private static string GetEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/Configuration.cs b/connect/csharp/src/Org.OpenAPITools/Client/Configuration.cs new file mode 100644 index 000000000..c9aff4526 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/Configuration.cs @@ -0,0 +1,624 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); + BasePath = "https://connect-api.trinsic.id"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "https://connect-api.trinsic.id"}, + {"description", "Production server"}, + } + }, + { + new Dictionary { + {"url", "https://dev-connect-api.trinsic.id"}, + {"description", "Development server"}, + } + }, + { + new Dictionary { + {"url", "https://staging-connect-api.trinsic.id"}, + {"description", "Staging server"}, + } + } + }; + OperationServers = new Dictionary>>() + { + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "https://connect-api.trinsic.id") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: v1\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/connect/csharp/src/Org.OpenAPITools/Client/ExceptionFactory.cs new file mode 100644 index 000000000..3b1276193 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/connect/csharp/src/Org.OpenAPITools/Client/GlobalConfiguration.cs new file mode 100644 index 000000000..3c73aa4e3 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/HttpMethod.cs b/connect/csharp/src/Org.OpenAPITools/Client/HttpMethod.cs new file mode 100644 index 000000000..ea9e8ed52 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/HttpMethod.cs @@ -0,0 +1,33 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/IApiAccessor.cs b/connect/csharp/src/Org.OpenAPITools/Client/IApiAccessor.cs new file mode 100644 index 000000000..ab7f963e8 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/connect/csharp/src/Org.OpenAPITools/Client/IAsynchronousClient.cs new file mode 100644 index 000000000..a07b68b8e --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/connect/csharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs new file mode 100644 index 000000000..275a47a40 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -0,0 +1,141 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/connect/csharp/src/Org.OpenAPITools/Client/ISynchronousClient.cs new file mode 100644 index 000000000..f1ea944a0 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/Multimap.cs b/connect/csharp/src/Org.OpenAPITools/Client/Multimap.cs new file mode 100644 index 000000000..02d202d6d --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/connect/csharp/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000..e3a88becf --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/RequestOptions.cs b/connect/csharp/src/Org.OpenAPITools/Client/RequestOptions.cs new file mode 100644 index 000000000..63a3c1b93 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -0,0 +1,84 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Multimap FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Operation associated with the request path. + /// + public string Operation { get; set; } + + /// + /// Index associated with the operation. + /// + public int OperationIndex { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Multimap(); + Cookies = new List(); + } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/connect/csharp/src/Org.OpenAPITools/Client/RetryConfiguration.cs new file mode 100644 index 000000000..f57367976 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -0,0 +1,31 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Polly; +using RestSharp; + +namespace Org.OpenAPITools.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public static class RetryConfiguration + { + /// + /// Retry policy + /// + public static Policy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static AsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/connect/csharp/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 000000000..72032b9fb --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/CancelSessionResponse.cs b/connect/csharp/src/Org.OpenAPITools/Model/CancelSessionResponse.cs new file mode 100644 index 000000000..a881df583 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/CancelSessionResponse.cs @@ -0,0 +1,82 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CancelSessionResponse + /// + [DataContract(Name = "CancelSessionResponse")] + public partial class CancelSessionResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// session. + public CancelSessionResponse(Session session = default(Session)) + { + this.Session = session; + } + + /// + /// Gets or Sets Session + /// + [DataMember(Name = "session", EmitDefaultValue = false)] + public Session Session { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CancelSessionResponse {\n"); + sb.Append(" Session: ").Append(Session).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/CreateSessionRequest.cs b/connect/csharp/src/Org.OpenAPITools/Model/CreateSessionRequest.cs new file mode 100644 index 000000000..b59037b69 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/CreateSessionRequest.cs @@ -0,0 +1,82 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CreateSessionRequest + /// + [DataContract(Name = "CreateSessionRequest")] + public partial class CreateSessionRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// verifications. + public CreateSessionRequest(List verifications = default(List)) + { + this.Verifications = verifications; + } + + /// + /// Gets or Sets Verifications + /// + [DataMember(Name = "verifications", EmitDefaultValue = true)] + public List Verifications { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateSessionRequest {\n"); + sb.Append(" Verifications: ").Append(Verifications).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/CreateSessionResponse.cs b/connect/csharp/src/Org.OpenAPITools/Model/CreateSessionResponse.cs new file mode 100644 index 000000000..c405189e2 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/CreateSessionResponse.cs @@ -0,0 +1,82 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CreateSessionResponse + /// + [DataContract(Name = "CreateSessionResponse")] + public partial class CreateSessionResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// session. + public CreateSessionResponse(Session session = default(Session)) + { + this.Session = session; + } + + /// + /// Gets or Sets Session + /// + [DataMember(Name = "session", EmitDefaultValue = false)] + public Session Session { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CreateSessionResponse {\n"); + sb.Append(" Session: ").Append(Session).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/DebugIdvProviderSelection.cs b/connect/csharp/src/Org.OpenAPITools/Model/DebugIdvProviderSelection.cs new file mode 100644 index 000000000..38439f08d --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/DebugIdvProviderSelection.cs @@ -0,0 +1,71 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines DebugIdvProviderSelection + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DebugIdvProviderSelection + { + /// + /// Enum Default for value: Default + /// + [EnumMember(Value = "Default")] + Default = 1, + + /// + /// Enum IdVerse for value: IdVerse + /// + [EnumMember(Value = "IdVerse")] + IdVerse = 2, + + /// + /// Enum Argos for value: Argos + /// + [EnumMember(Value = "Argos")] + Argos = 3, + + /// + /// Enum Clear for value: Clear + /// + [EnumMember(Value = "Clear")] + Clear = 4, + + /// + /// Enum Yoti for value: Yoti + /// + [EnumMember(Value = "Yoti")] + Yoti = 5, + + /// + /// Enum EidEasy for value: EidEasy + /// + [EnumMember(Value = "EidEasy")] + EidEasy = 6 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/FailureMessage.cs b/connect/csharp/src/Org.OpenAPITools/Model/FailureMessage.cs new file mode 100644 index 000000000..dd41211d2 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/FailureMessage.cs @@ -0,0 +1,82 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// FailureMessage + /// + [DataContract(Name = "FailureMessage")] + public partial class FailureMessage : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// message. + public FailureMessage(string message = default(string)) + { + this.Message = message; + } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FailureMessage {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/GetSessionResponseV1.cs b/connect/csharp/src/Org.OpenAPITools/Model/GetSessionResponseV1.cs new file mode 100644 index 000000000..53a9d7e65 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/GetSessionResponseV1.cs @@ -0,0 +1,82 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// GetSessionResponseV1 + /// + [DataContract(Name = "GetSessionResponseV1")] + public partial class GetSessionResponseV1 : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// session. + public GetSessionResponseV1(Session session = default(Session)) + { + this.Session = session; + } + + /// + /// Gets or Sets Session + /// + [DataMember(Name = "session", EmitDefaultValue = false)] + public Session Session { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GetSessionResponseV1 {\n"); + sb.Append(" Session: ").Append(Session).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/GovernmentIDOptions.cs b/connect/csharp/src/Org.OpenAPITools/Model/GovernmentIDOptions.cs new file mode 100644 index 000000000..c684f2f62 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/GovernmentIDOptions.cs @@ -0,0 +1,145 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// GovernmentIDOptions + /// + [DataContract(Name = "GovernmentIDOptions")] + public partial class GovernmentIDOptions : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// idNumber. + /// givenName. + /// familyName. + /// address. + /// dateOfBirth. + /// country. + /// issueDate. + /// expirationDate. + public GovernmentIDOptions(bool idNumber = default(bool), bool givenName = default(bool), bool familyName = default(bool), bool address = default(bool), bool dateOfBirth = default(bool), bool country = default(bool), bool issueDate = default(bool), bool expirationDate = default(bool)) + { + this.IdNumber = idNumber; + this.GivenName = givenName; + this.FamilyName = familyName; + this.Address = address; + this.DateOfBirth = dateOfBirth; + this.Country = country; + this.IssueDate = issueDate; + this.ExpirationDate = expirationDate; + } + + /// + /// Gets or Sets IdNumber + /// + [DataMember(Name = "idNumber", EmitDefaultValue = true)] + public bool IdNumber { get; set; } + + /// + /// Gets or Sets GivenName + /// + [DataMember(Name = "givenName", EmitDefaultValue = true)] + public bool GivenName { get; set; } + + /// + /// Gets or Sets FamilyName + /// + [DataMember(Name = "familyName", EmitDefaultValue = true)] + public bool FamilyName { get; set; } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", EmitDefaultValue = true)] + public bool Address { get; set; } + + /// + /// Gets or Sets DateOfBirth + /// + [DataMember(Name = "dateOfBirth", EmitDefaultValue = true)] + public bool DateOfBirth { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = true)] + public bool Country { get; set; } + + /// + /// Gets or Sets IssueDate + /// + [DataMember(Name = "issueDate", EmitDefaultValue = true)] + public bool IssueDate { get; set; } + + /// + /// Gets or Sets ExpirationDate + /// + [DataMember(Name = "expirationDate", EmitDefaultValue = true)] + public bool ExpirationDate { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GovernmentIDOptions {\n"); + sb.Append(" IdNumber: ").Append(IdNumber).Append("\n"); + sb.Append(" GivenName: ").Append(GivenName).Append("\n"); + sb.Append(" FamilyName: ").Append(FamilyName).Append("\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" DateOfBirth: ").Append(DateOfBirth).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" IssueDate: ").Append(IssueDate).Append("\n"); + sb.Append(" ExpirationDate: ").Append(ExpirationDate).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/IDVSessionState.cs b/connect/csharp/src/Org.OpenAPITools/Model/IDVSessionState.cs new file mode 100644 index 000000000..509250fe0 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/IDVSessionState.cs @@ -0,0 +1,71 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines IDVSessionState + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum IDVSessionState + { + /// + /// Enum IdvCreated for value: IdvCreated + /// + [EnumMember(Value = "IdvCreated")] + IdvCreated = 1, + + /// + /// Enum IdvInitiated for value: IdvInitiated + /// + [EnumMember(Value = "IdvInitiated")] + IdvInitiated = 2, + + /// + /// Enum IdvAuthenticating for value: IdvAuthenticating + /// + [EnumMember(Value = "IdvAuthenticating")] + IdvAuthenticating = 3, + + /// + /// Enum IdvInProgress for value: IdvInProgress + /// + [EnumMember(Value = "IdvInProgress")] + IdvInProgress = 4, + + /// + /// Enum IdvSuccess for value: IdvSuccess + /// + [EnumMember(Value = "IdvSuccess")] + IdvSuccess = 5, + + /// + /// Enum IdvFailed for value: IdvFailed + /// + [EnumMember(Value = "IdvFailed")] + IdvFailed = 6 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/ListSessionsRequest.cs b/connect/csharp/src/Org.OpenAPITools/Model/ListSessionsRequest.cs new file mode 100644 index 000000000..961d699a5 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/ListSessionsRequest.cs @@ -0,0 +1,138 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ListSessionsRequest + /// + [DataContract(Name = "ListSessionsRequest")] + public partial class ListSessionsRequest : IValidatableObject + { + + /// + /// Gets or Sets OrderBy + /// + [DataMember(Name = "orderBy", IsRequired = true, EmitDefaultValue = true)] + public SessionOrdering OrderBy { get; set; } + + /// + /// Gets or Sets OrderDirection + /// + [DataMember(Name = "orderDirection", IsRequired = true, EmitDefaultValue = true)] + public OrderDirection OrderDirection { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ListSessionsRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// orderBy (required). + /// orderDirection (required). + /// pageSize. + /// page. + public ListSessionsRequest(SessionOrdering orderBy = default(SessionOrdering), OrderDirection orderDirection = default(OrderDirection), int pageSize = default(int), int page = default(int)) + { + this.OrderBy = orderBy; + this.OrderDirection = orderDirection; + this.PageSize = pageSize; + this.Page = page; + } + + /// + /// Gets or Sets PageSize + /// + [DataMember(Name = "pageSize", EmitDefaultValue = false)] + public int PageSize { get; set; } + + /// + /// Gets or Sets Page + /// + [DataMember(Name = "page", EmitDefaultValue = false)] + public int Page { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ListSessionsRequest {\n"); + sb.Append(" OrderBy: ").Append(OrderBy).Append("\n"); + sb.Append(" OrderDirection: ").Append(OrderDirection).Append("\n"); + sb.Append(" PageSize: ").Append(PageSize).Append("\n"); + sb.Append(" Page: ").Append(Page).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PageSize (int) maximum + if (this.PageSize > (int)10) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PageSize, must be a value less than or equal to 10.", new [] { "PageSize" }); + } + + // PageSize (int) minimum + if (this.PageSize < (int)1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PageSize, must be a value greater than or equal to 1.", new [] { "PageSize" }); + } + + // Page (int) maximum + if (this.Page > (int)2147483647) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Page, must be a value less than or equal to 2147483647.", new [] { "Page" }); + } + + // Page (int) minimum + if (this.Page < (int)1) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Page, must be a value greater than or equal to 1.", new [] { "Page" }); + } + + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/ListSessionsResponseV1.cs b/connect/csharp/src/Org.OpenAPITools/Model/ListSessionsResponseV1.cs new file mode 100644 index 000000000..12bc703da --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/ListSessionsResponseV1.cs @@ -0,0 +1,82 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ListSessionsResponseV1 + /// + [DataContract(Name = "ListSessionsResponseV1")] + public partial class ListSessionsResponseV1 : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// sessions. + public ListSessionsResponseV1(List sessions = default(List)) + { + this.Sessions = sessions; + } + + /// + /// Gets or Sets Sessions + /// + [DataMember(Name = "sessions", EmitDefaultValue = true)] + public List Sessions { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ListSessionsResponseV1 {\n"); + sb.Append(" Sessions: ").Append(Sessions).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/NormalizedGovernmentIdData.cs b/connect/csharp/src/Org.OpenAPITools/Model/NormalizedGovernmentIdData.cs new file mode 100644 index 000000000..220dc08f5 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/NormalizedGovernmentIdData.cs @@ -0,0 +1,145 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NormalizedGovernmentIdData + /// + [DataContract(Name = "NormalizedGovernmentIdData")] + public partial class NormalizedGovernmentIdData : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// idNumber. + /// givenName. + /// familyName. + /// address. + /// dateOfBirth. + /// country. + /// issueDate. + /// expirationDate. + public NormalizedGovernmentIdData(string idNumber = default(string), string givenName = default(string), string familyName = default(string), string address = default(string), string dateOfBirth = default(string), string country = default(string), string issueDate = default(string), string expirationDate = default(string)) + { + this.IdNumber = idNumber; + this.GivenName = givenName; + this.FamilyName = familyName; + this.Address = address; + this.DateOfBirth = dateOfBirth; + this.Country = country; + this.IssueDate = issueDate; + this.ExpirationDate = expirationDate; + } + + /// + /// Gets or Sets IdNumber + /// + [DataMember(Name = "idNumber", EmitDefaultValue = true)] + public string IdNumber { get; set; } + + /// + /// Gets or Sets GivenName + /// + [DataMember(Name = "givenName", EmitDefaultValue = true)] + public string GivenName { get; set; } + + /// + /// Gets or Sets FamilyName + /// + [DataMember(Name = "familyName", EmitDefaultValue = true)] + public string FamilyName { get; set; } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", EmitDefaultValue = true)] + public string Address { get; set; } + + /// + /// Gets or Sets DateOfBirth + /// + [DataMember(Name = "dateOfBirth", EmitDefaultValue = true)] + public string DateOfBirth { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = true)] + public string Country { get; set; } + + /// + /// Gets or Sets IssueDate + /// + [DataMember(Name = "issueDate", EmitDefaultValue = true)] + public string IssueDate { get; set; } + + /// + /// Gets or Sets ExpirationDate + /// + [DataMember(Name = "expirationDate", EmitDefaultValue = true)] + public string ExpirationDate { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NormalizedGovernmentIdData {\n"); + sb.Append(" IdNumber: ").Append(IdNumber).Append("\n"); + sb.Append(" GivenName: ").Append(GivenName).Append("\n"); + sb.Append(" FamilyName: ").Append(FamilyName).Append("\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" DateOfBirth: ").Append(DateOfBirth).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" IssueDate: ").Append(IssueDate).Append("\n"); + sb.Append(" ExpirationDate: ").Append(ExpirationDate).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/OrderDirection.cs b/connect/csharp/src/Org.OpenAPITools/Model/OrderDirection.cs new file mode 100644 index 000000000..c078c54a3 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/OrderDirection.cs @@ -0,0 +1,47 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OrderDirection + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OrderDirection + { + /// + /// Enum Ascending for value: Ascending + /// + [EnumMember(Value = "Ascending")] + Ascending = 1, + + /// + /// Enum Descending for value: Descending + /// + [EnumMember(Value = "Descending")] + Descending = 2 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/RequestedVerification.cs b/connect/csharp/src/Org.OpenAPITools/Model/RequestedVerification.cs new file mode 100644 index 000000000..272d2c9be --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/RequestedVerification.cs @@ -0,0 +1,91 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// RequestedVerification + /// + [DataContract(Name = "RequestedVerification")] + public partial class RequestedVerification : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public VerificationType? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// type. + /// governmentIdOptions. + public RequestedVerification(VerificationType? type = default(VerificationType?), GovernmentIDOptions governmentIdOptions = default(GovernmentIDOptions)) + { + this.Type = type; + this.GovernmentIdOptions = governmentIdOptions; + } + + /// + /// Gets or Sets GovernmentIdOptions + /// + [DataMember(Name = "governmentIdOptions", EmitDefaultValue = false)] + public GovernmentIDOptions GovernmentIdOptions { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RequestedVerification {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" GovernmentIdOptions: ").Append(GovernmentIdOptions).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/Session.cs b/connect/csharp/src/Org.OpenAPITools/Model/Session.cs new file mode 100644 index 000000000..35f9a7b0e --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/Session.cs @@ -0,0 +1,145 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Session + /// + [DataContract(Name = "Session")] + public partial class Session : IValidatableObject + { + + /// + /// Gets or Sets State + /// + [DataMember(Name = "state", EmitDefaultValue = false)] + public IDVSessionState? State { get; set; } + + /// + /// Gets or Sets FailCode + /// + [DataMember(Name = "failCode", EmitDefaultValue = false)] + public SessionFailCode? FailCode { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// clientToken. + /// state. + /// verifications. + /// failCode. + /// resultVp. + /// created. + /// updated. + public Session(string id = default(string), string clientToken = default(string), IDVSessionState? state = default(IDVSessionState?), Dictionary verifications = default(Dictionary), SessionFailCode? failCode = default(SessionFailCode?), string resultVp = default(string), long created = default(long), long updated = default(long)) + { + this.Id = id; + this.ClientToken = clientToken; + this.State = state; + this.Verifications = verifications; + this.FailCode = failCode; + this.ResultVp = resultVp; + this.Created = created; + this.Updated = updated; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets ClientToken + /// + [DataMember(Name = "clientToken", EmitDefaultValue = true)] + public string ClientToken { get; set; } + + /// + /// Gets or Sets Verifications + /// + [DataMember(Name = "verifications", EmitDefaultValue = true)] + public Dictionary Verifications { get; set; } + + /// + /// Gets or Sets ResultVp + /// + [DataMember(Name = "resultVp", EmitDefaultValue = true)] + public string ResultVp { get; set; } + + /// + /// Gets or Sets Created + /// + [DataMember(Name = "created", EmitDefaultValue = false)] + public long Created { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = false)] + public long Updated { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Session {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" ClientToken: ").Append(ClientToken).Append("\n"); + sb.Append(" State: ").Append(State).Append("\n"); + sb.Append(" Verifications: ").Append(Verifications).Append("\n"); + sb.Append(" FailCode: ").Append(FailCode).Append("\n"); + sb.Append(" ResultVp: ").Append(ResultVp).Append("\n"); + sb.Append(" Created: ").Append(Created).Append("\n"); + sb.Append(" Updated: ").Append(Updated).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/SessionFailCode.cs b/connect/csharp/src/Org.OpenAPITools/Model/SessionFailCode.cs new file mode 100644 index 000000000..2ac576f69 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/SessionFailCode.cs @@ -0,0 +1,77 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines SessionFailCode + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SessionFailCode + { + /// + /// Enum SessionFailNone for value: SessionFailNone + /// + [EnumMember(Value = "SessionFailNone")] + SessionFailNone = 1, + + /// + /// Enum SessionFailInternal for value: SessionFailInternal + /// + [EnumMember(Value = "SessionFailInternal")] + SessionFailInternal = 2, + + /// + /// Enum SessionFailVerificationFailed for value: SessionFailVerificationFailed + /// + [EnumMember(Value = "SessionFailVerificationFailed")] + SessionFailVerificationFailed = 3, + + /// + /// Enum SessionFailAuthentication for value: SessionFailAuthentication + /// + [EnumMember(Value = "SessionFailAuthentication")] + SessionFailAuthentication = 4, + + /// + /// Enum SessionFailExpired for value: SessionFailExpired + /// + [EnumMember(Value = "SessionFailExpired")] + SessionFailExpired = 5, + + /// + /// Enum SessionFailUserCanceled for value: SessionFailUserCanceled + /// + [EnumMember(Value = "SessionFailUserCanceled")] + SessionFailUserCanceled = 6, + + /// + /// Enum SessionFailRpcCanceled for value: SessionFailRpcCanceled + /// + [EnumMember(Value = "SessionFailRpcCanceled")] + SessionFailRpcCanceled = 7 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/SessionOrdering.cs b/connect/csharp/src/Org.OpenAPITools/Model/SessionOrdering.cs new file mode 100644 index 000000000..6f5b5e8bb --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/SessionOrdering.cs @@ -0,0 +1,53 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines SessionOrdering + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SessionOrdering + { + /// + /// Enum Created for value: Created + /// + [EnumMember(Value = "Created")] + Created = 1, + + /// + /// Enum Updated for value: Updated + /// + [EnumMember(Value = "Updated")] + Updated = 2, + + /// + /// Enum State for value: State + /// + [EnumMember(Value = "State")] + State = 3 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/ValidationResult.cs b/connect/csharp/src/Org.OpenAPITools/Model/ValidationResult.cs new file mode 100644 index 000000000..cc8e9d929 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/ValidationResult.cs @@ -0,0 +1,97 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ValidationResult + /// + [DataContract(Name = "ValidationResult")] + public partial class ValidationResult : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// errorMessage. + public ValidationResult(string errorMessage = default(string)) + { + this.ErrorMessage = errorMessage; + } + + /// + /// Gets or Sets MemberNames + /// + [DataMember(Name = "memberNames", EmitDefaultValue = true)] + public List MemberNames { get; private set; } + + /// + /// Returns false as MemberNames should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeMemberNames() + { + return false; + } + /// + /// Gets or Sets ErrorMessage + /// + [DataMember(Name = "errorMessage", EmitDefaultValue = true)] + public string ErrorMessage { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ValidationResult {\n"); + sb.Append(" MemberNames: ").Append(MemberNames).Append("\n"); + sb.Append(" ErrorMessage: ").Append(ErrorMessage).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/Verification.cs b/connect/csharp/src/Org.OpenAPITools/Model/Verification.cs new file mode 100644 index 000000000..276f7c304 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/Verification.cs @@ -0,0 +1,145 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Verification + /// + [DataContract(Name = "Verification")] + public partial class Verification : IValidatableObject + { + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public VerificationType? Type { get; set; } + + /// + /// Gets or Sets State + /// + [DataMember(Name = "state", EmitDefaultValue = false)] + public VerificationState? State { get; set; } + + /// + /// Gets or Sets FailCode + /// + [DataMember(Name = "failCode", EmitDefaultValue = false)] + public VerificationFailCode? FailCode { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// type. + /// state. + /// failCode. + /// reused. + /// updated. + /// governmentIdOptions. + /// normalizedGovernmentIdData. + public Verification(string id = default(string), VerificationType? type = default(VerificationType?), VerificationState? state = default(VerificationState?), VerificationFailCode? failCode = default(VerificationFailCode?), bool reused = default(bool), long updated = default(long), GovernmentIDOptions governmentIdOptions = default(GovernmentIDOptions), NormalizedGovernmentIdData normalizedGovernmentIdData = default(NormalizedGovernmentIdData)) + { + this.Id = id; + this.Type = type; + this.State = state; + this.FailCode = failCode; + this.Reused = reused; + this.Updated = updated; + this.GovernmentIdOptions = governmentIdOptions; + this.NormalizedGovernmentIdData = normalizedGovernmentIdData; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets Reused + /// + [DataMember(Name = "reused", EmitDefaultValue = true)] + public bool Reused { get; set; } + + /// + /// Gets or Sets Updated + /// + [DataMember(Name = "updated", EmitDefaultValue = false)] + public long Updated { get; set; } + + /// + /// Gets or Sets GovernmentIdOptions + /// + [DataMember(Name = "governmentIdOptions", EmitDefaultValue = false)] + public GovernmentIDOptions GovernmentIdOptions { get; set; } + + /// + /// Gets or Sets NormalizedGovernmentIdData + /// + [DataMember(Name = "normalizedGovernmentIdData", EmitDefaultValue = false)] + public NormalizedGovernmentIdData NormalizedGovernmentIdData { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Verification {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" State: ").Append(State).Append("\n"); + sb.Append(" FailCode: ").Append(FailCode).Append("\n"); + sb.Append(" Reused: ").Append(Reused).Append("\n"); + sb.Append(" Updated: ").Append(Updated).Append("\n"); + sb.Append(" GovernmentIdOptions: ").Append(GovernmentIdOptions).Append("\n"); + sb.Append(" NormalizedGovernmentIdData: ").Append(NormalizedGovernmentIdData).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/VerificationFailCode.cs b/connect/csharp/src/Org.OpenAPITools/Model/VerificationFailCode.cs new file mode 100644 index 000000000..716549570 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/VerificationFailCode.cs @@ -0,0 +1,65 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines VerificationFailCode + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum VerificationFailCode + { + /// + /// Enum VerificationFailNone for value: VerificationFailNone + /// + [EnumMember(Value = "VerificationFailNone")] + VerificationFailNone = 1, + + /// + /// Enum VerificationFailInternal for value: VerificationFailInternal + /// + [EnumMember(Value = "VerificationFailInternal")] + VerificationFailInternal = 2, + + /// + /// Enum VerificationFailInvalidImage for value: VerificationFailInvalidImage + /// + [EnumMember(Value = "VerificationFailInvalidImage")] + VerificationFailInvalidImage = 3, + + /// + /// Enum VerificationFailInauthentic for value: VerificationFailInauthentic + /// + [EnumMember(Value = "VerificationFailInauthentic")] + VerificationFailInauthentic = 4, + + /// + /// Enum VerificationFailUnsupportedDocument for value: VerificationFailUnsupportedDocument + /// + [EnumMember(Value = "VerificationFailUnsupportedDocument")] + VerificationFailUnsupportedDocument = 5 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/VerificationState.cs b/connect/csharp/src/Org.OpenAPITools/Model/VerificationState.cs new file mode 100644 index 000000000..e00602a8b --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/VerificationState.cs @@ -0,0 +1,53 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines VerificationState + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum VerificationState + { + /// + /// Enum VerificationPending for value: VerificationPending + /// + [EnumMember(Value = "VerificationPending")] + VerificationPending = 1, + + /// + /// Enum VerificationSuccess for value: VerificationSuccess + /// + [EnumMember(Value = "VerificationSuccess")] + VerificationSuccess = 2, + + /// + /// Enum VerificationFailed for value: VerificationFailed + /// + [EnumMember(Value = "VerificationFailed")] + VerificationFailed = 3 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Model/VerificationType.cs b/connect/csharp/src/Org.OpenAPITools/Model/VerificationType.cs new file mode 100644 index 000000000..2cdec8503 --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Model/VerificationType.cs @@ -0,0 +1,41 @@ +/* + * Connect API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines VerificationType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum VerificationType + { + /// + /// Enum GovernmentId for value: GovernmentId + /// + [EnumMember(Value = "GovernmentId")] + GovernmentId = 1 + } + +} diff --git a/connect/csharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/connect/csharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000..dbb65621c --- /dev/null +++ b/connect/csharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,37 @@ + + + + false + net8.0 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + annotations + false + + + + + + + + + + + + + + + + diff --git a/connect/typescript/.openapi-generator-ignore b/connect/typescript/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/connect/typescript/.openapi-generator-ignore @@ -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 diff --git a/connect/typescript/.openapi-generator/FILES b/connect/typescript/.openapi-generator/FILES new file mode 100644 index 000000000..699a9a2ca --- /dev/null +++ b/connect/typescript/.openapi-generator/FILES @@ -0,0 +1,27 @@ +.openapi-generator-ignore +apis/SessionApi.ts +apis/index.ts +index.ts +models/CancelSessionResponse.ts +models/CreateSessionRequest.ts +models/CreateSessionResponse.ts +models/DebugIdvProviderSelection.ts +models/FailureMessage.ts +models/GetSessionResponseV1.ts +models/GovernmentIDOptions.ts +models/IDVSessionState.ts +models/ListSessionsRequest.ts +models/ListSessionsResponseV1.ts +models/NormalizedGovernmentIdData.ts +models/OrderDirection.ts +models/RequestedVerification.ts +models/Session.ts +models/SessionFailCode.ts +models/SessionOrdering.ts +models/ValidationResult.ts +models/Verification.ts +models/VerificationFailCode.ts +models/VerificationState.ts +models/VerificationType.ts +models/index.ts +runtime.ts diff --git a/connect/typescript/.openapi-generator/VERSION b/connect/typescript/.openapi-generator/VERSION new file mode 100644 index 000000000..7e7b8b9bc --- /dev/null +++ b/connect/typescript/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.7.0-SNAPSHOT diff --git a/connect/typescript/apis/SessionApi.ts b/connect/typescript/apis/SessionApi.ts new file mode 100644 index 000000000..3d08ef242 --- /dev/null +++ b/connect/typescript/apis/SessionApi.ts @@ -0,0 +1,257 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CancelSessionResponse, + CreateSessionRequest, + CreateSessionResponse, + FailureMessage, + GetSessionResponseV1, + ListSessionsRequest, + ListSessionsResponseV1, + ValidationResult, +} from '../models/index'; +import { + CancelSessionResponseFromJSON, + CancelSessionResponseToJSON, + CreateSessionRequestFromJSON, + CreateSessionRequestToJSON, + CreateSessionResponseFromJSON, + CreateSessionResponseToJSON, + FailureMessageFromJSON, + FailureMessageToJSON, + GetSessionResponseV1FromJSON, + GetSessionResponseV1ToJSON, + ListSessionsRequestFromJSON, + ListSessionsRequestToJSON, + ListSessionsResponseV1FromJSON, + ListSessionsResponseV1ToJSON, + ValidationResultFromJSON, + ValidationResultToJSON, +} from '../models/index'; + +export interface SessionCancelSessionRequest { + trinsicAuthorization: string; + sessionId?: string; +} + +export interface SessionCreateSessionRequest { + trinsicAuthorization: string; + createSessionRequest?: CreateSessionRequest; +} + +export interface SessionGetSessionRequest { + trinsicAuthorization: string; + sessionId?: string; +} + +export interface SessionListSessionsRequest { + trinsicAuthorization: string; + listSessionsRequest?: ListSessionsRequest; +} + +/** + * + */ +export class SessionApi extends runtime.BaseAPI { + + /** + */ + async sessionCancelSessionRaw(requestParameters: SessionCancelSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['trinsicAuthorization'] == null) { + throw new runtime.RequiredError( + 'trinsicAuthorization', + 'Required parameter "trinsicAuthorization" was null or undefined when calling sessionCancelSession().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['sessionId'] != null) { + queryParameters['sessionId'] = requestParameters['sessionId']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['trinsicAuthorization'] != null) { + headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("Bearer", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/sessions/cancel`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CancelSessionResponseFromJSON(jsonValue)); + } + + /** + */ + async sessionCancelSession(requestParameters: SessionCancelSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sessionCancelSessionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async sessionCreateSessionRaw(requestParameters: SessionCreateSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['trinsicAuthorization'] == null) { + throw new runtime.RequiredError( + 'trinsicAuthorization', + 'Required parameter "trinsicAuthorization" was null or undefined when calling sessionCreateSession().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['trinsicAuthorization'] != null) { + headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("Bearer", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/sessions`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateSessionRequestToJSON(requestParameters['createSessionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateSessionResponseFromJSON(jsonValue)); + } + + /** + */ + async sessionCreateSession(requestParameters: SessionCreateSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sessionCreateSessionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async sessionGetSessionRaw(requestParameters: SessionGetSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['trinsicAuthorization'] == null) { + throw new runtime.RequiredError( + 'trinsicAuthorization', + 'Required parameter "trinsicAuthorization" was null or undefined when calling sessionGetSession().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['sessionId'] != null) { + queryParameters['sessionId'] = requestParameters['sessionId']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['trinsicAuthorization'] != null) { + headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("Bearer", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/sessions/get`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetSessionResponseV1FromJSON(jsonValue)); + } + + /** + */ + async sessionGetSession(requestParameters: SessionGetSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sessionGetSessionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async sessionListSessionsRaw(requestParameters: SessionListSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['trinsicAuthorization'] == null) { + throw new runtime.RequiredError( + 'trinsicAuthorization', + 'Required parameter "trinsicAuthorization" was null or undefined when calling sessionListSessions().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['trinsicAuthorization'] != null) { + headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("Bearer", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/v1/sessions/list`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ListSessionsRequestToJSON(requestParameters['listSessionsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ListSessionsResponseV1FromJSON(jsonValue)); + } + + /** + */ + async sessionListSessions(requestParameters: SessionListSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sessionListSessionsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/connect/typescript/apis/index.ts b/connect/typescript/apis/index.ts new file mode 100644 index 000000000..73fbda798 --- /dev/null +++ b/connect/typescript/apis/index.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './SessionApi'; diff --git a/connect/typescript/index.ts b/connect/typescript/index.ts new file mode 100644 index 000000000..bebe8bbbe --- /dev/null +++ b/connect/typescript/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/connect/typescript/models/CancelSessionResponse.ts b/connect/typescript/models/CancelSessionResponse.ts new file mode 100644 index 000000000..b79d3aa83 --- /dev/null +++ b/connect/typescript/models/CancelSessionResponse.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Session } from './Session'; +import { + SessionFromJSON, + SessionFromJSONTyped, + SessionToJSON, +} from './Session'; + +/** + * + * @export + * @interface CancelSessionResponse + */ +export interface CancelSessionResponse { + /** + * + * @type {Session} + * @memberof CancelSessionResponse + */ + session?: Session; +} + +/** + * Check if a given object implements the CancelSessionResponse interface. + */ +export function instanceOfCancelSessionResponse(value: object): value is CancelSessionResponse { + return true; +} + +export function CancelSessionResponseFromJSON(json: any): CancelSessionResponse { + return CancelSessionResponseFromJSONTyped(json, false); +} + +export function CancelSessionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CancelSessionResponse { + if (json == null) { + return json; + } + return { + + 'session': json['session'] == null ? undefined : SessionFromJSON(json['session']), + }; +} + +export function CancelSessionResponseToJSON(value?: CancelSessionResponse | null): any { + if (value == null) { + return value; + } + return { + + 'session': SessionToJSON(value['session']), + }; +} + diff --git a/connect/typescript/models/CreateSessionRequest.ts b/connect/typescript/models/CreateSessionRequest.ts new file mode 100644 index 000000000..3e2f9a30d --- /dev/null +++ b/connect/typescript/models/CreateSessionRequest.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { RequestedVerification } from './RequestedVerification'; +import { + RequestedVerificationFromJSON, + RequestedVerificationFromJSONTyped, + RequestedVerificationToJSON, +} from './RequestedVerification'; + +/** + * + * @export + * @interface CreateSessionRequest + */ +export interface CreateSessionRequest { + /** + * + * @type {Array} + * @memberof CreateSessionRequest + */ + verifications?: Array; +} + +/** + * Check if a given object implements the CreateSessionRequest interface. + */ +export function instanceOfCreateSessionRequest(value: object): value is CreateSessionRequest { + return true; +} + +export function CreateSessionRequestFromJSON(json: any): CreateSessionRequest { + return CreateSessionRequestFromJSONTyped(json, false); +} + +export function CreateSessionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSessionRequest { + if (json == null) { + return json; + } + return { + + 'verifications': json['verifications'] == null ? undefined : ((json['verifications'] as Array).map(RequestedVerificationFromJSON)), + }; +} + +export function CreateSessionRequestToJSON(value?: CreateSessionRequest | null): any { + if (value == null) { + return value; + } + return { + + 'verifications': value['verifications'] == null ? undefined : ((value['verifications'] as Array).map(RequestedVerificationToJSON)), + }; +} + diff --git a/connect/typescript/models/CreateSessionResponse.ts b/connect/typescript/models/CreateSessionResponse.ts new file mode 100644 index 000000000..48c63c058 --- /dev/null +++ b/connect/typescript/models/CreateSessionResponse.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Session } from './Session'; +import { + SessionFromJSON, + SessionFromJSONTyped, + SessionToJSON, +} from './Session'; + +/** + * + * @export + * @interface CreateSessionResponse + */ +export interface CreateSessionResponse { + /** + * + * @type {Session} + * @memberof CreateSessionResponse + */ + session?: Session; +} + +/** + * Check if a given object implements the CreateSessionResponse interface. + */ +export function instanceOfCreateSessionResponse(value: object): value is CreateSessionResponse { + return true; +} + +export function CreateSessionResponseFromJSON(json: any): CreateSessionResponse { + return CreateSessionResponseFromJSONTyped(json, false); +} + +export function CreateSessionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSessionResponse { + if (json == null) { + return json; + } + return { + + 'session': json['session'] == null ? undefined : SessionFromJSON(json['session']), + }; +} + +export function CreateSessionResponseToJSON(value?: CreateSessionResponse | null): any { + if (value == null) { + return value; + } + return { + + 'session': SessionToJSON(value['session']), + }; +} + diff --git a/connect/typescript/models/DebugIdvProviderSelection.ts b/connect/typescript/models/DebugIdvProviderSelection.ts new file mode 100644 index 000000000..c4a6c0809 --- /dev/null +++ b/connect/typescript/models/DebugIdvProviderSelection.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const DebugIdvProviderSelection = { + Default: 'Default', + IdVerse: 'IdVerse', + Argos: 'Argos', + Clear: 'Clear', + Yoti: 'Yoti', + EidEasy: 'EidEasy' +} as const; +export type DebugIdvProviderSelection = typeof DebugIdvProviderSelection[keyof typeof DebugIdvProviderSelection]; + + +export function instanceOfDebugIdvProviderSelection(value: any): boolean { + for (const key in DebugIdvProviderSelection) { + if (Object.prototype.hasOwnProperty.call(DebugIdvProviderSelection, key)) { + if ((DebugIdvProviderSelection as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function DebugIdvProviderSelectionFromJSON(json: any): DebugIdvProviderSelection { + return DebugIdvProviderSelectionFromJSONTyped(json, false); +} + +export function DebugIdvProviderSelectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DebugIdvProviderSelection { + return json as DebugIdvProviderSelection; +} + +export function DebugIdvProviderSelectionToJSON(value?: DebugIdvProviderSelection | null): any { + return value as any; +} + diff --git a/connect/typescript/models/FailureMessage.ts b/connect/typescript/models/FailureMessage.ts new file mode 100644 index 000000000..f521d2eaa --- /dev/null +++ b/connect/typescript/models/FailureMessage.ts @@ -0,0 +1,60 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface FailureMessage + */ +export interface FailureMessage { + /** + * + * @type {string} + * @memberof FailureMessage + */ + message?: string; +} + +/** + * Check if a given object implements the FailureMessage interface. + */ +export function instanceOfFailureMessage(value: object): value is FailureMessage { + return true; +} + +export function FailureMessageFromJSON(json: any): FailureMessage { + return FailureMessageFromJSONTyped(json, false); +} + +export function FailureMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): FailureMessage { + if (json == null) { + return json; + } + return { + + 'message': json['message'] == null ? undefined : json['message'], + }; +} + +export function FailureMessageToJSON(value?: FailureMessage | null): any { + if (value == null) { + return value; + } + return { + + 'message': value['message'], + }; +} + diff --git a/connect/typescript/models/GetSessionResponseV1.ts b/connect/typescript/models/GetSessionResponseV1.ts new file mode 100644 index 000000000..0a87e38d9 --- /dev/null +++ b/connect/typescript/models/GetSessionResponseV1.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Session } from './Session'; +import { + SessionFromJSON, + SessionFromJSONTyped, + SessionToJSON, +} from './Session'; + +/** + * + * @export + * @interface GetSessionResponseV1 + */ +export interface GetSessionResponseV1 { + /** + * + * @type {Session} + * @memberof GetSessionResponseV1 + */ + session?: Session; +} + +/** + * Check if a given object implements the GetSessionResponseV1 interface. + */ +export function instanceOfGetSessionResponseV1(value: object): value is GetSessionResponseV1 { + return true; +} + +export function GetSessionResponseV1FromJSON(json: any): GetSessionResponseV1 { + return GetSessionResponseV1FromJSONTyped(json, false); +} + +export function GetSessionResponseV1FromJSONTyped(json: any, ignoreDiscriminator: boolean): GetSessionResponseV1 { + if (json == null) { + return json; + } + return { + + 'session': json['session'] == null ? undefined : SessionFromJSON(json['session']), + }; +} + +export function GetSessionResponseV1ToJSON(value?: GetSessionResponseV1 | null): any { + if (value == null) { + return value; + } + return { + + 'session': SessionToJSON(value['session']), + }; +} + diff --git a/connect/typescript/models/GovernmentIDOptions.ts b/connect/typescript/models/GovernmentIDOptions.ts new file mode 100644 index 000000000..d77999913 --- /dev/null +++ b/connect/typescript/models/GovernmentIDOptions.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GovernmentIDOptions + */ +export interface GovernmentIDOptions { + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + idNumber?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + givenName?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + familyName?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + address?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + dateOfBirth?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + country?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + issueDate?: boolean; + /** + * + * @type {boolean} + * @memberof GovernmentIDOptions + */ + expirationDate?: boolean; +} + +/** + * Check if a given object implements the GovernmentIDOptions interface. + */ +export function instanceOfGovernmentIDOptions(value: object): value is GovernmentIDOptions { + return true; +} + +export function GovernmentIDOptionsFromJSON(json: any): GovernmentIDOptions { + return GovernmentIDOptionsFromJSONTyped(json, false); +} + +export function GovernmentIDOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): GovernmentIDOptions { + if (json == null) { + return json; + } + return { + + 'idNumber': json['idNumber'] == null ? undefined : json['idNumber'], + 'givenName': json['givenName'] == null ? undefined : json['givenName'], + 'familyName': json['familyName'] == null ? undefined : json['familyName'], + 'address': json['address'] == null ? undefined : json['address'], + 'dateOfBirth': json['dateOfBirth'] == null ? undefined : json['dateOfBirth'], + 'country': json['country'] == null ? undefined : json['country'], + 'issueDate': json['issueDate'] == null ? undefined : json['issueDate'], + 'expirationDate': json['expirationDate'] == null ? undefined : json['expirationDate'], + }; +} + +export function GovernmentIDOptionsToJSON(value?: GovernmentIDOptions | null): any { + if (value == null) { + return value; + } + return { + + 'idNumber': value['idNumber'], + 'givenName': value['givenName'], + 'familyName': value['familyName'], + 'address': value['address'], + 'dateOfBirth': value['dateOfBirth'], + 'country': value['country'], + 'issueDate': value['issueDate'], + 'expirationDate': value['expirationDate'], + }; +} + diff --git a/connect/typescript/models/IDVSessionState.ts b/connect/typescript/models/IDVSessionState.ts new file mode 100644 index 000000000..4418be328 --- /dev/null +++ b/connect/typescript/models/IDVSessionState.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const IDVSessionState = { + IdvCreated: 'IdvCreated', + IdvInitiated: 'IdvInitiated', + IdvAuthenticating: 'IdvAuthenticating', + IdvInProgress: 'IdvInProgress', + IdvSuccess: 'IdvSuccess', + IdvFailed: 'IdvFailed' +} as const; +export type IDVSessionState = typeof IDVSessionState[keyof typeof IDVSessionState]; + + +export function instanceOfIDVSessionState(value: any): boolean { + for (const key in IDVSessionState) { + if (Object.prototype.hasOwnProperty.call(IDVSessionState, key)) { + if ((IDVSessionState as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function IDVSessionStateFromJSON(json: any): IDVSessionState { + return IDVSessionStateFromJSONTyped(json, false); +} + +export function IDVSessionStateFromJSONTyped(json: any, ignoreDiscriminator: boolean): IDVSessionState { + return json as IDVSessionState; +} + +export function IDVSessionStateToJSON(value?: IDVSessionState | null): any { + return value as any; +} + diff --git a/connect/typescript/models/ListSessionsRequest.ts b/connect/typescript/models/ListSessionsRequest.ts new file mode 100644 index 000000000..e0823da26 --- /dev/null +++ b/connect/typescript/models/ListSessionsRequest.ts @@ -0,0 +1,99 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { SessionOrdering } from './SessionOrdering'; +import { + SessionOrderingFromJSON, + SessionOrderingFromJSONTyped, + SessionOrderingToJSON, +} from './SessionOrdering'; +import type { OrderDirection } from './OrderDirection'; +import { + OrderDirectionFromJSON, + OrderDirectionFromJSONTyped, + OrderDirectionToJSON, +} from './OrderDirection'; + +/** + * + * @export + * @interface ListSessionsRequest + */ +export interface ListSessionsRequest { + /** + * + * @type {SessionOrdering} + * @memberof ListSessionsRequest + */ + orderBy: SessionOrdering; + /** + * + * @type {OrderDirection} + * @memberof ListSessionsRequest + */ + orderDirection: OrderDirection; + /** + * + * @type {number} + * @memberof ListSessionsRequest + */ + pageSize?: number; + /** + * + * @type {number} + * @memberof ListSessionsRequest + */ + page?: number; +} + +/** + * Check if a given object implements the ListSessionsRequest interface. + */ +export function instanceOfListSessionsRequest(value: object): value is ListSessionsRequest { + if (!('orderBy' in value) || value['orderBy'] === undefined) return false; + if (!('orderDirection' in value) || value['orderDirection'] === undefined) return false; + return true; +} + +export function ListSessionsRequestFromJSON(json: any): ListSessionsRequest { + return ListSessionsRequestFromJSONTyped(json, false); +} + +export function ListSessionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListSessionsRequest { + if (json == null) { + return json; + } + return { + + 'orderBy': SessionOrderingFromJSON(json['orderBy']), + 'orderDirection': OrderDirectionFromJSON(json['orderDirection']), + 'pageSize': json['pageSize'] == null ? undefined : json['pageSize'], + 'page': json['page'] == null ? undefined : json['page'], + }; +} + +export function ListSessionsRequestToJSON(value?: ListSessionsRequest | null): any { + if (value == null) { + return value; + } + return { + + 'orderBy': SessionOrderingToJSON(value['orderBy']), + 'orderDirection': OrderDirectionToJSON(value['orderDirection']), + 'pageSize': value['pageSize'], + 'page': value['page'], + }; +} + diff --git a/connect/typescript/models/ListSessionsResponseV1.ts b/connect/typescript/models/ListSessionsResponseV1.ts new file mode 100644 index 000000000..bc825bf76 --- /dev/null +++ b/connect/typescript/models/ListSessionsResponseV1.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Session } from './Session'; +import { + SessionFromJSON, + SessionFromJSONTyped, + SessionToJSON, +} from './Session'; + +/** + * + * @export + * @interface ListSessionsResponseV1 + */ +export interface ListSessionsResponseV1 { + /** + * + * @type {Array} + * @memberof ListSessionsResponseV1 + */ + sessions?: Array; +} + +/** + * Check if a given object implements the ListSessionsResponseV1 interface. + */ +export function instanceOfListSessionsResponseV1(value: object): value is ListSessionsResponseV1 { + return true; +} + +export function ListSessionsResponseV1FromJSON(json: any): ListSessionsResponseV1 { + return ListSessionsResponseV1FromJSONTyped(json, false); +} + +export function ListSessionsResponseV1FromJSONTyped(json: any, ignoreDiscriminator: boolean): ListSessionsResponseV1 { + if (json == null) { + return json; + } + return { + + 'sessions': json['sessions'] == null ? undefined : ((json['sessions'] as Array).map(SessionFromJSON)), + }; +} + +export function ListSessionsResponseV1ToJSON(value?: ListSessionsResponseV1 | null): any { + if (value == null) { + return value; + } + return { + + 'sessions': value['sessions'] == null ? undefined : ((value['sessions'] as Array).map(SessionToJSON)), + }; +} + diff --git a/connect/typescript/models/NormalizedGovernmentIdData.ts b/connect/typescript/models/NormalizedGovernmentIdData.ts new file mode 100644 index 000000000..b5ffeabb9 --- /dev/null +++ b/connect/typescript/models/NormalizedGovernmentIdData.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface NormalizedGovernmentIdData + */ +export interface NormalizedGovernmentIdData { + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + idNumber?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + givenName?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + familyName?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + address?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + dateOfBirth?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + country?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + issueDate?: string; + /** + * + * @type {string} + * @memberof NormalizedGovernmentIdData + */ + expirationDate?: string; +} + +/** + * Check if a given object implements the NormalizedGovernmentIdData interface. + */ +export function instanceOfNormalizedGovernmentIdData(value: object): value is NormalizedGovernmentIdData { + return true; +} + +export function NormalizedGovernmentIdDataFromJSON(json: any): NormalizedGovernmentIdData { + return NormalizedGovernmentIdDataFromJSONTyped(json, false); +} + +export function NormalizedGovernmentIdDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): NormalizedGovernmentIdData { + if (json == null) { + return json; + } + return { + + 'idNumber': json['idNumber'] == null ? undefined : json['idNumber'], + 'givenName': json['givenName'] == null ? undefined : json['givenName'], + 'familyName': json['familyName'] == null ? undefined : json['familyName'], + 'address': json['address'] == null ? undefined : json['address'], + 'dateOfBirth': json['dateOfBirth'] == null ? undefined : json['dateOfBirth'], + 'country': json['country'] == null ? undefined : json['country'], + 'issueDate': json['issueDate'] == null ? undefined : json['issueDate'], + 'expirationDate': json['expirationDate'] == null ? undefined : json['expirationDate'], + }; +} + +export function NormalizedGovernmentIdDataToJSON(value?: NormalizedGovernmentIdData | null): any { + if (value == null) { + return value; + } + return { + + 'idNumber': value['idNumber'], + 'givenName': value['givenName'], + 'familyName': value['familyName'], + 'address': value['address'], + 'dateOfBirth': value['dateOfBirth'], + 'country': value['country'], + 'issueDate': value['issueDate'], + 'expirationDate': value['expirationDate'], + }; +} + diff --git a/connect/typescript/models/OrderDirection.ts b/connect/typescript/models/OrderDirection.ts new file mode 100644 index 000000000..7b03df3ff --- /dev/null +++ b/connect/typescript/models/OrderDirection.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const OrderDirection = { + Ascending: 'Ascending', + Descending: 'Descending' +} as const; +export type OrderDirection = typeof OrderDirection[keyof typeof OrderDirection]; + + +export function instanceOfOrderDirection(value: any): boolean { + for (const key in OrderDirection) { + if (Object.prototype.hasOwnProperty.call(OrderDirection, key)) { + if ((OrderDirection as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function OrderDirectionFromJSON(json: any): OrderDirection { + return OrderDirectionFromJSONTyped(json, false); +} + +export function OrderDirectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderDirection { + return json as OrderDirection; +} + +export function OrderDirectionToJSON(value?: OrderDirection | null): any { + return value as any; +} + diff --git a/connect/typescript/models/RequestedVerification.ts b/connect/typescript/models/RequestedVerification.ts new file mode 100644 index 000000000..bcb882b6e --- /dev/null +++ b/connect/typescript/models/RequestedVerification.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { VerificationType } from './VerificationType'; +import { + VerificationTypeFromJSON, + VerificationTypeFromJSONTyped, + VerificationTypeToJSON, +} from './VerificationType'; +import type { GovernmentIDOptions } from './GovernmentIDOptions'; +import { + GovernmentIDOptionsFromJSON, + GovernmentIDOptionsFromJSONTyped, + GovernmentIDOptionsToJSON, +} from './GovernmentIDOptions'; + +/** + * + * @export + * @interface RequestedVerification + */ +export interface RequestedVerification { + /** + * + * @type {VerificationType} + * @memberof RequestedVerification + */ + type?: VerificationType; + /** + * + * @type {GovernmentIDOptions} + * @memberof RequestedVerification + */ + governmentIdOptions?: GovernmentIDOptions; +} + +/** + * Check if a given object implements the RequestedVerification interface. + */ +export function instanceOfRequestedVerification(value: object): value is RequestedVerification { + return true; +} + +export function RequestedVerificationFromJSON(json: any): RequestedVerification { + return RequestedVerificationFromJSONTyped(json, false); +} + +export function RequestedVerificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestedVerification { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : VerificationTypeFromJSON(json['type']), + 'governmentIdOptions': json['governmentIdOptions'] == null ? undefined : GovernmentIDOptionsFromJSON(json['governmentIdOptions']), + }; +} + +export function RequestedVerificationToJSON(value?: RequestedVerification | null): any { + if (value == null) { + return value; + } + return { + + 'type': VerificationTypeToJSON(value['type']), + 'governmentIdOptions': GovernmentIDOptionsToJSON(value['governmentIdOptions']), + }; +} + diff --git a/connect/typescript/models/Session.ts b/connect/typescript/models/Session.ts new file mode 100644 index 000000000..ef10f0e11 --- /dev/null +++ b/connect/typescript/models/Session.ts @@ -0,0 +1,135 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { SessionFailCode } from './SessionFailCode'; +import { + SessionFailCodeFromJSON, + SessionFailCodeFromJSONTyped, + SessionFailCodeToJSON, +} from './SessionFailCode'; +import type { Verification } from './Verification'; +import { + VerificationFromJSON, + VerificationFromJSONTyped, + VerificationToJSON, +} from './Verification'; +import type { IDVSessionState } from './IDVSessionState'; +import { + IDVSessionStateFromJSON, + IDVSessionStateFromJSONTyped, + IDVSessionStateToJSON, +} from './IDVSessionState'; + +/** + * + * @export + * @interface Session + */ +export interface Session { + /** + * + * @type {string} + * @memberof Session + */ + id?: string; + /** + * + * @type {string} + * @memberof Session + */ + clientToken?: string; + /** + * + * @type {IDVSessionState} + * @memberof Session + */ + state?: IDVSessionState; + /** + * + * @type {{ [key: string]: Verification; }} + * @memberof Session + */ + verifications?: { [key: string]: Verification; }; + /** + * + * @type {SessionFailCode} + * @memberof Session + */ + failCode?: SessionFailCode; + /** + * + * @type {string} + * @memberof Session + */ + resultVp?: string; + /** + * + * @type {number} + * @memberof Session + */ + created?: number; + /** + * + * @type {number} + * @memberof Session + */ + updated?: number; +} + +/** + * Check if a given object implements the Session interface. + */ +export function instanceOfSession(value: object): value is Session { + return true; +} + +export function SessionFromJSON(json: any): Session { + return SessionFromJSONTyped(json, false); +} + +export function SessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Session { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'clientToken': json['clientToken'] == null ? undefined : json['clientToken'], + 'state': json['state'] == null ? undefined : IDVSessionStateFromJSON(json['state']), + 'verifications': json['verifications'] == null ? undefined : (mapValues(json['verifications'], VerificationFromJSON)), + 'failCode': json['failCode'] == null ? undefined : SessionFailCodeFromJSON(json['failCode']), + 'resultVp': json['resultVp'] == null ? undefined : json['resultVp'], + 'created': json['created'] == null ? undefined : json['created'], + 'updated': json['updated'] == null ? undefined : json['updated'], + }; +} + +export function SessionToJSON(value?: Session | null): any { + if (value == null) { + return value; + } + return { + + 'id': value['id'], + 'clientToken': value['clientToken'], + 'state': IDVSessionStateToJSON(value['state']), + 'verifications': value['verifications'] == null ? undefined : (mapValues(value['verifications'], VerificationToJSON)), + 'failCode': SessionFailCodeToJSON(value['failCode']), + 'resultVp': value['resultVp'], + 'created': value['created'], + 'updated': value['updated'], + }; +} + diff --git a/connect/typescript/models/SessionFailCode.ts b/connect/typescript/models/SessionFailCode.ts new file mode 100644 index 000000000..070e995e1 --- /dev/null +++ b/connect/typescript/models/SessionFailCode.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const SessionFailCode = { + SessionFailNone: 'SessionFailNone', + SessionFailInternal: 'SessionFailInternal', + SessionFailVerificationFailed: 'SessionFailVerificationFailed', + SessionFailAuthentication: 'SessionFailAuthentication', + SessionFailExpired: 'SessionFailExpired', + SessionFailUserCanceled: 'SessionFailUserCanceled', + SessionFailRpcCanceled: 'SessionFailRpcCanceled' +} as const; +export type SessionFailCode = typeof SessionFailCode[keyof typeof SessionFailCode]; + + +export function instanceOfSessionFailCode(value: any): boolean { + for (const key in SessionFailCode) { + if (Object.prototype.hasOwnProperty.call(SessionFailCode, key)) { + if ((SessionFailCode as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function SessionFailCodeFromJSON(json: any): SessionFailCode { + return SessionFailCodeFromJSONTyped(json, false); +} + +export function SessionFailCodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SessionFailCode { + return json as SessionFailCode; +} + +export function SessionFailCodeToJSON(value?: SessionFailCode | null): any { + return value as any; +} + diff --git a/connect/typescript/models/SessionOrdering.ts b/connect/typescript/models/SessionOrdering.ts new file mode 100644 index 000000000..f3b613782 --- /dev/null +++ b/connect/typescript/models/SessionOrdering.ts @@ -0,0 +1,50 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const SessionOrdering = { + Created: 'Created', + Updated: 'Updated', + State: 'State' +} as const; +export type SessionOrdering = typeof SessionOrdering[keyof typeof SessionOrdering]; + + +export function instanceOfSessionOrdering(value: any): boolean { + for (const key in SessionOrdering) { + if (Object.prototype.hasOwnProperty.call(SessionOrdering, key)) { + if ((SessionOrdering as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function SessionOrderingFromJSON(json: any): SessionOrdering { + return SessionOrderingFromJSONTyped(json, false); +} + +export function SessionOrderingFromJSONTyped(json: any, ignoreDiscriminator: boolean): SessionOrdering { + return json as SessionOrdering; +} + +export function SessionOrderingToJSON(value?: SessionOrdering | null): any { + return value as any; +} + diff --git a/connect/typescript/models/ValidationResult.ts b/connect/typescript/models/ValidationResult.ts new file mode 100644 index 000000000..759c6ce48 --- /dev/null +++ b/connect/typescript/models/ValidationResult.ts @@ -0,0 +1,67 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidationResult + */ +export interface ValidationResult { + /** + * + * @type {Array} + * @memberof ValidationResult + */ + readonly memberNames?: Array; + /** + * + * @type {string} + * @memberof ValidationResult + */ + errorMessage?: string; +} + +/** + * Check if a given object implements the ValidationResult interface. + */ +export function instanceOfValidationResult(value: object): value is ValidationResult { + return true; +} + +export function ValidationResultFromJSON(json: any): ValidationResult { + return ValidationResultFromJSONTyped(json, false); +} + +export function ValidationResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationResult { + if (json == null) { + return json; + } + return { + + 'memberNames': json['memberNames'] == null ? undefined : json['memberNames'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + }; +} + +export function ValidationResultToJSON(value?: Omit | null): any { + if (value == null) { + return value; + } + return { + + 'errorMessage': value['errorMessage'], + }; +} + diff --git a/connect/typescript/models/Verification.ts b/connect/typescript/models/Verification.ts new file mode 100644 index 000000000..b610dc166 --- /dev/null +++ b/connect/typescript/models/Verification.ts @@ -0,0 +1,147 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { NormalizedGovernmentIdData } from './NormalizedGovernmentIdData'; +import { + NormalizedGovernmentIdDataFromJSON, + NormalizedGovernmentIdDataFromJSONTyped, + NormalizedGovernmentIdDataToJSON, +} from './NormalizedGovernmentIdData'; +import type { VerificationType } from './VerificationType'; +import { + VerificationTypeFromJSON, + VerificationTypeFromJSONTyped, + VerificationTypeToJSON, +} from './VerificationType'; +import type { VerificationState } from './VerificationState'; +import { + VerificationStateFromJSON, + VerificationStateFromJSONTyped, + VerificationStateToJSON, +} from './VerificationState'; +import type { GovernmentIDOptions } from './GovernmentIDOptions'; +import { + GovernmentIDOptionsFromJSON, + GovernmentIDOptionsFromJSONTyped, + GovernmentIDOptionsToJSON, +} from './GovernmentIDOptions'; +import type { VerificationFailCode } from './VerificationFailCode'; +import { + VerificationFailCodeFromJSON, + VerificationFailCodeFromJSONTyped, + VerificationFailCodeToJSON, +} from './VerificationFailCode'; + +/** + * + * @export + * @interface Verification + */ +export interface Verification { + /** + * + * @type {string} + * @memberof Verification + */ + id?: string; + /** + * + * @type {VerificationType} + * @memberof Verification + */ + type?: VerificationType; + /** + * + * @type {VerificationState} + * @memberof Verification + */ + state?: VerificationState; + /** + * + * @type {VerificationFailCode} + * @memberof Verification + */ + failCode?: VerificationFailCode; + /** + * + * @type {boolean} + * @memberof Verification + */ + reused?: boolean; + /** + * + * @type {number} + * @memberof Verification + */ + updated?: number; + /** + * + * @type {GovernmentIDOptions} + * @memberof Verification + */ + governmentIdOptions?: GovernmentIDOptions; + /** + * + * @type {NormalizedGovernmentIdData} + * @memberof Verification + */ + normalizedGovernmentIdData?: NormalizedGovernmentIdData; +} + +/** + * Check if a given object implements the Verification interface. + */ +export function instanceOfVerification(value: object): value is Verification { + return true; +} + +export function VerificationFromJSON(json: any): Verification { + return VerificationFromJSONTyped(json, false); +} + +export function VerificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Verification { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'type': json['type'] == null ? undefined : VerificationTypeFromJSON(json['type']), + 'state': json['state'] == null ? undefined : VerificationStateFromJSON(json['state']), + 'failCode': json['failCode'] == null ? undefined : VerificationFailCodeFromJSON(json['failCode']), + 'reused': json['reused'] == null ? undefined : json['reused'], + 'updated': json['updated'] == null ? undefined : json['updated'], + 'governmentIdOptions': json['governmentIdOptions'] == null ? undefined : GovernmentIDOptionsFromJSON(json['governmentIdOptions']), + 'normalizedGovernmentIdData': json['normalizedGovernmentIdData'] == null ? undefined : NormalizedGovernmentIdDataFromJSON(json['normalizedGovernmentIdData']), + }; +} + +export function VerificationToJSON(value?: Verification | null): any { + if (value == null) { + return value; + } + return { + + 'id': value['id'], + 'type': VerificationTypeToJSON(value['type']), + 'state': VerificationStateToJSON(value['state']), + 'failCode': VerificationFailCodeToJSON(value['failCode']), + 'reused': value['reused'], + 'updated': value['updated'], + 'governmentIdOptions': GovernmentIDOptionsToJSON(value['governmentIdOptions']), + 'normalizedGovernmentIdData': NormalizedGovernmentIdDataToJSON(value['normalizedGovernmentIdData']), + }; +} + diff --git a/connect/typescript/models/VerificationFailCode.ts b/connect/typescript/models/VerificationFailCode.ts new file mode 100644 index 000000000..798ecaaa8 --- /dev/null +++ b/connect/typescript/models/VerificationFailCode.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const VerificationFailCode = { + VerificationFailNone: 'VerificationFailNone', + VerificationFailInternal: 'VerificationFailInternal', + VerificationFailInvalidImage: 'VerificationFailInvalidImage', + VerificationFailInauthentic: 'VerificationFailInauthentic', + VerificationFailUnsupportedDocument: 'VerificationFailUnsupportedDocument' +} as const; +export type VerificationFailCode = typeof VerificationFailCode[keyof typeof VerificationFailCode]; + + +export function instanceOfVerificationFailCode(value: any): boolean { + for (const key in VerificationFailCode) { + if (Object.prototype.hasOwnProperty.call(VerificationFailCode, key)) { + if ((VerificationFailCode as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function VerificationFailCodeFromJSON(json: any): VerificationFailCode { + return VerificationFailCodeFromJSONTyped(json, false); +} + +export function VerificationFailCodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerificationFailCode { + return json as VerificationFailCode; +} + +export function VerificationFailCodeToJSON(value?: VerificationFailCode | null): any { + return value as any; +} + diff --git a/connect/typescript/models/VerificationState.ts b/connect/typescript/models/VerificationState.ts new file mode 100644 index 000000000..12fd33ef7 --- /dev/null +++ b/connect/typescript/models/VerificationState.ts @@ -0,0 +1,50 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const VerificationState = { + VerificationPending: 'VerificationPending', + VerificationSuccess: 'VerificationSuccess', + VerificationFailed: 'VerificationFailed' +} as const; +export type VerificationState = typeof VerificationState[keyof typeof VerificationState]; + + +export function instanceOfVerificationState(value: any): boolean { + for (const key in VerificationState) { + if (Object.prototype.hasOwnProperty.call(VerificationState, key)) { + if ((VerificationState as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function VerificationStateFromJSON(json: any): VerificationState { + return VerificationStateFromJSONTyped(json, false); +} + +export function VerificationStateFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerificationState { + return json as VerificationState; +} + +export function VerificationStateToJSON(value?: VerificationState | null): any { + return value as any; +} + diff --git a/connect/typescript/models/VerificationType.ts b/connect/typescript/models/VerificationType.ts new file mode 100644 index 000000000..4f8a778cc --- /dev/null +++ b/connect/typescript/models/VerificationType.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const VerificationType = { + GovernmentId: 'GovernmentId' +} as const; +export type VerificationType = typeof VerificationType[keyof typeof VerificationType]; + + +export function instanceOfVerificationType(value: any): boolean { + for (const key in VerificationType) { + if (Object.prototype.hasOwnProperty.call(VerificationType, key)) { + if ((VerificationType as Record)[key] === value) { + return true; + } + } + } + return false; +} + +export function VerificationTypeFromJSON(json: any): VerificationType { + return VerificationTypeFromJSONTyped(json, false); +} + +export function VerificationTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerificationType { + return json as VerificationType; +} + +export function VerificationTypeToJSON(value?: VerificationType | null): any { + return value as any; +} + diff --git a/connect/typescript/models/index.ts b/connect/typescript/models/index.ts new file mode 100644 index 000000000..c81116a6d --- /dev/null +++ b/connect/typescript/models/index.ts @@ -0,0 +1,23 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './CancelSessionResponse'; +export * from './CreateSessionRequest'; +export * from './CreateSessionResponse'; +export * from './DebugIdvProviderSelection'; +export * from './FailureMessage'; +export * from './GetSessionResponseV1'; +export * from './GovernmentIDOptions'; +export * from './IDVSessionState'; +export * from './ListSessionsRequest'; +export * from './ListSessionsResponseV1'; +export * from './NormalizedGovernmentIdData'; +export * from './OrderDirection'; +export * from './RequestedVerification'; +export * from './Session'; +export * from './SessionFailCode'; +export * from './SessionOrdering'; +export * from './ValidationResult'; +export * from './Verification'; +export * from './VerificationFailCode'; +export * from './VerificationState'; +export * from './VerificationType'; diff --git a/connect/typescript/runtime.ts b/connect/typescript/runtime.ts new file mode 100644 index 000000000..433ba21c4 --- /dev/null +++ b/connect/typescript/runtime.ts @@ -0,0 +1,426 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Connect API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "https://connect-api.trinsic.id".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/devops/make-swagger.ps1 b/devops/make-swagger.ps1 new file mode 100644 index 000000000..a022072f2 --- /dev/null +++ b/devops/make-swagger.ps1 @@ -0,0 +1,110 @@ +# Parameters: +param ( + [string]$language = "typescript-fetch", + [string]$swaggerFile = "$PSScriptRoot/../connect/swagger_api.json", + [string]$outputFolder = "$PSScriptRoot/../connect/typescript" +) +# Example usage: +# .\generate-sdk.ps1 -language typescript-fetch -swaggerFile "C:\path\to\connect\api\autorest\swagger_api.json" -outputFolder "C:\path\to\connect\sdk\typescript" + +if (-not (Test-Path $swaggerFile)) { + throw "The swagger file '$swaggerFile' does not exist." +} +if (-not (Test-Path $outputFolder)) { + # Make the output folder if it doesn't exist + New-Item -ItemType Directory -Path $outputFolder +} + +function Simplify-Path { + param ( + [string]$path + ) + + # Resolve the path to its simplest form + $simplifiedPath = Resolve-Path -Path $path + return $simplifiedPath +} + +# Simplify the paths +$swaggerFile = Simplify-Path -path $swaggerFile +$outputFolder = Simplify-Path -path $outputFolder + + +# Get the base directory (one level above the script directory) +$baseDir = Split-Path -Parent $PSScriptRoot + +# Convert absolute paths to relative paths based on the base directory +function Convert-ToRelativePath { + param ( + [string]$absolutePath, + [string]$baseDirectory + ) + + $uri = New-Object System.Uri($absolutePath) + $baseUri = New-Object System.Uri($baseDirectory) + + if ($baseUri.IsBaseOf($uri)) { + $relativeUri = $baseUri.MakeRelativeUri($uri) + $relativeUri = [System.Uri]::UnescapeDataString($relativeUri.ToString()) + # Remove the leading "/sdk" from the relative path + $relativeUri = $relativeUri -replace "^sdk/", "" + return $relativeUri + } + else { + throw "The path '$absolutePath' is not within the base directory '$baseDirectory'." + } +} + +function Remove-OpenApiFiles { + param ( + [string]$baseDirectory + ) + # Define the path to the file containing the list of files to delete + $openApiFiles = "$baseDirectory/.openapi-generator/FILES" + + # Check if the file exists + if (-Not (Test-Path -Path $openApiFiles)) { + Write-Error "The file $openApiFiles does not exist." + exit + } + + # Read all lines from the file + $filesToDelete = Get-Content -Path $openApiFiles + + # Iterate over each line and delete the file + foreach ($file in $filesToDelete) { + $filePath = "$baseDirectory/$file" + # Check if the file exists + if (Test-Path -Path $filePath) { + # Attempt to delete the file + try { + Remove-Item -Path $filePath -Force + Write-Output "Deleted file: $filePath" + } catch { + Write-Error "Failed to delete file: $filePath. Error: $_" + } + } else { + Write-Warning "File does not exist: $filePath" + } + } + +} + +# Convert provided paths to relative +$relativeSwaggerFile = Convert-ToRelativePath -absolutePath (Resolve-Path $swaggerFile) -baseDirectory $baseDir +$relativeOutputFolder = Convert-ToRelativePath -absolutePath (Resolve-Path $outputFolder) -baseDirectory $baseDir + +# Change to the base directory +Set-Location $baseDir + +Write-Output "Generating SDK for $language from $relativeSwaggerFile to $relativeOutputFolder. Base directory=$baseDir" + +# Empty the output folder, since openapi-generator-cli can create all intermediate directories +if (Test-Path $relativeOutputFolder) { + Remove-OpenApiFiles -baseDirectory $relativeOutputFolder +} + +docker run --rm -v ".:/local" openapitools/openapi-generator-cli generate ` + -i "/local/$relativeSwaggerFile" ` + -g $language ` + -o "/local/$relativeOutputFolder"